trace-mcp 1.20.0 → 1.21.2
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 +37 -35
- package/dist/cli.js +6334 -3589
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.js +2017 -2227
- package/dist/index.js.map +1 -1
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
| "What did we discuss about GraphQL last month?" | Verbatim conversation fragments with file references | `search_sessions` — FTS5 search across all past session content |
|
|
24
24
|
| "Show me the request flow from URL to rendered page" | Route → Middleware → Controller → Service → View with prop mapping | `get_request_flow` — framework-aware edge traversal |
|
|
25
25
|
| "Find all untested code in this module" | Symbols classified as "unreached" or "imported but never called in tests" | `get_untested_symbols` — test-to-source mapping |
|
|
26
|
-
| "What's the impact of this API change on other services?" | Cross-
|
|
26
|
+
| "What's the impact of this API change on other services?" | Cross-subproject client calls with confidence scores | `get_subproject_impact` — topology graph traversal |
|
|
27
27
|
| "Orient me — I just opened this project" | Project identity + active decisions + memory stats in ~300 tokens | `get_wake_up` — layered context assembly |
|
|
28
28
|
|
|
29
29
|
**Three things no other tool does:**
|
|
@@ -79,7 +79,7 @@ Tools that help AI agents read code with fewer tokens — AST parsing, outlines,
|
|
|
79
79
|
| Call graph | ✅ bidirectional, graph-based | ❌ | ❌ | ❌ | ✅ AST-based, bidirectional | ✅ trace_call_path | ✅ refs/importers |
|
|
80
80
|
| Refactoring tools | ✅ rename, extract, dead code, codemod | ❌ | ❌ | ❌ | ❌ (dead code detect only) | ❌ | ❌ |
|
|
81
81
|
| Security scanning | ✅ OWASP Top-10, taint | ✅ Secretlint | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
82
|
-
| Multi-repo
|
|
82
|
+
| Multi-repo subprojects | ✅ cross-repo API linking | ✅ remote repos | ❌ | ❌ | ✅ GitHub repos | ❌ | ❌ |
|
|
83
83
|
| Session memory | ✅ built-in | ❌ | ✅ SQLite journal | ❌ | ✅ index persistence | ✅ persistent graph | ❌ |
|
|
84
84
|
| Written in | TypeScript | TypeScript | TypeScript | Python | Python | C | Go |
|
|
85
85
|
|
|
@@ -97,7 +97,7 @@ Tools that persist context across AI agent sessions — activity logs, knowledge
|
|
|
97
97
|
| Auto-extraction from sessions | ✅ pattern-based (0 LLM calls) | ✅ via hooks | ✅ AI-compressed | ❌ | ❌ | ❌ |
|
|
98
98
|
| Wake-up context | ✅ ~300 tok (code-linked decisions) | ✅ ~170 tok (AAAK) | ❌ | ❌ | ❌ | ❌ |
|
|
99
99
|
| Decision enrichment in tools | ✅ impact/plan_turn/resume | ❌ standalone | ❌ | ❌ | ❌ | ❌ |
|
|
100
|
-
| Service/
|
|
100
|
+
| Service/subproject scoping | ✅ decisions per service | ✅ wings per project | ❌ | ❌ | ❌ | ❌ |
|
|
101
101
|
| Token usage analytics | ✅ per-tool cost breakdown | ❌ | partial | ❌ | ❌ | ❌ |
|
|
102
102
|
| Code intelligence included | ✅ 130+ tools | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
103
103
|
| Works as standalone memory | ❌ code-focused | ✅ general-purpose | ❌ Claude-specific | ✅ agent-agnostic | ✅ agent-agnostic | ✅ project-scoped |
|
|
@@ -137,7 +137,7 @@ _¹ mcp-local-rag and knowledge-rag are document RAG tools (PDF, DOCX, Markdown)
|
|
|
137
137
|
| MCP tools | 120+ | ~35 | ~15 | ~20 | ~25 | 90 | 139 |
|
|
138
138
|
| Session memory | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
|
|
139
139
|
| CI/PR reports | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
140
|
-
| Multi-repo
|
|
140
|
+
| Multi-repo subprojects | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
141
141
|
| Security scanning | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
|
|
142
142
|
| Refactoring tools | ✅ | ✅ rename, symbol editing | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
143
143
|
| Architecture governance | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
|
|
@@ -221,7 +221,7 @@ trace-mcp benchmark /path/to/project
|
|
|
221
221
|
- **Call graph & DI tree** — bidirectional call graphs with 4-tier resolution confidence, optional LSP enrichment for compiler-grade accuracy, NestJS dependency injection
|
|
222
222
|
- **ORM model context** — relationships, schema, metadata for 7 ORMs
|
|
223
223
|
- **Dead code & test gap detection** — find untested exports/symbols (with "unreached" vs "imported_not_called" classification), dead code, per-symbol test reach in impact analysis
|
|
224
|
-
- **Multi-service
|
|
224
|
+
- **Multi-service subprojects** — link graphs across services via API contracts; cross-service impact analysis; service-scoped decisions
|
|
225
225
|
- **AI-powered analysis** — semantic search with zero-config local ONNX embeddings (no API keys needed), plus optional LLM summarization via Ollama/OpenAI
|
|
226
226
|
|
|
227
227
|
### Supported stack
|
|
@@ -329,7 +329,7 @@ All trace-mcp state is centralized:
|
|
|
329
329
|
~/.trace-mcp/
|
|
330
330
|
.config.json # global config + per-project settings
|
|
331
331
|
registry.json # registered projects
|
|
332
|
-
topology.db # cross-service topology +
|
|
332
|
+
topology.db # cross-service topology + subproject graph
|
|
333
333
|
decisions.db # decision memory + session content (cross-session knowledge graph)
|
|
334
334
|
index/
|
|
335
335
|
my-app-a1b2c3d4e5f6.db # per-project databases (named by project + hash)
|
|
@@ -552,7 +552,7 @@ query_decisions(include_invalidated=true) → full history
|
|
|
552
552
|
|
|
553
553
|
### Service scoping
|
|
554
554
|
|
|
555
|
-
In projects with multiple services (
|
|
555
|
+
In projects with multiple services (subprojects), decisions can be scoped:
|
|
556
556
|
|
|
557
557
|
```
|
|
558
558
|
add_decision(title="Use JWT", service_name="auth-api")
|
|
@@ -564,67 +564,69 @@ query_decisions() → all project decisions
|
|
|
564
564
|
|
|
565
565
|
---
|
|
566
566
|
|
|
567
|
-
##
|
|
567
|
+
## Subprojects
|
|
568
568
|
|
|
569
|
-
A **
|
|
569
|
+
A **subproject** is any working repository that is part of your project's ecosystem: microservices, frontends, backends, shared libraries, CLI tools, etc.
|
|
570
570
|
|
|
571
|
-
|
|
571
|
+
Each directory with its own root marker (`package.json`, `composer.json`, `go.mod`, etc.) is a subproject. A project contains one or more subprojects; the project itself is not a subproject.
|
|
572
|
+
|
|
573
|
+
trace-mcp **links dependency graphs across subprojects** — if subproject A calls an API endpoint in subproject B, trace-mcp knows that changing that endpoint in B breaks clients in A. Subprojects can live inside the project directory or be added from outside.
|
|
572
574
|
|
|
573
575
|
### How it works
|
|
574
576
|
|
|
575
|
-
|
|
577
|
+
Subproject discovery is **automatic by default**. Every time a project is indexed (`serve`, `serve-http`, or `index`), trace-mcp:
|
|
576
578
|
|
|
577
|
-
1. **Detects
|
|
579
|
+
1. **Detects subprojects** within the project root:
|
|
578
580
|
- **Docker Compose** — parses `docker-compose.yml` / `compose.yml`
|
|
579
581
|
- **Flat workspace** — first-level subdirs with root markers (e.g. `project/frontend/` + `project/backend/`)
|
|
580
582
|
- **Grouped workspace** — two-level structure (e.g. `project/org/service-a/`)
|
|
581
|
-
- **Monolith fallback** — treats root as a single
|
|
582
|
-
2. **Registers** each
|
|
583
|
+
- **Monolith fallback** — treats root as a single subproject
|
|
584
|
+
2. **Registers** each subproject bound to the project in `~/.trace-mcp/topology.db`
|
|
583
585
|
3. **Parses** API contracts — OpenAPI/Swagger, GraphQL SDL, Protobuf/gRPC
|
|
584
586
|
4. **Scans** code for HTTP client calls (fetch, axios, Http::, requests, http.Get, gRPC stubs, GraphQL operations)
|
|
585
|
-
5. **Links** discovered calls to known endpoints from other
|
|
586
|
-
6. **Creates** cross-
|
|
587
|
+
5. **Links** discovered calls to known endpoints from other subprojects
|
|
588
|
+
6. **Creates** cross-subproject dependency edges
|
|
587
589
|
|
|
588
590
|
### Example
|
|
589
591
|
|
|
590
592
|
```bash
|
|
591
|
-
# Index a project —
|
|
593
|
+
# Index a project — subprojects are auto-detected
|
|
592
594
|
cd ~/projects/my-app && trace-mcp add
|
|
593
595
|
# → auto-detects: my-app/user-service (has openapi.yaml)
|
|
594
596
|
# → my-app/order-service (has axios.get('/api/users/{id}'))
|
|
595
597
|
# → links order-service → user-service via /api/users/{id}
|
|
596
598
|
|
|
597
|
-
# Or add an external
|
|
598
|
-
trace-mcp
|
|
599
|
+
# Or add an external subproject manually
|
|
600
|
+
trace-mcp subproject add --repo=~/projects/external-auth --project=~/projects/my-app
|
|
599
601
|
|
|
600
|
-
# Check cross-
|
|
601
|
-
trace-mcp
|
|
602
|
-
# → "GET /api/users/{id} is called by 2 client(s) in 1
|
|
602
|
+
# Check cross-subproject impact
|
|
603
|
+
trace-mcp subproject impact --endpoint=/api/users
|
|
604
|
+
# → "GET /api/users/{id} is called by 2 client(s) in 1 subproject(s)"
|
|
603
605
|
# [order-service] src/services/user-client.ts:42 (axios, confidence: 85%)
|
|
604
606
|
```
|
|
605
607
|
|
|
606
|
-
###
|
|
608
|
+
### Subproject CLI
|
|
607
609
|
|
|
608
610
|
```bash
|
|
609
|
-
# Add a
|
|
610
|
-
trace-mcp
|
|
611
|
-
trace-mcp
|
|
612
|
-
trace-mcp
|
|
613
|
-
trace-mcp
|
|
614
|
-
trace-mcp
|
|
611
|
+
# Add a subproject (inside or outside project dir)
|
|
612
|
+
trace-mcp subproject add --repo=../service-b --project=. [--contract=openapi.yaml] [--name=my-service]
|
|
613
|
+
trace-mcp subproject remove <name-or-path>
|
|
614
|
+
trace-mcp subproject list [--project=.] [--json]
|
|
615
|
+
trace-mcp subproject sync # re-scan all subprojects
|
|
616
|
+
trace-mcp subproject impact --endpoint=/api/users [--method=GET] [--service=user-svc]
|
|
615
617
|
```
|
|
616
618
|
|
|
617
619
|
### MCP tools
|
|
618
620
|
|
|
619
621
|
| Tool | What it does |
|
|
620
622
|
|---|---|
|
|
621
|
-
| `
|
|
622
|
-
| `
|
|
623
|
-
| `
|
|
624
|
-
| `
|
|
625
|
-
| `
|
|
623
|
+
| `get_subproject_graph` | All subprojects, their connections, and stats |
|
|
624
|
+
| `get_subproject_impact` | Cross-subproject impact: what breaks if endpoint X changes (resolves to symbol level) |
|
|
625
|
+
| `get_subproject_clients` | Find all client calls across subprojects that call a specific endpoint |
|
|
626
|
+
| `subproject_add_repo` | Add a subproject via MCP (bound to current project, or specify `project`) |
|
|
627
|
+
| `subproject_sync` | Re-scan all subprojects |
|
|
626
628
|
|
|
627
|
-
>
|
|
629
|
+
> Subproject management builds on top of the topology system. See [Configuration](docs/configuration.md#topology--subprojects) for options.
|
|
628
630
|
|
|
629
631
|
---
|
|
630
632
|
|