trace-mcp 1.20.1 → 1.22.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/LICENSE +21 -137
- package/README.md +46 -36
- package/dist/cli.js +7235 -3991
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.js +2703 -2527
- package/dist/index.js.map +1 -1
- package/package.json +12 -5
package/LICENSE
CHANGED
|
@@ -1,137 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright 2026 Nikolai Vysotskyi
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
of the features or functionality of the software.
|
|
23
|
-
|
|
24
|
-
You may not alter, remove, or obscure any licensing, copyright, or other
|
|
25
|
-
notices of the licensor in the software. Any use of the licensor's trademarks
|
|
26
|
-
is subject to applicable law.
|
|
27
|
-
|
|
28
|
-
## Ethical Use Restrictions
|
|
29
|
-
|
|
30
|
-
In addition to the limitations above, you may NOT use, deploy, integrate, or
|
|
31
|
-
incorporate this software (in whole or in part, directly or indirectly) in any
|
|
32
|
-
of the following contexts:
|
|
33
|
-
|
|
34
|
-
### 1. Military and Warfare
|
|
35
|
-
|
|
36
|
-
(a) Military operations, including but not limited to combat planning,
|
|
37
|
-
logistics of armed conflict, targeting, and battlefield management.
|
|
38
|
-
(b) Development, production, testing, maintenance, or deployment of weapons,
|
|
39
|
-
weapons systems, munitions, or military-grade equipment.
|
|
40
|
-
(c) Military intelligence gathering or military reconnaissance.
|
|
41
|
-
|
|
42
|
-
### 2. Violence and Harm
|
|
43
|
-
|
|
44
|
-
(a) Any project, product, or service whose purpose or foreseeable effect is to
|
|
45
|
-
facilitate, promote, or cause physical violence against individuals or
|
|
46
|
-
groups.
|
|
47
|
-
(b) Development or operation of autonomous systems designed to cause physical
|
|
48
|
-
harm to persons.
|
|
49
|
-
|
|
50
|
-
### 3. Surveillance
|
|
51
|
-
|
|
52
|
-
(a) Mass surveillance of populations, including but not limited to: collection,
|
|
53
|
-
aggregation, or analysis of personal data of individuals without their
|
|
54
|
-
informed, voluntary consent and without lawful authority.
|
|
55
|
-
(b) Social scoring systems that rank, classify, or restrict individuals' rights
|
|
56
|
-
or access to services based on aggregated behavioral data.
|
|
57
|
-
(c) Facial recognition or biometric identification systems used for tracking
|
|
58
|
-
individuals without their explicit consent.
|
|
59
|
-
|
|
60
|
-
### 4. Discrimination and Oppression
|
|
61
|
-
|
|
62
|
-
(a) Any use that facilitates discrimination, oppression, or persecution of
|
|
63
|
-
individuals or groups based on race, ethnicity, national origin, religion,
|
|
64
|
-
gender, sexual orientation, disability, or political opinion.
|
|
65
|
-
(b) Any use in systems designed to suppress freedom of expression, freedom of
|
|
66
|
-
assembly, or freedom of the press.
|
|
67
|
-
|
|
68
|
-
## Ethical Restrictions Apply to Derivative Works
|
|
69
|
-
|
|
70
|
-
Any derivative work based on this software, in whole or in part, must retain
|
|
71
|
-
and be subject to the Ethical Use Restrictions set forth above. You may not
|
|
72
|
-
re-license, sublicense, or otherwise distribute derivative works under terms
|
|
73
|
-
that remove, weaken, or circumvent these restrictions.
|
|
74
|
-
|
|
75
|
-
## Clarifications
|
|
76
|
-
|
|
77
|
-
- Use by civilian government agencies for non-military, non-surveillance
|
|
78
|
-
purposes (e.g., healthcare, education, public infrastructure) is permitted.
|
|
79
|
-
- Use by medical or humanitarian organizations, including those operating in
|
|
80
|
-
conflict zones for the purpose of saving lives, is permitted.
|
|
81
|
-
- Security research, defensive cybersecurity, and lawful penetration testing
|
|
82
|
-
are permitted.
|
|
83
|
-
- Standard business analytics and application monitoring that process only
|
|
84
|
-
aggregated, anonymized data are not considered surveillance.
|
|
85
|
-
- Law enforcement use is permitted only where it does not conflict with the
|
|
86
|
-
Ethical Use Restrictions above.
|
|
87
|
-
|
|
88
|
-
## Notices
|
|
89
|
-
|
|
90
|
-
You must ensure that anyone who gets a copy of any part of the software from
|
|
91
|
-
you also gets a copy of these terms.
|
|
92
|
-
|
|
93
|
-
If you modify the software, you must include in any modified copies of the
|
|
94
|
-
software prominent notices stating that you have modified the software.
|
|
95
|
-
|
|
96
|
-
## No Other Rights
|
|
97
|
-
|
|
98
|
-
These terms do not imply any licenses other than those expressly granted in
|
|
99
|
-
these terms.
|
|
100
|
-
|
|
101
|
-
## Termination
|
|
102
|
-
|
|
103
|
-
If you use the software in violation of these terms, such use is not licensed,
|
|
104
|
-
and your licenses will automatically terminate. If the licensor provides you
|
|
105
|
-
with a notice of your violation, and you cease all violation of these terms no
|
|
106
|
-
later than 30 days after you receive that notice, your licenses will be
|
|
107
|
-
reinstated retroactively. However, if you violate these terms after such
|
|
108
|
-
reinstatement, any additional violation of these terms will cause your licenses
|
|
109
|
-
to terminate automatically and permanently.
|
|
110
|
-
|
|
111
|
-
## No Liability
|
|
112
|
-
|
|
113
|
-
As far as the law allows, the software comes as is, without any warranty or
|
|
114
|
-
condition, and the licensor will not be liable to you for any damages arising
|
|
115
|
-
out of these terms or the use or nature of the software, under any kind of
|
|
116
|
-
legal claim.
|
|
117
|
-
|
|
118
|
-
## Definitions
|
|
119
|
-
|
|
120
|
-
The **licensor** is the entity offering these terms, and the **software** is
|
|
121
|
-
the software the licensor makes available under these terms, including any
|
|
122
|
-
portion of it.
|
|
123
|
-
|
|
124
|
-
**you** refers to the individual or entity agreeing to these terms, including
|
|
125
|
-
any legal entity, sole proprietorship, or other organization that you work for,
|
|
126
|
-
plus all organizations that have control over, are under the control of, or are
|
|
127
|
-
under common control with that organization. **control** means ownership of
|
|
128
|
-
substantially all the assets of an entity, or the power to direct its
|
|
129
|
-
management and policies by vote, contract, or otherwise. Control can be direct
|
|
130
|
-
or indirect.
|
|
131
|
-
|
|
132
|
-
**your licenses** are all the licenses granted to you for the software under
|
|
133
|
-
these terms.
|
|
134
|
-
|
|
135
|
-
**use** means anything you do with the software requiring one of your licenses.
|
|
136
|
-
|
|
137
|
-
**trademark** means trademarks, service marks, and similar rights.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nikolai Vysotskyi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
<h1 align="center">trace-mcp</h1>
|
|
6
6
|
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://glama.ai/mcp/servers/nikolai-vysotskyi/trace-mcp"><img src="https://glama.ai/mcp/servers/nikolai-vysotskyi/trace-mcp/badges/score.svg" alt="Glama score" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/trace-mcp"><img src="https://img.shields.io/npm/v/trace-mcp" alt="npm version" /></a>
|
|
10
|
+
<img src="https://img.shields.io/node/v/trace-mcp" alt="Node.js version" />
|
|
11
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License" /></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
7
14
|
<p align="center">
|
|
8
15
|
<strong>Framework-aware code intelligence MCP server — 14 frameworks, 7 ORMs, 12 UI libraries, 20+ other integrations (53 total) across 68 languages. Up to 99% token reduction.</strong>
|
|
9
16
|
</p>
|
|
@@ -23,7 +30,7 @@
|
|
|
23
30
|
| "What did we discuss about GraphQL last month?" | Verbatim conversation fragments with file references | `search_sessions` — FTS5 search across all past session content |
|
|
24
31
|
| "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
32
|
| "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-
|
|
33
|
+
| "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
34
|
| "Orient me — I just opened this project" | Project identity + active decisions + memory stats in ~300 tokens | `get_wake_up` — layered context assembly |
|
|
28
35
|
|
|
29
36
|
**Three things no other tool does:**
|
|
@@ -79,7 +86,7 @@ Tools that help AI agents read code with fewer tokens — AST parsing, outlines,
|
|
|
79
86
|
| Call graph | ✅ bidirectional, graph-based | ❌ | ❌ | ❌ | ✅ AST-based, bidirectional | ✅ trace_call_path | ✅ refs/importers |
|
|
80
87
|
| Refactoring tools | ✅ rename, extract, dead code, codemod | ❌ | ❌ | ❌ | ❌ (dead code detect only) | ❌ | ❌ |
|
|
81
88
|
| Security scanning | ✅ OWASP Top-10, taint | ✅ Secretlint | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
82
|
-
| Multi-repo
|
|
89
|
+
| Multi-repo subprojects | ✅ cross-repo API linking | ✅ remote repos | ❌ | ❌ | ✅ GitHub repos | ❌ | ❌ |
|
|
83
90
|
| Session memory | ✅ built-in | ❌ | ✅ SQLite journal | ❌ | ✅ index persistence | ✅ persistent graph | ❌ |
|
|
84
91
|
| Written in | TypeScript | TypeScript | TypeScript | Python | Python | C | Go |
|
|
85
92
|
|
|
@@ -97,7 +104,7 @@ Tools that persist context across AI agent sessions — activity logs, knowledge
|
|
|
97
104
|
| Auto-extraction from sessions | ✅ pattern-based (0 LLM calls) | ✅ via hooks | ✅ AI-compressed | ❌ | ❌ | ❌ |
|
|
98
105
|
| Wake-up context | ✅ ~300 tok (code-linked decisions) | ✅ ~170 tok (AAAK) | ❌ | ❌ | ❌ | ❌ |
|
|
99
106
|
| Decision enrichment in tools | ✅ impact/plan_turn/resume | ❌ standalone | ❌ | ❌ | ❌ | ❌ |
|
|
100
|
-
| Service/
|
|
107
|
+
| Service/subproject scoping | ✅ decisions per service | ✅ wings per project | ❌ | ❌ | ❌ | ❌ |
|
|
101
108
|
| Token usage analytics | ✅ per-tool cost breakdown | ❌ | partial | ❌ | ❌ | ❌ |
|
|
102
109
|
| Code intelligence included | ✅ 130+ tools | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
103
110
|
| Works as standalone memory | ❌ code-focused | ✅ general-purpose | ❌ Claude-specific | ✅ agent-agnostic | ✅ agent-agnostic | ✅ project-scoped |
|
|
@@ -137,7 +144,7 @@ _¹ mcp-local-rag and knowledge-rag are document RAG tools (PDF, DOCX, Markdown)
|
|
|
137
144
|
| MCP tools | 120+ | ~35 | ~15 | ~20 | ~25 | 90 | 139 |
|
|
138
145
|
| Session memory | ✅ | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ |
|
|
139
146
|
| CI/PR reports | ✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
140
|
-
| Multi-repo
|
|
147
|
+
| Multi-repo subprojects | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
141
148
|
| Security scanning | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ |
|
|
142
149
|
| Refactoring tools | ✅ | ✅ rename, symbol editing | ❌ | ❌ | ❌ | ❌ | ❌ |
|
|
143
150
|
| Architecture governance | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ |
|
|
@@ -221,7 +228,8 @@ trace-mcp benchmark /path/to/project
|
|
|
221
228
|
- **Call graph & DI tree** — bidirectional call graphs with 4-tier resolution confidence, optional LSP enrichment for compiler-grade accuracy, NestJS dependency injection
|
|
222
229
|
- **ORM model context** — relationships, schema, metadata for 7 ORMs
|
|
223
230
|
- **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
|
-
- **
|
|
231
|
+
- **Security scanning & MCP server analysis** — OWASP Top-10 pattern scanning, taint analysis (source→sink data flow), MCP security context export for [skill-scan](https://github.com/kkdub/skill-scan) enrichment (tool annotations verification, capability classification, sensitive data flows)
|
|
232
|
+
- **Multi-service subprojects** — link graphs across services via API contracts; cross-service impact analysis; service-scoped decisions
|
|
225
233
|
- **AI-powered analysis** — semantic search with zero-config local ONNX embeddings (no API keys needed), plus optional LLM summarization via Ollama/OpenAI
|
|
226
234
|
|
|
227
235
|
### Supported stack
|
|
@@ -329,7 +337,7 @@ All trace-mcp state is centralized:
|
|
|
329
337
|
~/.trace-mcp/
|
|
330
338
|
.config.json # global config + per-project settings
|
|
331
339
|
registry.json # registered projects
|
|
332
|
-
topology.db # cross-service topology +
|
|
340
|
+
topology.db # cross-service topology + subproject graph
|
|
333
341
|
decisions.db # decision memory + session content (cross-session knowledge graph)
|
|
334
342
|
index/
|
|
335
343
|
my-app-a1b2c3d4e5f6.db # per-project databases (named by project + hash)
|
|
@@ -552,7 +560,7 @@ query_decisions(include_invalidated=true) → full history
|
|
|
552
560
|
|
|
553
561
|
### Service scoping
|
|
554
562
|
|
|
555
|
-
In projects with multiple services (
|
|
563
|
+
In projects with multiple services (subprojects), decisions can be scoped:
|
|
556
564
|
|
|
557
565
|
```
|
|
558
566
|
add_decision(title="Use JWT", service_name="auth-api")
|
|
@@ -564,67 +572,69 @@ query_decisions() → all project decisions
|
|
|
564
572
|
|
|
565
573
|
---
|
|
566
574
|
|
|
567
|
-
##
|
|
575
|
+
## Subprojects
|
|
576
|
+
|
|
577
|
+
A **subproject** is any working repository that is part of your project's ecosystem: microservices, frontends, backends, shared libraries, CLI tools, etc.
|
|
568
578
|
|
|
569
|
-
|
|
579
|
+
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.
|
|
570
580
|
|
|
571
|
-
trace-mcp **links dependency graphs across
|
|
581
|
+
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
582
|
|
|
573
583
|
### How it works
|
|
574
584
|
|
|
575
|
-
|
|
585
|
+
Subproject discovery is **automatic by default**. Every time a project is indexed (`serve`, `serve-http`, or `index`), trace-mcp:
|
|
576
586
|
|
|
577
|
-
1. **Detects
|
|
587
|
+
1. **Detects subprojects** within the project root:
|
|
578
588
|
- **Docker Compose** — parses `docker-compose.yml` / `compose.yml`
|
|
579
589
|
- **Flat workspace** — first-level subdirs with root markers (e.g. `project/frontend/` + `project/backend/`)
|
|
580
590
|
- **Grouped workspace** — two-level structure (e.g. `project/org/service-a/`)
|
|
581
|
-
- **Monolith fallback** — treats root as a single
|
|
582
|
-
2. **Registers** each
|
|
591
|
+
- **Monolith fallback** — treats root as a single subproject
|
|
592
|
+
2. **Registers** each subproject bound to the project in `~/.trace-mcp/topology.db`
|
|
583
593
|
3. **Parses** API contracts — OpenAPI/Swagger, GraphQL SDL, Protobuf/gRPC
|
|
584
594
|
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-
|
|
595
|
+
5. **Links** discovered calls to known endpoints from other subprojects
|
|
596
|
+
6. **Creates** cross-subproject dependency edges
|
|
587
597
|
|
|
588
598
|
### Example
|
|
589
599
|
|
|
590
600
|
```bash
|
|
591
|
-
# Index a project —
|
|
601
|
+
# Index a project — subprojects are auto-detected
|
|
592
602
|
cd ~/projects/my-app && trace-mcp add
|
|
593
603
|
# → auto-detects: my-app/user-service (has openapi.yaml)
|
|
594
604
|
# → my-app/order-service (has axios.get('/api/users/{id}'))
|
|
595
605
|
# → links order-service → user-service via /api/users/{id}
|
|
596
606
|
|
|
597
|
-
# Or add an external
|
|
598
|
-
trace-mcp
|
|
607
|
+
# Or add an external subproject manually
|
|
608
|
+
trace-mcp subproject add --repo=~/projects/external-auth --project=~/projects/my-app
|
|
599
609
|
|
|
600
|
-
# Check cross-
|
|
601
|
-
trace-mcp
|
|
602
|
-
# → "GET /api/users/{id} is called by 2 client(s) in 1
|
|
610
|
+
# Check cross-subproject impact
|
|
611
|
+
trace-mcp subproject impact --endpoint=/api/users
|
|
612
|
+
# → "GET /api/users/{id} is called by 2 client(s) in 1 subproject(s)"
|
|
603
613
|
# [order-service] src/services/user-client.ts:42 (axios, confidence: 85%)
|
|
604
614
|
```
|
|
605
615
|
|
|
606
|
-
###
|
|
616
|
+
### Subproject CLI
|
|
607
617
|
|
|
608
618
|
```bash
|
|
609
|
-
# Add a
|
|
610
|
-
trace-mcp
|
|
611
|
-
trace-mcp
|
|
612
|
-
trace-mcp
|
|
613
|
-
trace-mcp
|
|
614
|
-
trace-mcp
|
|
619
|
+
# Add a subproject (inside or outside project dir)
|
|
620
|
+
trace-mcp subproject add --repo=../service-b --project=. [--contract=openapi.yaml] [--name=my-service]
|
|
621
|
+
trace-mcp subproject remove <name-or-path>
|
|
622
|
+
trace-mcp subproject list [--project=.] [--json]
|
|
623
|
+
trace-mcp subproject sync # re-scan all subprojects
|
|
624
|
+
trace-mcp subproject impact --endpoint=/api/users [--method=GET] [--service=user-svc]
|
|
615
625
|
```
|
|
616
626
|
|
|
617
627
|
### MCP tools
|
|
618
628
|
|
|
619
629
|
| Tool | What it does |
|
|
620
630
|
|---|---|
|
|
621
|
-
| `
|
|
622
|
-
| `
|
|
623
|
-
| `
|
|
624
|
-
| `
|
|
625
|
-
| `
|
|
631
|
+
| `get_subproject_graph` | All subprojects, their connections, and stats |
|
|
632
|
+
| `get_subproject_impact` | Cross-subproject impact: what breaks if endpoint X changes (resolves to symbol level) |
|
|
633
|
+
| `get_subproject_clients` | Find all client calls across subprojects that call a specific endpoint |
|
|
634
|
+
| `subproject_add_repo` | Add a subproject via MCP (bound to current project, or specify `project`) |
|
|
635
|
+
| `subproject_sync` | Re-scan all subprojects |
|
|
626
636
|
|
|
627
|
-
>
|
|
637
|
+
> Subproject management builds on top of the topology system. See [Configuration](docs/configuration.md#topology--subprojects) for options.
|
|
628
638
|
|
|
629
639
|
---
|
|
630
640
|
|
|
@@ -702,7 +712,7 @@ The full workflow is in [`.github/workflows/ci.yml`](.github/workflows/ci.yml)
|
|
|
702
712
|
|
|
703
713
|
## License
|
|
704
714
|
|
|
705
|
-
[
|
|
715
|
+
[MIT](LICENSE)
|
|
706
716
|
|
|
707
717
|
---
|
|
708
718
|
|