CodeGraph MCP
Structural questions about code instead of brute-forcing files: 38 languages, 42 tools, VS Code and JetBrains plugins, a CI mode
- 155 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- The engine is downloaded as a native executable and runs with the user's rights
- The index and embeddings keep source code fragments on disk
Install
- Works in
Manual install
/path/to/codegraph-server --mcpStarts the MCP server and the command goes into `~/.claude.json`.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The engine is downloaded as a native executable and runs with the user's rights
- The index and embeddings keep source code fragments on disk
This is third-party code. Review the repository files before installing.
What it does
CodeGraph builds a semantic graph of code: functions, classes, imports and call chains. Parsing runs through tree-sitter for 38 languages, with embeddings for semantic search and a persistent memory layer on top of the graph. The agent gets 42 MCP tools and asks structural questions instead of brute-forcing files: who calls a function, what an edit affects, where the duplicates are. Embedding models to choose from: `bge-small` by default, `jina-code-v2`, `granite-97m` and the very fast `static`. The engine is built from source or downloaded as a ready binary into `~/.codegraph/bin`, and the same engine serves the VS Code extension and the JetBrains plugin. For CI there is a `--graph-only` mode, and `codegraph-server --graph-only --run-tool codegraph_pr_context` prepares a pull request comment: blast radius, test gaps, stale docs and suggested reviewers. Rules for agents live in a separate repository.
Who it is for. Developers of large multi-language codebases who need the agent to navigate relationships and not to brute-force files.
Good fit when
- Before editing a function you need to know who calls it and which tests the change touches
- A monorepo in five languages where text search gives too much noise
- CI needs an automatic pull request comment with the blast radius of a change
- The agent looks for duplicate functions by meaning and not by exact text match
Not a fit when
- The project is small: the agent's built-in search is enough and an index adds a needless layer
- You need a cloud service without a local binary: the engine runs on your machine
- You only need text search over logs or documents: the graph is built from source code
Example request
Show who calls the function parse_config, which modules its change affects and which tests are worth rerunningMCP
- Transport
- stdio
- Authentication
- not required
Limitations
The engine is not bundled in the extension: on first activation it asks to confirm downloading the binary for the platform, verifies the checksum and puts it into `~/.codegraph/bin`, since it is a native executable running with the user's rights. After moving to version 0.21 each project rebuilds its embeddings once in the background and a running `--watch` daemon must be restarted. Old indexes from version 0.20.1 and earlier carry no model info. The license is Apache 2.0 and the last commit dates from October 6, 2026. Rules for agents live in the `codegraph-rules-for-agents` repository.
How to disable. Remove the `codegraph` entry from `~/.claude.json`, the extension and the JetBrains plugin, and delete the binary and indexes by hand from `~/.codegraph`.
FAQ
How do I connect CodeGraph to Claude Code?
Put a `codegraph` server in `~/.claude.json` with the command `/path/to/codegraph-server` and the argument `--mcp`. The current directory is indexed on its own.
How many tools and languages are there?
42 MCP tools and 38 languages through tree-sitter. Tools are split by task: structure, calls, impact, semantic search and memory.
What is the `--graph-only` mode?
It is a mode without embeddings and ONNX that indexes 10–50 times faster and needs no keys. It suits CI, for example `codegraph-server --graph-only --run-tool codegraph_pr_context`.
How do I pick an embedding model?
With the `--embedding-model` flag: `bge-small` by default, `jina-code-v2` six times slower, `granite-97m` with a 32K context and `static` on model2vec about a hundred times faster.
What to do after upgrading to 0.21?
Wait: each project rebuilds its embeddings once in the background and keyword search works during the rebuild. Restart the `--watch` daemon.
Discussion
No questions or reviews yet.
Related
MCP serversCode dependency graph for VS Code, the CLI and MCP: imports, calls, cycles, dead code and change impact.
Local code graph for agents: an MCP server returns entry points, symbol links and change impact in one call
CodeGraph (Rust)
codegraph-rust
A Rust code graph for agents: four MCP tools show what an edit will touch, how the architecture fits together and where the fragile spots are
A CLI that builds a function-level dependency graph for 34 languages and serves it to agents through a 34-tool MCP server.
Code graph and project memory in one Rust program: the agent gets excerpts with file and line citations
An MCP server that builds a code knowledge graph: semantic search, call graph, HTTP route tracing and change impact analysis.
README in short
A short description and quick start: an MCP server for Claude Code, a VS Code extension, a JetBrains plugin, rules for agents and a GitHub Action for pull request review. Then come notes on moving to 0.21, a table of server flags and configuration details.