一个MCP服务器,提供Neo4j图数据库与Claude Desktop之间的集成,通过自然语言交互实现图数据库操作,为图数据库的使用带来了极大的便利。
你可以直接使用npx
运行此MCP服务器:
npx @alanse/mcp-neo4j
或将其添加到Claude Desktop配置中:
{
"mcpServers": {
"neo4j": {
"command": "npx",
"args": ["@alanse/mcp-neo4j-server"],
"env": {
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USERNAME": "neo4j",
"NEO4J_PASSWORD": "你的密码"
}
}
}
}
此服务器提供了与Neo4j数据库交互的工具:
execute_query
:在Neo4j数据库上执行Cypher查询
create_node
:创建图数据库中的新节点
create_relationship
:在现有节点之间建立关系
npm install -g @alanse/mcp-neo4j-server
git clone git://github.com/your-account/mcp-neo4j.git
cd mcp-neo4j
npm install
设置以下环境变量:
export NEO4J_URI=bolt://localhost:7687
export NEO4J_USERNAME=neo4j
export NEO4J_PASSWORD=你的密码
mcp neo4j execute_query --query "MATCH (n) RETURN count(n)"
mcp neo4j create_node --labels Person --props '{"name": "Alice", "age": 30}'
mcp neo4j create_relationship --start-id node1_id --end-id node2_id --type KNOWS --props '{"since": "2024"}'
运行测试套件:
npm test
MIT