kuzudb-mcp-server

kuzudb-mcp-server

A Model Context Protocol server that provides access to Kuzu databases. This server enables LLMs to inspect database schemas and execute queries on provided kuzu database.

Category
访问服务器

README

kuzudb-mcp-server

A Model Context Protocol server that provides access to Kuzu databases. This server enables LLMs to inspect database schemas and execute queries on provided kuzu database.

Components

Tools

  • getSchema

    • Fetch the full schema of the Kuzu database, including all nodes and relationships tables and their properties
    • Input: None
  • query

    • Run a Cypher query on the Kuzu database
    • Input: cypher (string): The Cypher query to run

Prompt

  • generateKuzuCypher
    • Generate a Cypher query for Kuzu
    • Argument: question (string): The question in natural language to generate the Cypher query for

Usage with Claude Desktop

With Docker (Recommended)

  • Edit the configuration file config.json:
    • on macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • on Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Add the following configuration to the mcpServers object:
    {
      "mcpServers": {
          "kuzu": {
              "command": "docker",
              "args": [
                  "run",
                  "-v",
                  "{Absolute Path to the Kuzu database}:/database",
                  "--rm",
                  "-i",
                  "kuzudb/mcp-server"
              ]
          }
      }
    }
    
    Change the {Absolute Path to the Kuzu database} to the actual path
  • Restart Claude Desktop

With npm/npx

  • Install globally: npm install -g kuzudb-mcp-server
  • Or use directly with npx: npx kuzudb-mcp-server
  • Edit the configuration file config.json:
    • on macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • on Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Add the following configuration to the mcpServers object:
    {
      "mcpServers": {
          "kuzu": {
              "command": "npx",
              "args": [
                  "kuzudb-mcp-server",
                  "{Absolute Path to the Kuzu database}"
              ]
          }
      }
    }
    
    Change the {Absolute Path to the Kuzu database} to the actual path
  • Restart Claude Desktop

Using Environment Variables

You can also specify the database path using the KUZU_MCP_DATABASE_PATH environment variable instead of passing it as an argument:

{
    "mcpServers": {
        "kuzu": {
            "command": "npx",
            "args": ["kuzudb-mcp-server"],
            "env": {
                "KUZU_MCP_DATABASE_PATH": "{Absolute Path to the Kuzu database}"
            }
        }
    }
}

Alternatively, if you have KUZU_MCP_DATABASE_PATH set in your system environment, the server will automatically use it when no database path argument is provided.

Read-Only Mode

The server can be run in read-only mode by setting the KUZU_READ_ONLY environment variable to true. In this mode, running any query that attempts to modify the database will result in an error. This flag can be set in the configuration file as follows:

With npm/npx:

{
    "mcpServers": {
        "kuzu": {
            "command": "npx",
            "args": [
                "kuzudb-mcp-server",
                "{Absolute Path to the Kuzu database}"
            ],
            "env": {
                "KUZU_READ_ONLY": "true"
            }
        }
    }
}

With Docker:

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

Multi-Agent Coordination (Experimental)

The server supports multi-agent coordination to allow multiple AI agents (e.g., Claude Desktop and Claude Code) to share the same Kuzu database safely. This feature addresses Kuzu's single-writer limitation through transparent file-based locking.

Enabling Multi-Agent Mode

Set the following environment variables in your configuration:

  • KUZU_MULTI_AGENT=true - Enable multi-agent coordination
  • KUZU_AGENT_ID=string - Unique identifier for the agent (e.g., "claude-desktop", "claude-code")
  • KUZU_LOCK_TIMEOUT=number - Lock timeout in milliseconds (default: 10000)

Claude Desktop Configuration

{
    "mcpServers": {
        "kuzu": {
            "command": "npx",
            "args": ["kuzudb-mcp-server", "/path/to/database"],
            "env": {
                "KUZU_MULTI_AGENT": "true",
                "KUZU_AGENT_ID": "claude-desktop"
            }
        }
    }
}

Claude Code Configuration

{
    "mcpServers": {
        "kuzu": {
            "command": "npx",
            "args": ["kuzudb-mcp-server", "/path/to/database"],
            "env": {
                "KUZU_MULTI_AGENT": "true",
                "KUZU_AGENT_ID": "claude-code"
            }
        }
    }
}

How It Works

When multi-agent mode is enabled:

  • Read queries execute immediately without coordination
  • Write queries (CREATE, MERGE, SET, DELETE, etc.) acquire an exclusive lock
  • Locks are automatically released after query completion
  • Stale locks from crashed processes are detected and cleaned up
  • Lock conflicts result in clear error messages with retry suggestions

Important Notes

  • This feature is experimental and designed for local development scenarios
  • Both agents must point to the same database path
  • The lock file (.mcp_write_lock) is created in the database directory
  • Lock timeout defaults to 10 seconds, which covers most operations

Development

To build from source:

# Clone the repository
git clone https://github.com/jordanburke/kuzudb-mcp-server.git
cd kuzudb-mcp-server

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Run development mode with watch
pnpm run dev

# Run tests and linting
pnpm run lint
pnpm run typecheck
pnpm run format:check

For local development, you can also configure Claude Desktop to use the local build:

{
    "mcpServers": {
        "kuzu": {
            "command": "node",
            "args": [
                "/path/to/kuzudb-mcp-server/dist/index.js",
                "/path/to/kuzu/database"
            ]
        }
    }
}

Documentation

Core Features

Bug Workarounds

Environment Variables

Variable Description Default
KUZU_READ_ONLY Enable read-only mode false
KUZU_MAX_RETRIES Connection recovery retry attempts 2
KUZU_MULTI_AGENT Enable multi-agent coordination false
KUZU_AGENT_ID Unique agent identifier unknown-{pid}
KUZU_LOCK_TIMEOUT Lock acquisition timeout (ms) 10000
KUZU_MCP_DATABASE_PATH Database path if not provided as argument -

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选