trace-mcp 1.4.1 → 1.5.4
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 +132 -12
- package/dist/cli.js +23123 -20778
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +388 -167
- package/dist/index.js +23786 -21715
- package/dist/index.js.map +1 -1
- package/hooks/trace-mcp-guard.cmd +20 -2
- package/hooks/trace-mcp-guard.sh +41 -2
- package/hooks/trace-mcp-precompact.cmd +33 -0
- package/hooks/trace-mcp-precompact.sh +57 -0
- package/hooks/trace-mcp-worktree.cmd +33 -0
- package/hooks/trace-mcp-worktree.sh +57 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# trace-mcp
|
|
2
2
|
|
|
3
|
-
**Framework-aware code intelligence MCP server —
|
|
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,27 +29,115 @@ trace-mcp builds a **cross-language dependency graph** from your source code and
|
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
##
|
|
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
|
|
33
120
|
|
|
34
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.
|
|
35
122
|
|
|
36
|
-
**Benchmark: trace-mcp's own codebase** (
|
|
123
|
+
**Benchmark: trace-mcp's own codebase** (651 files, 3,342 symbols):
|
|
37
124
|
|
|
38
125
|
```
|
|
39
126
|
Task Without trace-mcp With trace-mcp Reduction
|
|
40
127
|
─────────────────────────────────────────────────────────────────────
|
|
41
|
-
Symbol lookup
|
|
42
|
-
File exploration
|
|
128
|
+
Symbol lookup 41,211 tokens 2,098 tokens 94.9%
|
|
129
|
+
File exploration 16,366 tokens 762 tokens 95.3%
|
|
43
130
|
Search 22,860 tokens 8,000 tokens 65.0%
|
|
44
|
-
Impact analysis
|
|
45
|
-
Call graph
|
|
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%
|
|
46
134
|
─────────────────────────────────────────────────────────────────────
|
|
47
|
-
Total
|
|
135
|
+
Total 426,891 tokens 28,457 tokens 93.3%
|
|
48
136
|
```
|
|
49
137
|
|
|
50
|
-
**
|
|
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.
|
|
51
139
|
|
|
52
|
-
**Savings scale with project size.** On a
|
|
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).
|
|
53
141
|
|
|
54
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.
|
|
55
143
|
|
|
@@ -113,7 +201,7 @@ trace-mcp add # register current project for indexing
|
|
|
113
201
|
|
|
114
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.
|
|
115
203
|
|
|
116
|
-
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`).
|
|
117
205
|
|
|
118
206
|
Start your MCP client and use:
|
|
119
207
|
```
|
|
@@ -182,6 +270,38 @@ All trace-mcp state is centralized:
|
|
|
182
270
|
my-app-a1b2c3d4e5f6.db # per-project databases (named by project + hash)
|
|
183
271
|
```
|
|
184
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
|
+
|
|
185
305
|
---
|
|
186
306
|
|
|
187
307
|
## Getting the most out of trace-mcp
|
|
@@ -427,4 +547,4 @@ The full workflow is in [`.github/workflows/ci.yml`](.github/workflows/ci.yml)
|
|
|
427
547
|
|
|
428
548
|
---
|
|
429
549
|
|
|
430
|
-
Built by [Nikolai Vysotskyi](https://github.com/
|
|
550
|
+
Built by [Nikolai Vysotskyi](https://github.com/nikolai-vysotskyi)
|