Skip to main content

Use KMGraph in Cursor, Windsurf, VS Code, and JetBrains

"I use Cursor/VS Code/Windsurf. How do I get KMGraph working there?"

You need Node.js 18+, the KMGraph repo cloned locally, and your target IDE installed with MCP support.

Step 1 — Build the MCP server

cd /path/to/knowledge-graph/mcp-server
npm install
npm run build

The server binary is at mcp-server/dist/index.js.

Step 2 — Register the MCP server in your IDE

Open .cursor/mcp.json (create if absent):

{
"mcpServers": {
"kmgraph": {
"command": "node",
"args": ["/path/to/knowledge-graph/mcp-server/dist/index.js"],
"env": {
"KG_CONFIG_PATH": "/path/to/kg-config.json"
}
}
}
}

Restart Cursor. The kg_* tools appear in the MCP tools panel.

Step 3 — Initialize the knowledge graph

In the IDE's AI chat, ask the assistant:

Use kg_config_init to initialize a new knowledge graph for this project.

Or paste the contents of INSTALL.md for automated setup.

Step 4 — Add workflow instructions

Copy core/default-templates/AGENTS-template.md to your project as AGENTS.md. This file gives the AI assistant the KMGraph workflow instructions for non-Claude-Code platforms.

Available MCP tools

All kg_* tools are available: kg_capture, kg_search, kg_config_init, kg_config_list, kg_config_switch, kg_fts5_rebuild, kg_scaffold, kg_check_sensitive.

Ask the AI assistant:

Use kg_search to search for "test" in the knowledge graph.

The tool should return results (or an empty result if the graph is new).