trace-mcp 1.17.0 → 1.19.0

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
@@ -13,6 +13,29 @@
13
13
 
14
14
  ---
15
15
 
16
+ ## What trace-mcp does for you
17
+
18
+ | You ask | trace-mcp answers | How |
19
+ |---|---|---|
20
+ | "What breaks if I change this model?" | Blast radius across languages + risk score + linked architectural decisions | `get_change_impact` — reverse dependency graph + decision memory |
21
+ | "Why was auth implemented this way?" | The actual decision record with reasoning and tradeoffs | `query_decisions` — searches the decision knowledge graph linked to code |
22
+ | "I'm starting a new task" | Optimal code subgraph + relevant past decisions + dead-end warnings | `plan_turn` — opening-move router with decision enrichment |
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
+ | "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
+ | "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-federation client calls with confidence scores | `get_federation_impact` — topology graph traversal |
27
+ | "Orient me — I just opened this project" | Project identity + active decisions + memory stats in ~300 tokens | `get_wake_up` — layered context assembly |
28
+
29
+ **Three things no other tool does:**
30
+
31
+ 1. **Framework-aware edges** — trace-mcp understands that `Inertia::render('Users/Show')` connects PHP to Vue, that `@Injectable()` creates a DI dependency, that `$user->posts()` means a `posts` table from migrations. 53 integrations across 14 frameworks, 7 ORMs, 12 UI libraries.
32
+
33
+ 2. **Code-linked decision memory** — when you record "chose PostgreSQL for JSONB support", it's linked to `src/db/connection.ts::Pool#class`. When someone runs `get_change_impact` on that symbol, they see the decision. MemPalace stores decisions as text; trace-mcp ties them to the dependency graph.
34
+
35
+ 3. **Cross-session intelligence** — past sessions are mined for decisions and indexed for search. When you start a new session, `get_wake_up` gives you orientation in ~300 tokens; `plan_turn` shows relevant past decisions for your task; `get_session_resume` carries over structural context from previous sessions.
36
+
37
+ ---
38
+
16
39
  ## The problem
17
40
 
18
41
  AI coding agents are language-aware but **framework-blind**.
@@ -39,7 +62,7 @@ trace-mcp builds a **cross-language dependency graph** from your source code and
39
62
 
40
63
  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.
41
64
 
42
- _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)._
65
+ _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/nikolai-vysotskyi/trace-mcp/issues)._
43
66
 
44
67
  ### vs. token-efficient code exploration
45
68
 
@@ -64,21 +87,23 @@ Tools that help AI agents read code with fewer tokens — AST parsing, outlines,
64
87
 
65
88
  Tools that persist context across AI agent sessions — activity logs, knowledge graphs, memory compression.
66
89
 
67
- | Capability | trace-mcp | claude-mem | OpenMemory | engram | ConPort | memory-bank-mcp |
90
+ | Capability | trace-mcp | MemPalace | claude-mem | OpenMemory | engram | ConPort |
68
91
  |---|:---:|:---:|:---:|:---:|:---:|:---:|
69
- | **GitHub stars** | — | 45.7K | 3.9K | 2.3K | 761 | 892 |
70
- | Cross-session context carryover | ✅ `get_session_resume` | ✅ core focus | ✅ | ✅ | ✅ | ✅ |
71
- | Session journal (what was explored) | ✅ tool calls, files, dead ends | ✅ tool call capture | ❌ | partial | ❌ | ❌ |
72
- | Context compaction snapshot | ✅ ~200 tokens | ✅ AI-compressed | decay engine | unverified | ❌ | |
73
- | Code-graph-aware memory | ✅ tied to symbols & deps | ❌ text-only | ❌ text-only | ❌ text-only | ❌ text-only | ❌ text-only |
74
- | Token usage analytics | ✅ per-tool cost breakdown | partial | | ❌ | ❌ | ❌ |
75
- | Optimization recommendations | ✅ waste detection, A/B savings | | ❌ | ❌ | ❌ | ❌ |
76
- | Code intelligence included | ✅ 120+ tools | ❌ | ❌ | ❌ | ❌ | ❌ |
77
- | Knowledge graph | ✅ code dependency graph | | temporal | ❌ | project-level | ❌ |
78
- | Works as standalone memory | code-focused | ❌ Claude-specific | agent-agnostic | agent-agnostic | project-scoped | general-purpose |
79
- | Written in | TypeScript | TypeScript | TS + Python | Go | Python | TypeScript |
80
-
81
- > **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.
92
+ | **GitHub stars** | — | 43K | 45.7K | 3.9K | 2.3K | 761 |
93
+ | Cross-session context carryover | ✅ `get_session_resume` + decisions | ✅ wings/rooms | ✅ core focus | ✅ | ✅ | ✅ |
94
+ | Cross-session content search | ✅ `search_sessions` FTS5 | ✅ ChromaDB semantic | ❌ | | ❌ | ❌ |
95
+ | Decision knowledge graph | ✅ temporal, code-linked | ✅ temporal (text-only) | | temporal | ❌ | project-level |
96
+ | Code-graph-aware memory | ✅ decisions symbols & files | ❌ text-only | ❌ text-only | ❌ text-only | ❌ text-only | ❌ text-only |
97
+ | Auto-extraction from sessions | ✅ pattern-based (0 LLM calls) | via hooks | AI-compressed | ❌ | ❌ | ❌ |
98
+ | Wake-up context | ✅ ~300 tok (code-linked decisions) | ~170 tok (AAAK) | ❌ | ❌ | ❌ | ❌ |
99
+ | Decision enrichment in tools | ✅ impact/plan_turn/resume | ❌ standalone | ❌ | ❌ | ❌ | ❌ |
100
+ | Service/federation scoping | ✅ decisions per service | wings per project | ❌ | | | ❌ |
101
+ | Token usage analytics | per-tool cost breakdown | ❌ | partial | | | |
102
+ | Code intelligence included | 130+ tools | | | | | |
103
+ | Works as standalone memory | ❌ code-focused | ✅ general-purpose | ❌ Claude-specific | ✅ agent-agnostic | ✅ agent-agnostic | ✅ project-scoped |
104
+ | Written in | TypeScript | Python | TypeScript | TS + Python | Go | Python |
105
+
106
+ > **Key difference:** MemPalace stores "decided to use PostgreSQL" as text in ChromaDB. trace-mcp stores the same decision **linked to `src/db/connection.ts::Pool#class`** — and when you run `get_change_impact` on that symbol, the decision shows up in `linked_decisions`. General-purpose memory tools remember *what you said*. trace-mcp remembers *what you said* AND *which code it's about*.
82
107
 
83
108
  ### vs. documentation generation & RAG
84
109
 
@@ -188,13 +213,15 @@ trace-mcp benchmark /path/to/project
188
213
  - **Component trees** — render hierarchy with props / emits / slots (Vue, React, Blade)
189
214
  - **Schema from migrations** — no DB connection needed
190
215
  - **Event chains** — Event → Listener → Job fan-out (Laravel, Django, NestJS, Celery, Socket.io)
191
- - **Change impact analysis** — reverse dependency traversal across languages
192
- - **Graph-aware task context** — describe a dev task get the optimal code subgraph (execution paths, tests, types), adapted to bugfix/feature/refactor intent
216
+ - **Change impact analysis** — reverse dependency traversal across languages, enriched with linked architectural decisions
217
+ - **Decision memory** — mine sessions for decisions, link them to code symbols/files, query with temporal validity. Decisions auto-surface in `get_change_impact`, `plan_turn`, and `get_session_resume`
218
+ - **Cross-session search** — "what did we discuss about auth?" — FTS5 search across all past session content
219
+ - **Graph-aware task context** — describe a dev task → get the optimal code subgraph (execution paths, tests, types) + relevant past decisions, adapted to bugfix/feature/refactor intent
193
220
  - **CI/PR change impact reports** — automated blast radius, risk scoring, test gap detection, architecture violation checks on every PR
194
221
  - **Call graph & DI tree** — bidirectional call graphs with 4-tier resolution confidence, optional LSP enrichment for compiler-grade accuracy, NestJS dependency injection
195
222
  - **ORM model context** — relationships, schema, metadata for 7 ORMs
196
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
197
- - **Multi-repo federation** — link graphs across separate repos via API contracts; cross-repo impact analysis
224
+ - **Multi-service federation** — link graphs across services via API contracts; cross-service impact analysis; service-scoped decisions
198
225
  - **AI-powered analysis** — semantic search with zero-config local ONNX embeddings (no API keys needed), plus optional LLM summarization via Ollama/OpenAI
199
226
 
200
227
  ### Supported stack
@@ -303,6 +330,7 @@ All trace-mcp state is centralized:
303
330
  .config.json # global config + per-project settings
304
331
  registry.json # registered projects
305
332
  topology.db # cross-service topology + federation graph
333
+ decisions.db # decision memory + session content (cross-session knowledge graph)
306
334
  index/
307
335
  my-app-a1b2c3d4e5f6.db # per-project databases (named by project + hash)
308
336
  ```
@@ -432,11 +460,19 @@ Source files (PHP, TS, Vue, Python, Go, Java, Kotlin, Ruby, HTML, CSS, Blade)
432
460
  │ nodes · edges · symbols · routes │
433
461
  │ + embeddings (local ONNX by default) │
434
462
  │ + optional: LLM summaries │
463
+ └────────────────────┬─────────────────────┘
464
+
465
+
466
+ ┌──────────────────────────────────────────┐
467
+ │ Decision Memory (decisions.db) │
468
+ │ decisions · session chunks · FTS5 │
469
+ │ temporal validity · code linkage │
470
+ │ auto-mined from session logs │
435
471
  └────────────────────┬─────────────────────┘
436
472
 
437
473
 
438
474
  MCP server (stdio or HTTP/SSE)
439
- 120+ tools · 2 resources
475
+ 130+ tools · 2 resources
440
476
  ```
441
477
 
442
478
  **Incremental by default** — files are content-hashed; unchanged files are skipped on re-index.
@@ -452,54 +488,129 @@ Source files (PHP, TS, Vue, Python, Go, Java, Kotlin, Ruby, HTML, CSS, Blade)
452
488
  | Document | Description |
453
489
  |---|---|
454
490
  | [Supported frameworks](docs/supported-frameworks.md) | Complete list of languages, frameworks, ORMs, UI libraries, and what each extracts |
455
- | [Tools reference](docs/tools-reference.md) | All 120+ MCP tools with descriptions and usage examples |
491
+ | [Tools reference](docs/tools-reference.md) | All 130+ MCP tools with descriptions and usage examples |
456
492
  | [Configuration](docs/configuration.md) | Config options, AI setup, environment variables, security settings |
457
493
  | [Architecture](docs/architecture.md) | How indexing works, plugin system, project structure, tech stack |
494
+ | [Decision memory](docs/decision-memory.md) | Decision knowledge graph, session mining, cross-session search, wake-up context |
458
495
  | [Analytics](docs/analytics.md) | Session analytics, token savings tracking, optimization reports, benchmarks |
459
496
  | [System prompt routing](docs/tweakcc.md) | Optional tweakcc integration for maximum tool routing enforcement |
460
497
  | [Development](docs/development.md) | Building, testing, contributing, adding new plugins |
461
498
 
462
499
  ---
463
500
 
464
- ## Multi-repo federation
501
+ ## Decision memory
502
+
503
+ Every conversation with an AI agent produces decisions, discoveries, and preferences that disappear when the session ends. trace-mcp's **decision memory** captures them and links them to the code they're about.
504
+
505
+ ### How it works
506
+
507
+ 1. **Mine** — `mine_sessions` scans Claude Code / Claw Code JSONL logs and extracts decisions using pattern matching (no LLM calls). Detects architecture decisions, tech choices, bug root causes, preferences, tradeoffs, discoveries, and conventions.
508
+
509
+ 2. **Link** — each decision can be linked to a code symbol (`src/auth/provider.ts::AuthProvider#class`) or file. When you run `get_change_impact` on that symbol, the decision shows up automatically.
510
+
511
+ 3. **Search** — `query_decisions` supports FTS5 full-text search, filtering by type/service/symbol/file/tag, and temporal queries ("what was true in January?"). `search_sessions` searches raw conversation content across all past sessions.
512
+
513
+ 4. **Surface** — decisions auto-enrich code intelligence tools:
514
+ - `get_change_impact` → `linked_decisions` on the target + affected files
515
+ - `plan_turn` → `related_decisions` matched by task description + target files
516
+ - `get_session_resume` → `active_decisions` for project orientation
517
+
518
+ ### Decision memory MCP tools
519
+
520
+ | Tool | What it does |
521
+ |---|---|
522
+ | `mine_sessions` | Extract decisions from session logs (pattern-based, 0 LLM calls) |
523
+ | `add_decision` | Manually record a decision with code linkage + service scoping |
524
+ | `query_decisions` | Query by type/service/symbol/file/tag + FTS5 search |
525
+ | `invalidate_decision` | Mark a decision as superseded (preserved for history) |
526
+ | `get_decision_timeline` | Chronological history of decisions for a symbol/file |
527
+ | `get_decision_stats` | Knowledge graph overview |
528
+ | `index_sessions` | Index session content for cross-session search |
529
+ | `search_sessions` | FTS5 search: "what did we discuss about auth?" |
530
+ | `get_wake_up` | Compact orientation (~300 tokens): project + decisions + stats |
531
+
532
+ ### Decision memory CLI
533
+
534
+ ```bash
535
+ trace-mcp memory mine # mine sessions for decisions
536
+ trace-mcp memory index # index session content for search
537
+ trace-mcp memory search "GraphQL migration" # search past conversations
538
+ trace-mcp memory decisions --type tech_choice # list decisions
539
+ trace-mcp memory stats # knowledge graph overview
540
+ trace-mcp memory timeline --file src/auth.ts # decision history for a file
541
+ ```
542
+
543
+ ### Temporal validity
544
+
545
+ Decisions have `valid_from` / `valid_until` timestamps. When a decision is superseded, `invalidate_decision` preserves it for historical queries while excluding it from active results:
546
+
547
+ ```
548
+ query_decisions() → only active decisions
549
+ query_decisions(as_of="2025-01-15") → what was true on Jan 15
550
+ query_decisions(include_invalidated=true) → full history
551
+ ```
552
+
553
+ ### Service scoping
554
+
555
+ In projects with multiple services (federations), decisions can be scoped:
556
+
557
+ ```
558
+ add_decision(title="Use JWT", service_name="auth-api")
559
+ query_decisions(service_name="auth-api") → only auth-api decisions
560
+ query_decisions() → all project decisions
561
+ ```
562
+
563
+ > Details: [Decision memory](docs/decision-memory.md)
564
+
565
+ ---
566
+
567
+ ## Federation
568
+
569
+ A **federation** (= service) is an individual microservice or service root within a project — frontend, backend, parser, etc. Each directory with its own root marker (`package.json`, `composer.json`, `go.mod`, etc.) is a federation. A project contains one or more federations; the project itself is not a federation.
465
570
 
466
- Real projects are not a single repository. trace-mcp can **link dependency graphs across separate repos** — if microservice A calls an API endpoint in microservice B, trace-mcp knows that changing that endpoint in B breaks clients in A.
571
+ trace-mcp **links dependency graphs across federations** — if federation A calls an API endpoint in federation B, trace-mcp knows that changing that endpoint in B breaks clients in A. Federations can live inside the project directory or be added from outside.
467
572
 
468
573
  ### How it works
469
574
 
470
575
  Federation is **automatic by default**. Every time a project is indexed (`serve`, `serve-http`, or `index`), trace-mcp:
471
576
 
472
- 1. **Registers** the project in the global federation (`~/.trace-mcp/topology.db`)
473
- 2. **Discovers** services (Docker Compose, workspace detection)
577
+ 1. **Detects federations** within the project root:
578
+ - **Docker Compose** parses `docker-compose.yml` / `compose.yml`
579
+ - **Flat workspace** — first-level subdirs with root markers (e.g. `project/frontend/` + `project/backend/`)
580
+ - **Grouped workspace** — two-level structure (e.g. `project/org/service-a/`)
581
+ - **Monolith fallback** — treats root as a single federation
582
+ 2. **Registers** each federation bound to the project in `~/.trace-mcp/topology.db`
474
583
  3. **Parses** API contracts — OpenAPI/Swagger, GraphQL SDL, Protobuf/gRPC
475
584
  4. **Scans** code for HTTP client calls (fetch, axios, Http::, requests, http.Get, gRPC stubs, GraphQL operations)
476
- 5. **Links** discovered calls to known endpoints from previously indexed repos
477
- 6. **Creates** cross-repo dependency edges
585
+ 5. **Links** discovered calls to known endpoints from other federations
586
+ 6. **Creates** cross-federation dependency edges
478
587
 
479
588
  ### Example
480
589
 
481
590
  ```bash
482
- # Index two separate repos
483
- cd ~/projects/user-service && trace-mcp add
484
- cd ~/projects/order-service && trace-mcp add
591
+ # Index a project — federations are auto-detected
592
+ cd ~/projects/my-app && trace-mcp add
593
+ # → auto-detects: my-app/user-service (has openapi.yaml)
594
+ # → my-app/order-service (has axios.get('/api/users/{id}'))
595
+ # → links order-service → user-service via /api/users/{id}
485
596
 
486
- # order-service has: axios.get('/api/users/{id}')
487
- # user-service has: openapi.yaml with GET /api/users/{id}
488
- # → trace-mcp automatically links them
597
+ # Or add an external federation manually
598
+ trace-mcp federation add --repo=~/projects/external-auth --project=~/projects/my-app
489
599
 
490
- # Check cross-repo impact
600
+ # Check cross-federation impact
491
601
  trace-mcp federation impact --endpoint=/api/users
492
- # → "GET /api/users/{id} is called by 2 client(s) in 1 repo(s)"
602
+ # → "GET /api/users/{id} is called by 2 client(s) in 1 federation(s)"
493
603
  # [order-service] src/services/user-client.ts:42 (axios, confidence: 85%)
494
604
  ```
495
605
 
496
606
  ### Federation CLI
497
607
 
498
608
  ```bash
499
- trace-mcp federation add --repo=../service-b [--contract=openapi.yaml]
609
+ # Add a federation (inside or outside project dir)
610
+ trace-mcp federation add --repo=../service-b --project=. [--contract=openapi.yaml] [--name=my-service]
500
611
  trace-mcp federation remove <name-or-path>
501
- trace-mcp federation list [--json]
502
- trace-mcp federation sync # re-scan all repos
612
+ trace-mcp federation list [--project=.] [--json]
613
+ trace-mcp federation sync # re-scan all federations
503
614
  trace-mcp federation impact --endpoint=/api/users [--method=GET] [--service=user-svc]
504
615
  ```
505
616
 
@@ -507,11 +618,11 @@ trace-mcp federation impact --endpoint=/api/users [--method=GET] [--service=user
507
618
 
508
619
  | Tool | What it does |
509
620
  |---|---|
510
- | `get_federation_graph` | All federated repos, their connections, and stats |
511
- | `get_federation_impact` | Cross-repo impact: what breaks if endpoint X changes (resolves to symbol level) |
512
- | `get_federation_clients` | Find all client calls across repos that call a specific endpoint |
513
- | `federation_add_repo` | Add a repo to the federation via MCP |
514
- | `federation_sync` | Re-scan all federated repos |
621
+ | `get_federation_graph` | All federations, their connections, and stats |
622
+ | `get_federation_impact` | Cross-federation impact: what breaks if endpoint X changes (resolves to symbol level) |
623
+ | `get_federation_clients` | Find all client calls across federations that call a specific endpoint |
624
+ | `federation_add_repo` | Add a federation via MCP (bound to current project, or specify `project`) |
625
+ | `federation_sync` | Re-scan all federations |
515
626
 
516
627
  > Federation builds on top of the topology system. See [Configuration](docs/configuration.md#topology--federation) for options.
517
628