Neo4j MCP 服务器
用于通过模型上下文协议管理图数据库操作的 Neo4j MCP 服务器实现。
快速开始
使用 npx 直接运行服务器:
NEO4J_CONNECTION=neo4j+s://your-instance.databases.neo4j.io,neo4j,your-password npx neo4j-mcpserver
或安装全局包:
npm install -g neo4j-mcpserver neo4j-mcpserver
环境变量配置
支持两种方式提供连接信息:
- 单一连接字符串:
NEO4J_CONNECTION=<uri>,<user>,<password>
。 - 分离变量:
NEO4J_URI=<your-uri> NEO4J_USER=<your-user> NEO4J_PASSWORD=<your-password>
工具
- neo4j-query:执行 Cypher 查询,例如
MATCH (n) RETURN n LIMIT 5
。
配置 Cursor
在 Cursor 中添加服务器:
- 打开设置 > 功能 > MCP 服务器。
- 添加新服务器并填写命令:
env=NEO4J_URI=your-neo4j-uri,NEO4J_USER=your-neo4j-user,NEO4J_PASSWORD=your-neo4j-password npx -y @neobarrientos/neo4j_mcpserver