
kuzu-mcp-server

2025.04.02
9
JavaScript数据库访问查询执行模式检查数据库
kuzu-mcp-server 是一个 Model Context Protocol 服务器,提供对 Kuzu 数据库的访问。该服务器使 LLMs(大型语言模型)能够检查数据库模式并在提供的 Kuzu 数据库上执行查询。
View on GitHub
Overview
基本能力
产品定位
kuzu-mcp-server 是一个数据库访问工具,专门用于与 Kuzu 数据库交互,提供模式检查和查询执行功能。
核心功能
- 模式获取:通过
getSchema
工具获取 Kuzu 数据库的完整模式,包括所有节点和关系表及其属性。 - 查询执行:通过
query
工具在 Kuzu 数据库上运行 Cypher 查询。 - 查询生成:通过
generateKuzuCypher
提示生成 Kuzu 的 Cypher 查询。
适用场景
- 数据库模式检查:需要快速了解 Kuzu 数据库的结构时。
- 数据库查询执行:需要在 Kuzu 数据库上运行 Cypher 查询时。
- 自然语言查询生成:需要从自然语言问题生成 Cypher 查询时。
工具列表
- getSchema:获取 Kuzu 数据库的完整模式。
- query:在 Kuzu 数据库上运行 Cypher 查询。
- generateKuzuCypher:根据自然语言问题生成 Cypher 查询。
常见问题解答
- 如何运行只读模式?:通过设置
KUZU_READ_ONLY
环境变量为true
来运行只读模式。
使用教程
使用依赖
- Docker(推荐):确保已安装 Docker。
- Node.js 和 npm(开发用):确保已安装 Node.js 和 npm。
安装教程
使用 Docker(推荐)
- 编辑配置文件
config.json
: - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- 在
mcpServers
对象中添加以下配置:json { "mcpServers": { "kuzu": { "command": "docker", "args": [ "run", "-v", "{Absolute Path to the Kuzu database}:/database", "--rm", "-i", "kuzudb/mcp-server" ] } } }
将{Absolute Path to the Kuzu database}
替换为实际路径。 - 重启 Claude Desktop。
使用 Node.js 和 npm(开发用)
- 安装依赖:
npm install
- 编辑配置文件
config.json
: - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- 在
mcpServers
对象中添加以下配置:json { "mcpServers": { "kuzu": { "command": "node", "args": [ "{Absolute Path to this repository}/index.js", "{Absolute Path to the Kuzu database}", ] } } }
将{Absolute Path to this repository}
和{Absolute Path to the Kuzu database}
替换为实际路径。 - 重启 Claude Desktop。
调试方式
- 只读模式调试:
- 在配置文件中设置
KUZU_READ_ONLY
环境变量为true
:json { "mcpServers": { "kuzu": { "command": "docker", "args": [ "run", "-v", "{Absolute Path to the Kuzu database}:/database", "-e", "KUZU_READ_ONLY=true", "--rm", "-i", "kuzudb/mcp-server" ], } } }
- 运行查询时,任何尝试修改数据库的操作都会返回错误。