
How to add CodeGraphContext to Claude Desktop
Index local code into a graph database to give AI assistants deep, queryable code context. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.
Last updated June 14, 2026 ยท 3.8kโ ยท stdio ยท no auth
Claude Desktop config for CodeGraphContext
pip install codegraphcontext{
"mcpServers": {
"codegraphcontext": {
"command": "codegraphcontext",
"args": [
"mcp",
"start"
],
"env": {
"NEO4J_URI": "YOUR_NEO4J_URI",
"NEO4J_USERNAME": "YOUR_NEO4J_USERNAME",
"NEO4J_PASSWORD": "YOUR_NEO4J_PASSWORD"
}
}
}
}Setup steps
- 1Open Claude Desktop โ Settings โ Developer โ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
- 2Paste the CodeGraphContext config below under the top-level "mcpServers" key.
- 3Fill in any placeholder secrets (API keys, paths) in the snippet.
- 4Save the file, then fully quit and reopen Claude Desktop.
- 5Open a chat and confirm CodeGraphContext's tools appear under the ๐ tools menu.
Before you start
- Python 3.10 or later
- pip package manager
- Git (optional, for cloning repositories)
- A graph database backend โ embedded FalkorDB Lite / KuzuDB requires no setup; external Neo4j is optional via `codegraphcontext neo4j setup`
What CodeGraphContext can do in Claude Desktop
add_code_to_graphPerforms a one-time scan of a local folder to add its code to the graph. Ideal for indexing libraries, dependencies, or projects not being actively modified. Returns a job ID for background processing.
check_job_statusCheck the status and progress of a background job.
list_jobsList all background jobs and their current status.
find_codeFind relevant code snippets related to a keyword (e.g., function name, class name, or content).
analyze_code_relationshipsAnalyze code relationships like 'who calls this function' or 'class hierarchy'.
watch_directoryContinuously monitors a directory and keeps the graph updated.
execute_cypher_queryRun a read-only Cypher query against the code graph.
add_package_to_graphAdd a package to the graph.
Security
The MCP protocol connection itself requires no auth. The optional `env` block in the config supplies Neo4j credentials (NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD) only when using an external Neo4j backend; the default embedded database (FalkorDB Lite / KuzuDB) needs none. CGC stores database credentials in ~/.codegraphcontext/.env. The execute_cypher_query tool is documented as read-only.
CodeGraphContext + Claude Desktop FAQ
Where is the Claude Desktop config file?
Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the CodeGraphContext config there under the "mcpServers" key and restart the client.
Is CodeGraphContext safe to use with Claude Desktop?
The MCP protocol connection itself requires no auth. The optional `env` block in the config supplies Neo4j credentials (NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD) only when using an external Neo4j backend; the default embedded database (FalkorDB Lite / KuzuDB) needs none. CGC stores database credentials in ~/.codegraphcontext/.env. The execute_cypher_query tool is documented as read-only.
Is a Neo4j server required?
No. CodeGraphContext uses an embedded graph database by default (FalkorDB Lite on Unix, or KuzuDB cross-platform), so no extra setup is needed for most users. Neo4j is an optional external backend configured via `codegraphcontext neo4j setup`, and its credentials go in the config's env block.
Which languages are supported?
23 languages including Python, JavaScript, TypeScript/TSX, Java, C, C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Dart, Perl, Lua, Scala, Haskell, Elixir, Emacs Lisp, HTML, and CSS. Each parser extracts functions, classes, methods, parameters, inheritance, calls, and imports.
How do I configure my AI IDE?
Run `codegraphcontext mcp setup` to auto-detect and configure VS Code, Cursor, Windsurf, Zed, Claude, Gemini CLI, ChatGPT Codex, Cline, RooCode, Amazon Q Developer, Kiro, Goose, or OpenCode. You can also configure manually by adding the mcpServers block to your client's settings, then start the server with `codegraphcontext mcp start`.