trace-mcp 1.2.1 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # trace-mcp
2
2
 
3
- **Framework-aware code intelligence MCP server — 48+ framework integrations across 68 languages.**
3
+ **Framework-aware code intelligence MCP server — 14 frameworks, 7 ORMs, 12 UI libraries, 20+ other integrations (53 total) across 68 languages. Up to 97% token reduction.**
4
4
 
5
5
  > Your AI agent reads `UserController.php` and sees a class.
6
6
  > trace-mcp reads it and sees a route → controller → FormRequest → Eloquent model → Inertia render → Vue page → child components — **in one graph.**
@@ -29,6 +29,135 @@ trace-mcp builds a **cross-language dependency graph** from your source code and
29
29
 
30
30
  ---
31
31
 
32
+ ## How trace-mcp compares
33
+
34
+ trace-mcp is not just a code intelligence server — it combines **code graph navigation**, **cross-session memory**, and **real-time code understanding** in a single tool. Other projects solve one of these; trace-mcp unifies all three.
35
+
36
+ _Last updated: April 2026. Based on public documentation and GitHub repos. If you maintain one of these projects and see an inaccuracy, [open an issue](https://github.com/nicovs-ai/trace-mcp/issues)._
37
+
38
+ ### vs. token-efficient code exploration
39
+
40
+ Tools that help AI agents read code with fewer tokens — AST parsing, outlines, context packing.
41
+
42
+ | Capability | trace-mcp | Repomix | Context Mode | code-review-graph | jCodeMunch | codebase-memory-mcp |
43
+ |---|:---:|:---:|:---:|:---:|:---:|:---:|
44
+ | **GitHub stars** | — | 23K | 6.6K | 5.1K | 1.5K | 1.3K |
45
+ | Tree-sitter AST parsing | ✅ 68 languages | ✅ compress only (~20) | ❌ no code parsing | ✅ | ✅ ~40 languages | ✅ 66 languages |
46
+ | Token-efficient symbol lookup | ✅ outlines, symbols, bundles | ❌ packs entire files | ✅ sandboxed output | ✅ | ✅ core focus | ✅ |
47
+ | Cross-file dependency graph | ✅ directed edge graph | ❌ | ❌ | ✅ knowledge graph | ✅ import graph | ✅ knowledge graph |
48
+ | Framework-aware edges | ✅ 53 integrations (14 frameworks, 7 ORMs, 12 UI libs) | ❌ | ❌ | ❌ | partial (4 frameworks) | partial (REST routes) |
49
+ | Impact analysis | ✅ reverse dep traversal | ❌ | ❌ | ❌ | ✅ blast radius | ✅ detect_changes |
50
+ | Call graph | ✅ bidirectional | ❌ | ❌ | ❌ | ✅ class hierarchy | ✅ trace_call_path |
51
+ | Refactoring tools | ✅ rename, extract, dead code | ❌ | ❌ | ❌ | ❌ (dead code detect only) | ❌ |
52
+ | Security scanning | ✅ OWASP Top-10, taint | ✅ Secretlint | ❌ | ❌ | ❌ | ❌ |
53
+ | Multi-repo federation | ✅ cross-repo API linking | ✅ remote repos | ❌ | ❌ | ✅ GitHub repos | ❌ |
54
+ | Session memory | ✅ built-in | ❌ | ✅ SQLite journal | ❌ | ✅ index persistence | ✅ persistent graph |
55
+ | Written in | TypeScript | TypeScript | TypeScript | Python | Python | C |
56
+
57
+ ### vs. AI session memory
58
+
59
+ Tools that persist context across AI agent sessions — activity logs, knowledge graphs, memory compression.
60
+
61
+ | Capability | trace-mcp | claude-mem | OpenMemory | engram | ConPort | memory-bank-mcp |
62
+ |---|:---:|:---:|:---:|:---:|:---:|:---:|
63
+ | **GitHub stars** | — | 45.7K | 3.9K | 2.3K | 761 | 892 |
64
+ | Cross-session context carryover | ✅ `get_session_resume` | ✅ core focus | ✅ | ✅ | ✅ | ✅ |
65
+ | Session journal (what was explored) | ✅ tool calls, files, dead ends | ✅ tool call capture | ❌ | partial | ❌ | ❌ |
66
+ | Context compaction snapshot | ✅ ~200 tokens | ✅ AI-compressed | ✅ decay engine | unverified | ❌ | ❌ |
67
+ | Code-graph-aware memory | ✅ tied to symbols & deps | ❌ text-only | ❌ text-only | ❌ text-only | ❌ text-only | ❌ text-only |
68
+ | Token usage analytics | ✅ per-tool cost breakdown | partial | ❌ | ❌ | ❌ | ❌ |
69
+ | Optimization recommendations | ✅ waste detection, A/B savings | ❌ | ❌ | ❌ | ❌ | ❌ |
70
+ | Code intelligence included | ✅ 100+ tools | ❌ | ❌ | ❌ | ❌ | ❌ |
71
+ | Knowledge graph | ✅ code dependency graph | ❌ | ✅ temporal | ❌ | ✅ project-level | ❌ |
72
+ | Works as standalone memory | ❌ code-focused | ❌ Claude-specific | ✅ agent-agnostic | ✅ agent-agnostic | ✅ project-scoped | ✅ general-purpose |
73
+ | Written in | TypeScript | TypeScript | TS + Python | Go | Python | TypeScript |
74
+
75
+ > **Key difference:** General-purpose memory tools remember *what you said*. trace-mcp remembers *what you explored in the codebase* — which symbols you read, what searches found nothing, which files you edited — and ties it to the dependency graph. When you resume, the agent gets structural context, not just conversation history.
76
+
77
+ ### vs. documentation generation & RAG
78
+
79
+ Tools that generate docs from code or provide embedding-based code search for AI retrieval.
80
+
81
+ | Capability | trace-mcp | Repomix | DeepContext | smart-coding-mcp | mcp-local-rag¹ | knowledge-rag¹ |
82
+ |---|:---:|:---:|:---:|:---:|:---:|:---:|
83
+ | **GitHub stars** | — | 23K | 274 | 193 | 204 | 44 |
84
+ | Real-time code understanding | ✅ live graph, always current | ❌ snapshot at pack time | ❌ manual reindex | partial (opt-in watcher) | ❌ | partial (file watcher) |
85
+ | Auto-generated project docs | ✅ `generate_docs` from graph | ❌ raw file dump | ❌ | ❌ | ❌ | ❌ |
86
+ | Semantic code search | ✅ `search` + `query_by_intent` | ❌ no search | ✅ Jina embeddings | ✅ nomic embeddings | ✅ vector search | ✅ hybrid + reranking |
87
+ | Framework-aware context | ✅ routes, models, components | ❌ | ❌ | ❌ | ❌ | ❌ |
88
+ | Task-focused context | ✅ `get_task_context` — code subgraph | ❌ packs everything | ❌ | ❌ | ❌ | ❌ |
89
+ | No doc maintenance needed | ✅ derived from code | ✅ repacks on demand | ❌ manual reindex | partial (auto on startup) | ❌ manual ingest | partial (auto-reindex) |
90
+ | Works offline, no embeddings | ✅ graph + FTS5 | ✅ | ❌ requires cloud API | ❌ requires local embeddings | ❌ requires local embeddings | ❌ requires local embeddings |
91
+ | Incremental updates | ✅ file watcher, content hash | ❌ full repack | ✅ SHA-256 hashing | ✅ file hash + opt-in watcher | ❌ | ✅ mtime + dedup |
92
+ | Written in | TypeScript | TypeScript | TypeScript | JavaScript | TypeScript | Python |
93
+
94
+ _¹ mcp-local-rag and knowledge-rag are document RAG tools (PDF, DOCX, Markdown) — not code-specific. Included for comparison as they occupy adjacent mindshare._
95
+
96
+ > **Key difference:** RAG tools answer "find code similar to this query." trace-mcp answers "show me the execution path, the dependencies, and the tests for this feature." Graph traversal finds structurally relevant code that embedding similarity misses — and never returns stale results because the graph updates incrementally with every file save.
97
+
98
+ ### vs. code graph MCP servers
99
+
100
+ | Capability | trace-mcp | code-review-graph | codebase-memory-mcp | SocratiCode | Narsil-MCP | Roam-Code |
101
+ |---|:---:|:---:|:---:|:---:|:---:|:---:|
102
+ | Languages | 68 | ~10 | 66 | ~15 | 32 | ~10 |
103
+ | Framework integrations | 53 (14 fw + 7 ORM + 12 UI + 20 other) | ❌ | ❌ | ❌ | ❌ | ❌ |
104
+ | Cross-language edges | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
105
+ | MCP tools | 100+ | ~15 | ~20 | ~25 | 90 | 139 |
106
+ | Session memory | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
107
+ | CI/PR reports | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
108
+ | Multi-repo federation | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
109
+ | Security scanning | ✅ | ❌ | ❌ | ❌ | ✅ | ❌ |
110
+ | Refactoring tools | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
111
+ | Architecture governance | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
112
+ | Token savings tracking | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
113
+ | Written in | TypeScript | Python | C | TypeScript | Rust | Python |
114
+
115
+ > **Why framework awareness matters:** A graph that knows `UserController` exists but doesn't know it renders `Users/Show.vue` via Inertia is missing the edges that matter most. Framework integrations turn a syntax graph into a **semantic** graph — the agent sees the same connections a developer sees.
116
+
117
+ ---
118
+
119
+ ## Up to 97% token reduction — real-world benchmark
120
+
121
+ AI agents burn tokens reading files they don't need. trace-mcp returns **precision context** — only the symbols, edges, and signatures relevant to the query.
122
+
123
+ **Benchmark: trace-mcp's own codebase** (651 files, 3,342 symbols):
124
+
125
+ ```
126
+ Task Without trace-mcp With trace-mcp Reduction
127
+ ─────────────────────────────────────────────────────────────────────
128
+ Symbol lookup 41,211 tokens 2,098 tokens 94.9%
129
+ File exploration 16,366 tokens 762 tokens 95.3%
130
+ Search 22,860 tokens 8,000 tokens 65.0%
131
+ Impact analysis 96,717 tokens 4,841 tokens 95.0%
132
+ Call graph 178,661 tokens 10,723 tokens 94.0%
133
+ Composite task 71,076 tokens 2,033 tokens 97.1%
134
+ ─────────────────────────────────────────────────────────────────────
135
+ Total 426,891 tokens 28,457 tokens 93.3%
136
+ ```
137
+
138
+ **93% fewer tokens** to accomplish the same code understanding tasks. That's ~398K tokens saved per exploration session — more headroom for actual coding, fewer context window evictions, lower API costs.
139
+
140
+ **Savings scale with project size.** On a 650-file project, trace-mcp saves ~398K tokens. On a 5,000-file enterprise codebase, savings grow **non-linearly** — without trace-mcp, the agent reads more wrong files before finding the right one. With trace-mcp, graph traversal stays O(relevant edges), not O(total files).
141
+
142
+ **Composite tasks deliver the biggest wins.** A single `get_task_context` call replaces a chain of ~10 sequential operations (search → get_symbol × 5 → Read × 3 → Grep × 2). That's **one round-trip instead of ten**, with 90%+ token reduction.
143
+
144
+ <details>
145
+ <summary>Methodology</summary>
146
+
147
+ Measured using `benchmark_project` — runs six real task categories (symbol lookup, file exploration, text search, impact analysis, call graph traversal, composite task context) against the indexed project. "Without trace-mcp" = estimated tokens from equivalent Read/Grep/Glob operations (full file reads, grep output). "With trace-mcp" = actual tokens returned by trace-mcp tools (targeted symbols, outlines, graph results). Token counts estimated using trace-mcp's built-in savings tracker.
148
+
149
+ Reproduce it yourself:
150
+ ```
151
+ # Via MCP tool
152
+ benchmark_project # runs against the current project
153
+
154
+ # Or via CLI
155
+ trace-mcp benchmark /path/to/project
156
+ ```
157
+ </details>
158
+
159
+ ---
160
+
32
161
  ## Key capabilities
33
162
 
34
163
  - **Request flow tracing** — URL → Route → Middleware → Controller → Service, across 18 backend frameworks
@@ -72,7 +201,7 @@ trace-mcp add # register current project for indexing
72
201
 
73
202
  **Step 2: `add`** — registers a project. Detects frameworks and languages, creates the index database, and adds the project to the global registry. Run this in each project you want trace-mcp to understand.
74
203
 
75
- All state lives in `~/.trace-mcp/` — nothing is stored in your project directory.
204
+ All state lives in `~/.trace-mcp/` — nothing is stored in your project directory (unless you add a `.traceignore` or `.trace-mcp/.config.json`).
76
205
 
77
206
  Start your MCP client and use:
78
207
  ```
@@ -100,17 +229,13 @@ trace-mcp list
100
229
 
101
230
  ### Upgrading
102
231
 
103
- After updating trace-mcp (`npm update -g trace-mcp`), run:
232
+ After updating trace-mcp (`npm update -g trace-mcp`), re-run init in your project directory:
104
233
 
105
234
  ```bash
106
- trace-mcp upgrade
235
+ trace-mcp init
107
236
  ```
108
237
 
109
- This runs database migrations and reindexes **all registered projects** with the latest plugins. To upgrade a specific project:
110
-
111
- ```bash
112
- trace-mcp upgrade /path/to/project
113
- ```
238
+ This runs database migrations, updates MCP client configuration, and reindexes the project with the latest plugins.
114
239
 
115
240
  ### Manual setup
116
241
 
@@ -145,6 +270,38 @@ All trace-mcp state is centralized:
145
270
  my-app-a1b2c3d4e5f6.db # per-project databases (named by project + hash)
146
271
  ```
147
272
 
273
+ ### Excluding files from indexing (.traceignore)
274
+
275
+ Place a `.traceignore` file in the project root to skip files/directories from indexing entirely (gitignore syntax):
276
+
277
+ ```gitignore
278
+ # Skip generated code
279
+ generated/
280
+ *.generated.ts
281
+
282
+ # Skip protobuf output
283
+ *_pb2.py
284
+ *.pb.go
285
+
286
+ # Negation — re-include a specific path
287
+ !generated/keep-this.ts
288
+ ```
289
+
290
+ Common directories (`node_modules`, `.git`, `dist`, `build`, `vendor`, etc.) are skipped automatically.
291
+
292
+ You can also configure ignore rules in `~/.trace-mcp/.config.json` (global) or `project/.trace-mcp/.config.json` (per-project):
293
+
294
+ ```jsonc
295
+ {
296
+ "ignore": {
297
+ "directories": ["proto", "generated"],
298
+ "patterns": ["**/fixtures/**"]
299
+ }
300
+ }
301
+ ```
302
+
303
+ > Details: [Configuration — .traceignore](docs/configuration.md#traceignore)
304
+
148
305
  ---
149
306
 
150
307
  ## Getting the most out of trace-mcp
@@ -390,4 +547,4 @@ The full workflow is in [`.github/workflows/ci.yml`](.github/workflows/ci.yml)
390
547
 
391
548
  ---
392
549
 
393
- Built by [Nikolai Vysotskyi](https://github.com/nickvysotskyi)
550
+ Built by [Nikolai Vysotskyi](https://github.com/nikolai-vysotskyi)