Skip to content
Kartograph v3.22.0

MCP Server Guide

Kartograph provides an MCP (Model Context Protocol) server at /query/mcp that enables AI agents to query the knowledge graph using openCypher and discover the graph schema.

Provided that you have started the Kartograph development server, the Kartograph MCP server can be registered with any AI Agent that supports HTTP MCP servers. Here we provide detailed instructions for Claude Code and Cursor configuration.

Add the Kartograph MCP server to Claude Code by running this command in your terminal.

Terminal window
claude mcp remove kartograph # Remove any prior versions
claude mcp add \
--transport http \
kartograph \
http://localhost:8000/query/mcp \
--scope user # Allow access from any project
  1. Open Cursor Settings

    Open Cursor settings by typing Command + Shift + J Control + Shift + J , or via menu: File -> Preferences -> Cursor Settings.

  2. Select Tools & MCP

    In the Cursor Settings left sidebar, select Tools & MCP.

    Cursor Settings Tools & MCP Sidebar Button

  3. Open MCP Server Settings

    Depending on whether you have previously added an MCP server to Cursor, either click “Add Custom MCP” or “New MCP Server” (at the bottom of the server list.)

    This will open up Cursor’s mcp.json settings file. This file will either contain configuration for existing MCP servers, or an empty object like:

    {
    "mcpServers": {}
    }

    Cursor MCP settings JSON file

  4. Add Kartograph MCP Server Configuration

    To add Kartograph’s MCP server to cursor, add the following JSON object inside the existing mcpServers object:

    "kartograph": {
    "url": "http://localhost:8000/query/mcp",
    "headers": {
    "x-github-pat": "<your-pat-here>",
    "x-gitlab-pat": "<your-token-here>"
    }
    }

    The full file should look something like:

    {
    "mcpServers": {
    "kartograph": {
    "url": "http://localhost:8000/query/mcp",
    "headers": {
    "x-github-pat": "<your-pat-here>",
    "x-gitlab-pat": "<your-token-here>"
    }
    }
    }
    }
  5. Save the File

    To finish adding the Kartograph MCP server to Cursor, save the mcp.json and re-open Cursor Settings -> Tools & MCP.

    Here, you should see the Kartograph MCP server listed, as shown below.

    Kartograph MCP server listed in Cursor Settings

Execute read-only Cypher queries against the knowledge graph.

Parameters:

  • cypher (string, required) - Cypher query to execute
  • timeout_seconds (int, default: 30, max: 60) - Query timeout
  • max_rows (int, default: 1000, max: 10000) - Maximum results

Example Request:

{
"cypher": "MATCH (p:Person) RETURN p LIMIT 5",
"timeout_seconds": 30,
"max_rows": 100
}

Success Response:

{
"success": true,
"rows": [
{"node": {"id": "person:abc123", "label": "Person", "properties": {"name": "Alice"}}}
],
"row_count": 1,
"truncated": false,
"execution_time_ms": 42.5
}

Error Response:

{
"success": false,
"error_type": "forbidden",
"message": "Query must be read-only. Found forbidden keyword: CREATE"
}