[trace-mcp]

CodeGraph MCP alternative: trace-mcp vs codegraph

TL;DR. codegraph is the largest project in this field by stars, and it made one design decision that is worth understanding before you compare anything else: it defines eight MCP tools and advertises exactly one of them. Everything an agent can ask it goes through codegraph_explore. The reasoning, stated in its own source, is that the other seven are narrower slices of explore and that the mere presence of a tool steers agents into mis-picking it.

trace-mcp bets the other way. It advertises 28 tools on its default preset — navigation, impact analysis, refactoring, security scanning, code-linked memory — because those are genuinely different operations, not slices of one.

Pick codegraph if the job is orient an agent in a repository it has never seen, and you want that to cost almost nothing in advertised schema. Pick trace-mcp if the job continues after orientation.

Head-to-head

Capability trace-mcp codegraph
GitHub stars 102 ~68.6K
License MIT MIT
Languages 81 (tree-sitter) 34 (tree-sitter, Rust kernel + WASM fallback)
Framework integrations ✓ 87 ✓ 17 (route → handler)
Framework edges beyond routing ✓ controller → template, model → table, component → component partial — route → handler, plus React Native component/property nodes
Cross-language edges ✓ Swift ↔ ObjC, RN bridge / TurboModules / Expo / Fabric
MCP tools defined 169 8
MCP tools advertised by default 28 (~11.6K tok) 1 (codegraph_explore)
Rest of the surface reachable load_tools, one call CODEGRAPH_MCP_TOOLS env allowlist, restart
Persistent graph across restarts ✓ SQLite + FTS5 ✓ SQLite
Runs fully local, no API key
Incremental re-index on save ✓ debounced file watcher
Impact analysis ✓ reverse traversal + decorator filter codegraph_impact (behind the allowlist)
Refactoring tools ✓ rename, move, signature, AST codemod, extract
Security scanning ✓ OWASP Top-10, type-aware taint
Control-flow / data-flow ✓ CFG with basic blocks and loop back-edges
SARIF / CI output ✓ 2.1.0, schema-validated
Session memory ✓ code-linked decision graph
Multi-repo ✓ cross-repo API linking into one graph partial — queries other separately-indexed projects by path
Graph visualization ✓ desktop app
Published A/B token benchmark ✗ per-repo get_real_savings instead ✓ 7 repos, methodology disclosed
Written in TypeScript TypeScript + Rust kernel

Verified on August 29, 2026 against codegraph’s source and README at commit 6a056ec — the main head, shipped after the v1.6.0 tag. Tool-surface claims come from the source; language, framework and bridging counts come from the README’s own tables, which the source directory layout corroborates.

When to pick codegraph

When to pick trace-mcp

Where we are not being smug

Three honest points.

Their default surface is cheaper than ours and it is not close. One advertised tool against our 28 and ~11.6K tokens. Our number is down from ~50K after the preset bypass on the daemon path was fixed and the default preset moved to minimal, and everything outside it is one call away — but “much better than we were” is not “as cheap as theirs.”

Their benchmark is better than ours. We publish a conservative 40-50% typical token reduction and ship get_real_savings so you can measure your own repository instead of trusting a number from ours. That is a defensible choice, but it is not a substitute for a published A/B across named repositories with a disclosed harness, and codegraph has one.

They publish their own downside, so we will repeat it rather than quietly use it. codegraph’s README states that its responses leave roughly 80% more retrieval context resident at the end of a multi-turn session than a file-reading agent’s do — 67K tokens against 18K on VS Code. That is a genuine cost of returning rich graph answers, it is a cost trace-mcp pays in its own form, and the fact that they printed it is a point in their favour.

If you maintain codegraph and something here is wrong, open an issue and we will fix it.

FAQ

What is the core difference between codegraph and trace-mcp? codegraph defines eight tools and advertises one, on the reasoning that the rest are narrower slices of explore and that presence itself steers mis-picks. trace-mcp advertises 28 and keeps ~140 more one load_tools call away, because refactoring, security scanning and memory are not slices of navigation.

Does codegraph have a smaller tool surface than trace-mcp? Yes, substantially — one advertised tool against 28 and ~11.6K tokens. That is a cost we pay every session and they do not. What it buys is a much wider set of operations addressable without an env-var opt-in and a restart.

Can codegraph do refactoring or security scanning? No. Reading its source on August 29, 2026 found no rename/move/codemod, no taint analysis, no control-flow graph, no SARIF and no cross-session memory. It is a navigation and discovery tool, and scopes itself that way.

Whose token-savings numbers are better supported? Theirs. Seven repositories, model and queries named, four runs per arm, a documented fix to a flaw in their own earlier harness: 62% fewer tokens, 44% lower cost. Self-run rather than third-party reproduced, but well enough documented to argue with. Ours is a more conservative 40-50%, with get_real_savings measuring your repo instead of a benchmark set.

Do either of them send code to a cloud service? No. Both index locally into SQLite, need no API key, and survive restarts.

Next steps

Last updated: August 30, 2026