kuzu-mcp-server 是一个模型上下文协议(Model Context Protocol)服务器,它提供了对 Kuzu 数据库的访问能力。借助该服务器,大型语言模型可以检查数据库架构,并对指定的 Kuzu 数据库执行查询操作。
config.json:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonmcpServers 对象中:{
"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} 替换为实际路径。
3. 重启 Claude Desktop。
npm installconfig.json:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonmcpServers 对象中:{
"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} 替换为实际路径。
4. 重启 Claude Desktop。
通过设置 KUZU_READ_ONLY 环境变量为 true,服务器可以以只读模式运行。在此模式下,运行任何尝试修改数据库的查询将导致错误。此标志可以在配置文件中如下设置:
{
"mcpServers": {
"kuzu": {
"command": "docker",
"args": [
"run",
"-v",
"{Absolute Path to the Kuzu database}:/database",
"-e",
"KUZU_READ_ONLY=true",
"--rm",
"-i",
"kuzudb/mcp-server"
]
}
}
}
cypher(字符串),即要运行的 Cypher 查询。question(字符串),即要生成 Cypher 查询的自然语言问题。