Code-Graph-RAG — Claude Code MCP server: what it does, how to install
Code-Graph-RAG MCP server indexes codebases into a knowledge graph using Tree-sitter for natural language queries. It runs during repository analysis.
MIT ★ 5,392 updated 2026-11-16
claude mcp add --env ORCHESTRATOR_PROVIDER=<ORCHESTRATOR_PROVIDER> --env ORCHESTRATOR_MODEL=<ORCHESTRATOR_MODEL> --env ORCHESTRATOR_API_KEY=<ORCHESTRATOR_API_KEY> --env CYPHER_PROVIDER=<CYPHER_PROVIDER> --env CYPHER_MODEL=<CYPHER_MODEL> --transport stdio code-graph-rag -- uvx code-graph-ragWhat Code-Graph-RAG does
Code-Graph-RAG parses source files, extracts methods and modules, and stores them as an interconnected graph in an embedded SQLite database. It requires ORCHESTRATOR_API_KEY and CYPHER_API_KEY environment variables to operate.
The system translates user requests into Cypher queries over the generated graph structure. This supports searching source code, locating dead code, and performing AST-based patches.
To install it in Claude Code, run claude mcp add code-graph-rag -e ORCHESTRATOR_API_KEY=<ORCHESTRATOR_API_KEY> -e CYPHER_API_KEY=<CYPHER_API_KEY> -- uvx code-graph-rag.
What it helps with
- index a repository into a knowledge graph
- find functions or classes by intent or name
- locate dead code via call graph traversal
- edit code using AST patterns
Example prompts for the agent
- Index the repository with
cgr start --update-graph - Find all callers of the authentication function
- Rewrite the logging module using an AST pattern
How to install Code-Graph-RAG
Platform CLI
claude mcp add --env ORCHESTRATOR_PROVIDER=<ORCHESTRATOR_PROVIDER> --env ORCHESTRATOR_MODEL=<ORCHESTRATOR_MODEL> --env ORCHESTRATOR_API_KEY=<ORCHESTRATOR_API_KEY> --env CYPHER_PROVIDER=<CYPHER_PROVIDER> --env CYPHER_MODEL=<CYPHER_MODEL> --transport stdio code-graph-rag -- uvx code-graph-ragReplace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from code-graph-rag <command>
Platform CLI
codex mcp add code-graph-rag --env ORCHESTRATOR_PROVIDER=<ORCHESTRATOR_PROVIDER> --env ORCHESTRATOR_MODEL=<ORCHESTRATOR_MODEL> --env ORCHESTRATOR_API_KEY=<ORCHESTRATOR_API_KEY> --env CYPHER_PROVIDER=<CYPHER_PROVIDER> --env CYPHER_MODEL=<CYPHER_MODEL> -- uvx code-graph-ragReplace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from code-graph-rag <command>
Config file
{
"mcpServers": {
"code-graph-rag": {
"command": "uvx",
"args": [
"code-graph-rag"
],
"env": {
"ORCHESTRATOR_PROVIDER": "<ORCHESTRATOR_PROVIDER>",
"ORCHESTRATOR_MODEL": "<ORCHESTRATOR_MODEL>",
"ORCHESTRATOR_API_KEY": "<ORCHESTRATOR_API_KEY>",
"CYPHER_PROVIDER": "<CYPHER_PROVIDER>",
"CYPHER_MODEL": "<CYPHER_MODEL>"
}
}
}
}Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from code-graph-rag <command>
Config file
{
"servers": {
"code-graph-rag": {
"type": "stdio",
"command": "uvx",
"args": [
"code-graph-rag"
],
"env": {
"ORCHESTRATOR_PROVIDER": "<ORCHESTRATOR_PROVIDER>",
"ORCHESTRATOR_MODEL": "<ORCHESTRATOR_MODEL>",
"ORCHESTRATOR_API_KEY": "<ORCHESTRATOR_API_KEY>",
"CYPHER_PROVIDER": "<CYPHER_PROVIDER>",
"CYPHER_MODEL": "<CYPHER_MODEL>"
}
}
}
}Replace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from code-graph-rag <command>
Platform CLI
gemini mcp add -e ORCHESTRATOR_PROVIDER=<ORCHESTRATOR_PROVIDER> -e ORCHESTRATOR_MODEL=<ORCHESTRATOR_MODEL> -e ORCHESTRATOR_API_KEY=<ORCHESTRATOR_API_KEY> -e CYPHER_PROVIDER=<CYPHER_PROVIDER> -e CYPHER_MODEL=<CYPHER_MODEL> code-graph-rag uvx code-graph-ragReplace <…> with your own values. 4 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from code-graph-rag <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Code-Graph-RAG
How to install Code-Graph-RAG in Claude Code?
Run claude mcp add code-graph-rag -e ORCHESTRATOR_API_KEY=<ORCHESTRATOR_API_KEY> -e CYPHER_API_KEY=<CYPHER_API_KEY> -- uvx code-graph-rag.
What does Code-Graph-RAG do?
It parses multi-language codebases with Tree-sitter, builds a structural knowledge graph, and answers natural language queries about the code.
What is required to run Code-Graph-RAG?
The server requires ORCHESTRATOR_API_KEY and CYPHER_API_KEY API keys configured in the environment.