SSyncDev

Codegraph MCP Server

Static call graph for TypeScript, JavaScript and Python repos: who calls what, change impact with evidence, traces and hotspots.

Local server

What is the Codegraph MCP Server?

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.

What you can ask it

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.

Running it

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.

Keeping the graph fresh

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.

Where static analysis stops

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.

Recorded 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.

ToolWhat it does
who_callsList every call site of a symbol with source locations.
impactRank what a change affects by risk, with the call chain for each.
traceTrace the call path between two symbols.
calleesList what a function calls.
dead_codeFind orphan functions.
cyclesDetect import cycles.
hotspotsSurface heavily connected code.
searchSearch symbols in the graph.
archaeologyPer-line git blame history for a symbol: commit, author and linked PR.

How to install the Codegraph MCP Server

{
  "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.

Frequently asked questions

TypeScript, JavaScript and Python. Barrel-style re-export chains are currently handled on the TypeScript side only.