Static call graph for TypeScript, JavaScript and Python repos: who calls what, change impact with evidence, traces and hotspots.
Change one function and the honest question is what breaks two or three hops away. An editor's find-references shows one hop. A text search matches strings, not calls. The Codegraph MCP server answers the deeper question by parsing a whole TypeScript, JavaScript or Python repository with tree-sitter into a graph of functions, classes and files linked by calls, inheritance and imports. Every edge points back to a source location, and nothing is uploaded or embedded.
Nine tools are exposed to an agent:
| Tool | Answers |
|---|---|
who_calls |
Every call site of a symbol, with locations |
impact |
What a change touches, ranked by risk, each with its call chain |
trace |
The path between two symbols, e.g. an entry point and a DB call |
callees |
What a function itself calls |
dead_code |
Orphan functions nothing reaches |
cycles |
Import cycles |
hotspots |
Heavily connected code |
search |
Symbol lookup |
archaeology |
git blame -C history per line: commit, author, linked PR |
The risk score in impact decays by a factor of 0.8 per hop, with different weights per edge type. archaeology is the one to reach for when you inherit an unfamiliar module.
It is written in Rust. Clone it and run cargo build --release, then index a repo with codegraph index --root <repo>. For an MCP client, point the command at the built binary with mcp --root /path/to/your/repo; the same entry works in Claude Code and Cursor. If you would rather skip the Rust toolchain, a Dockerfile is included and docker run -i with your repo mounted at /repo starts the stdio server.
You do not rebuild by hand. Before each tool call it compares file modification times and sizes, and incrementally re-parses anything that drifted. Parsing runs only on changed files while symbol resolution reruns over the full view, and a fuzz test in CI checks that incremental results match a full rebuild. Benchmarks on a synthetic 700-file, 105,000-line corpus show roughly 0.77 seconds for a full rebuild and about 0.2 seconds per query; treat those as indicative.
Results from the Codegraph MCP server are only as good as the parse, and it says so openly. Untyped obj.method() calls in JavaScript often cannot be resolved and land in an explicit dynamic bucket rather than a guess. Decorator routing, DI containers and monkey-patching are flagged the same way. Chains cover calls, not data flow. Large real-world monorepos with layered tsconfig setups have not been benchmarked.
It pairs naturally with a Git server or Serena; more options sit under developer tools.
Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.
| Tool | What it does |
|---|---|
| who_calls | List every call site of a symbol with source locations. |
| impact | Rank what a change affects by risk, with the call chain for each. |
| trace | Trace the call path between two symbols. |
| callees | List what a function calls. |
| dead_code | Find orphan functions. |
| cycles | Detect import cycles. |
| hotspots | Surface heavily connected code. |
| search | Search symbols in the graph. |
| archaeology | Per-line git blame history for a symbol: commit, author and linked PR. |
{
"mcpServers": {
"codegraph": {
"command": "/path/to/codegraph",
"args": [
"mcp",
"--root",
"/path/to/your/repo"
]
}
}
}Build the binary first with cargo build --release and point command at it. Replace the --root value with the repository to analyse.
Read, search and edit files inside allowed directories with the Model Context Protocol reference Filesystem server.
Retrieve version-aware library documentation and code examples with Context7 MCP, using resolve-library-id and query-docs.
Trace AI agent execution: every tool call, every error, every dollar. Open source, local-first.
This MCP server provides both general command management tools and **dynamic command-specific tools**:
Smart lists that your AI can actually use. Manage lists via MCP, CLI, or REST API.
A MCP(Model Context Protocol) server that accesses to lightdash( https://www.lightdash.com/ )