Kuzu数据库协议服务器

一个为Kuzu数据库提供访问的模型上下文协议服务器,允许LLM检查数据库模式并执行查询。

  • by kuzudb
  • JavaScript
  • 本地部署
  • 41 星标
  • 更新于
在 GitHub 查看 kuzudb/kuzu-mcp-server

使用说明

kuzu mcp服务器

提供对Kuzu数据库访问的模型上下文协议服务器。此服务器使LLM能够检查数据库模式并在提供的kuzu数据库上执行查询。

组件

工具

  • getSchema

    • 获取Kuzu数据库的完整模式,包括所有节点和关系表及其属性
    • 输入:无
  • 怎么翻译

    • 在Kuzu数据库上运行Cypher查询
    • 输入: cypher (string):要运行的Cypher查询

提示

  • 生成KuzuCypher
    • 为Kuzu生成Cypher查询
    • 论点: question (string):用自然语言生成Cypher查询的问题

使用Claude Desktop

使用Docker(推荐)

  • 编辑配置文件 config.json:
    • 在 macOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
    • 在Windows上: %APPDATA%\Claude\claude_desktop_config.json
  • 将以下配置添加到 mcpServers 对象:
    {
      "mcpServers": {
          "kuzu": {
              "command": "docker",
              "args": [
                  "run",
                  "-v",
                  "{Path to the directory containing Kuzu database file}:/database",
                  "-e",
                  "KUZU_DB_FILE={Kuzu database file name}",
                  "--rm",
                  "-i",
                  "kuzudb/mcp-server"
              ]
          }
      }
    }
    
    更改 {Path to the directory containing Kuzu database file} 到实际路径
  • 重新启动克劳德桌面

使用Node.js和npm(用于开发)

  • 安装依赖项: npm install
  • 编辑配置文件 config.json:
    • 在 macOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
    • 在Windows上: %APPDATA%\Claude\claude_desktop_config.json
  • 将以下配置添加到 mcpServers 对象:
    {
      "mcpServers": {
          "kuzu": {
              "command": "node",
              "args": [
                  "{Absolute Path to this repository}/index.js",
                  "{Absolute Path to the Kuzu database file}",
              ]
          }
      }
    }
    
    更改 {Absolute Path to this repository} 和 {Absolute Path to the Kuzu database file} 到实际路径
  • 重新启动克劳德桌面

只读模式

通过设置以下参数,服务器可以在只读模式下运行 KUZU_READ_ONLY 环境变量 true。在此模式下,运行任何试图修改数据库的查询都会导致错误。此标志可以在配置文件中设置,如下所示:

{
    "mcpServers": {
        "kuzu": {
            "command": "docker",
            "args": [
                "run",
                "-v",
                "{Path to the directory containing Kuzu database file}:/database",
                "-e",
                "KUZU_DB_FILE={Kuzu database file name}",
                "-e",
                "KUZU_READ_ONLY=true",
                "--rm",
                "-i",
                "kuzudb/mcp-server"
            ],
        }
    }
}