
KuzuDB
STDIOMCP server providing access to Kuzu graph databases for LLM interactions.
MCP server providing access to Kuzu graph databases for LLM interactions.
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.
getSchema
query
cypher
(string): The Cypher query to runquestion
(string): The question in natural language to generate the Cypher query forconfig.json
:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
mcpServers
object:
Change the{ "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}
to the actual pathnpm install -g kuzudb-mcp-server
npx kuzudb-mcp-server
config.json
:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
mcpServers
object:
Change the{ "mcpServers": { "kuzu": { "command": "npx", "args": [ "kuzudb-mcp-server", "{Absolute Path to the Kuzu database}" ] } } }
{Absolute Path to the Kuzu database}
to the actual pathYou 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.
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:
{ "mcpServers": { "kuzu": { "command": "npx", "args": [ "kuzudb-mcp-server", "{Absolute Path to the Kuzu database}" ], "env": { "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" ] } } }
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.
Set the following environment variables in your configuration:
KUZU_MULTI_AGENT=true
- Enable multi-agent coordinationKUZU_AGENT_ID=string
- Unique identifier for the agent (e.g., "claude-desktop", "claude-code")KUZU_LOCK_TIMEOUT=number
- Lock timeout in milliseconds (default: 10000){ "mcpServers": { "kuzu": { "command": "npx", "args": ["kuzudb-mcp-server", "/path/to/database"], "env": { "KUZU_MULTI_AGENT": "true", "KUZU_AGENT_ID": "claude-desktop" } } } }
{ "mcpServers": { "kuzu": { "command": "npx", "args": ["kuzudb-mcp-server", "/path/to/database"], "env": { "KUZU_MULTI_AGENT": "true", "KUZU_AGENT_ID": "claude-code" } } } }
When multi-agent mode is enabled:
.mcp_write_lock
) is created in the database directoryTo 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" ] } } }
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 | - |