Skip to main content
Glama
kuzudb

Kuzu MCP server

Official
by kuzudb

query

Execute Cypher queries on a Kuzu graph database to retrieve, create, or modify data. Integrates with tools like Claude Desktop or Cursor for streamlined database interactions.

Instructions

Run a Cypher query on the Kuzu database

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cypherNoThe Cypher query to run

Implementation Reference

  • Handler for the "query" tool: extracts cypher from arguments, executes it using conn.query, retrieves all rows, serializes with bigint replacer, and returns as text content.
    if (request.params.name === "query") {
      const cypher = request.params.arguments.cypher;
      try {
        const queryResult = await conn.query(cypher);
        const rows = await queryResult.getAll();
        queryResult.close();
        return {
          content: [{
            type: "text", text: JSON.stringify(rows, bigIntReplacer, 2)
          }],
          isError: false,
        };
      } catch (error) {
        throw error;
      }
  • index.js:150-162 (registration)
    Registration of the "query" tool in the ListTools response, including name, description, and input schema.
    {
      name: "query",
      description: "Run a Cypher query on the Kuzu database",
      inputSchema: {
        type: "object",
        properties: {
          cypher: {
            type: "string",
            description: "The Cypher query to run",
          },
        },
      },
    },
  • Input schema definition for the "query" tool, specifying the required 'cypher' string parameter.
    inputSchema: {
      type: "object",
      properties: {
        cypher: {
          type: "string",
          description: "The Cypher query to run",
        },
      },
    },
Install Server

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kuzudb/kuzu-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server