trace-mcp is a framework-aware code intelligence MCP server for AI coding agents. It first builds a cross-language dependency graph of the codebase once, then provides structured answers to MCP-capable agents through the Model Context Protocol, letting agents reason based on precomputed structure instead of repeatedly reading the entire repository.
Purpose and the problem it solves: on every turn, AI agents repeatedly read the same files, re-traverse the same dependencies, and stuff already-discovered structure back into the context window. This repeated computation causes token consumption, latency, and hallucinations that grow with project size. trace-mcp reduces this repetition by indexing once, keeping the index up to date incrementally, and providing answers to each agent that asks. Official example: instead of using 80 Grep calls and 190 file reads to answer "what will break if I modify this model," an agent calls get_change_impact once to get the blast radius across PHP, Vue, migrations, and dependency injection.
Main capabilities:
- Framework-aware edges: understands that Inertia::render('Users/Show') connects PHP and Vue, that @Injectable() forms dependency injection dependencies, that $user->posts() corresponds to the posts table in migrations, and more. Officially stated to have 88 framework integrations.
- Cross-language dependency graph navigation: covers 81 languages and 182 tools, supporting routes, ORM relationships, dependency injection trees, call graphs, change impact analysis, and rename refactoring.
- Decision memory linked to code: when recording "chose PostgreSQL to support JSONB," it is linked to a specific symbol (such as src/db/connection.ts::Pool#class), and this decision can be seen when running change impact analysis on that symbol.
- Cross-session intelligence: mines decisions from past sessions and builds a search index; on a new session, get_wake_up provides direction in about 300 tokens, plan_turn shows historical decisions relevant to the task, and get_wake_up { scope: "resume" } carries over the structural context of the previous session.
- Code and knowledge in the same graph: can point to markdown knowledge bases (Obsidian, Logseq, plain MD), and the engine indexes them the same way: each note becomes a note:<basename> symbol, headings become nested sections, [[wikilinks]] and ![[embeds]] become graph edges, and frontmatter and #tags become metadata; PageRank, Signal Fusion ranking, embeddings, and rename refactoring all apply equally.
How to use it: as an MCP server, it works with any MCP client such as Claude Code, Cursor, Codex, Windsurf, Zed, and others. When using only the MCP server and CLI, npm install -g trace-mcp is enough to complete installation. There is also an optional Electron desktop app (packages/app): it manages multiple projects, provides one-click integration with MCP clients (detecting Claude Code, Claude Desktop, Cursor, Windsurf, Continue, Junie, JetBrains AI, Codex, AMP, Warp, Factory Droid, and others), and provides a GPU-accelerated graphical browser (based on cosmos.gl). The app and MCP clients use the same daemon (http://127.0.0.1:3741),应用内索引的内容立即可供 Used by Claude Code / Cursor, etc. The desktop app is installed on macOS by dragging the .dmg into Applications, and on Windows by running trace-mcp.Setup.<version>.exe.
Results and benchmarks: The official measurements were taken on 60 merged PRs across six non-owned open-source repositories (hono, axios, express, requests, flask, got). The median token count for assembling review context was 3,291, compared with 13,595 for loading the diff and all involved files, a reduction of 72.7% (counted using gpt-tokenizer). The same batch of 60 PRs was blindly evaluated twice; the trace-mcp group understood the changes in 67% of PRs, versus 65% for naive file loading; false positives were 0.80 versus 0.58 per PR. The repository also publishes the benchmark methodology, reproducible scripts, and the 56 PRs that did not benefit. Measurements from the desktop app's Benchmark Lab on trace-mcp 3.33.0: the file-reading control group used 82,412 tokens across 13 calls (8/8 correct), the minimal group answered 7/8 correctly with 512 tokens (−99.4%), and the standard group answered 8/8 correctly with 13,657 tokens (−83.4%).
Limitations and caveats (explicitly stated in the materials): The official source emphasizes that these are measurement results for a specific build version and do not represent the current version; the 67.4% workload figure comes from a registered sampling framework, several earlier figures changed due to framework changes, and half of the baseline is still a handwritten estimate; 4 of the 23 measured tools returned more tokens than the reads they replaced, and another 2 tools (register_edit, reindex) do not replace any file reads and are counted as overhead at zero benefit; when all are included, the figure is 66.5%. The app's modifications to client configuration are limited to configurations that users themselves could also change; it does not patch client binaries, intercept traffic, or rewrite user files; the only exception that can be declined is the Max tier's tweakcc pairing, which runs a third-party patcher. Some Max tier features are exclusive to Claude Code. Warp and JetBrains AI require manually pasting the configuration in the IDE because their configuration storage is GUI-only. Desktop apps 3.10.0 and earliercannot self-update and require manual reinstallation or running trace-mcp install-app.
Use cases: teams and individuals who need to reduce AI agent token consumption and latency on large or cross-language codebases; scenarios using MCP clients such as Claude Code, Cursor, and Windsurf for code understanding, change impact analysis, refactoring, and review; and users who manage both code and markdown knowledge bases (Obsidian, Logseq).