tokentrace 0.14.0 → 0.14.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/CHANGELOG.md CHANGED
@@ -4,6 +4,29 @@ All notable changes to TokenTrace are documented here.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## [0.14.2] - 2026-05-21
8
+
9
+ ### Added
10
+
11
+ - Added `get_agent_guide` to the MCP server with registry install snippets, recommended agent workflows, copy-paste `AGENTS.md` guidance, and local-first guardrails.
12
+ - Added `tokentrace mcp selftest --json` to verify MCP initialization, tool listing, agent guide output, and scan-confirmation refusal without scanning files.
13
+ - Added `docs/agent-adoption.md` with MCP setup instructions and evidence-backed recipes for coding agents.
14
+
15
+ ### Changed
16
+
17
+ - MCP tool responses now include an agent-oriented envelope with summary, confidence, next actions, warnings, evidence hints, human-confirmation state, and the underlying data payload.
18
+ - Package inspection and CLI smoke checks now verify the MCP agent guide, self-test, and adoption documentation.
19
+
20
+ ### Fixed
21
+
22
+ - Data-backed CLI command help now prints before touching local runtime state, so `tokentrace scan --help`, `doctor --help`, `evidence --help`, `repair --help`, and related commands stay safe on broken or fresh local databases.
23
+
24
+ ## [0.14.1] - 2026-05-20
25
+
26
+ ### Fixed
27
+
28
+ - Added the required npm `mcpName` package metadata so the MCP registry can verify the TokenTrace npm package.
29
+
7
30
  ## [0.14.0] - 2026-05-20
8
31
 
9
32
  ### Added
package/README.md CHANGED
@@ -105,6 +105,7 @@ or npm package contents before invoking commands:
105
105
 
106
106
  - [TOKENTRACE_AGENT.md](TOKENTRACE_AGENT.md)
107
107
  - [llms.txt](llms.txt)
108
+ - [docs/agent-adoption.md](docs/agent-adoption.md)
108
109
  - [docs/agent-discovery.schema.json](docs/agent-discovery.schema.json)
109
110
 
110
111
  MCP-capable clients can start the local stdio server after installing or using
@@ -114,6 +115,16 @@ the npm package:
114
115
  tokentrace mcp
115
116
  ```
116
117
 
118
+ Registry name: `io.github.abhiyoheswaran1/tokentrace`.
119
+
120
+ First MCP call for agents: `get_agent_guide`.
121
+
122
+ Self-test the local MCP entrypoint without scanning files:
123
+
124
+ ```bash
125
+ tokentrace mcp selftest --json
126
+ ```
127
+
117
128
  The MCP server exposes the same local-first surfaces as tools: capabilities,
118
129
  status, Scan Health, evidence, repair queue, reports, and an explicit scan tool.
119
130
  It does not scan files on startup, and its scan tool requires
@@ -25,6 +25,21 @@ MCP-capable clients can use the local stdio server:
25
25
  tokentrace mcp
26
26
  ```
27
27
 
28
+ MCP registry name:
29
+
30
+ ```text
31
+ io.github.abhiyoheswaran1/tokentrace
32
+ ```
33
+
34
+ Agents should call `get_agent_guide` first. It returns the recommended workflow,
35
+ install snippets, copy-paste `AGENTS.md` guidance, and local-first guardrails.
36
+
37
+ Verify the MCP entrypoint without scanning files:
38
+
39
+ ```bash
40
+ tokentrace mcp selftest --json
41
+ ```
42
+
28
43
  The MCP server does not scan on startup. Its `run_scan` tool requires
29
44
  `confirmLocalScan=true` before reading local usage files or writing the local
30
45
  database.
@@ -53,19 +68,25 @@ curl http://127.0.0.1:3030/api/roadmap
53
68
  tokentrace agent --json
54
69
  ```
55
70
 
56
- 2. Refresh local data when the human expects current usage:
71
+ 2. In MCP clients, ask for the operating loop:
72
+
73
+ ```text
74
+ get_agent_guide
75
+ ```
76
+
77
+ 3. Refresh local data when the human expects current usage:
57
78
 
58
79
  ```bash
59
80
  tokentrace scan --json
60
81
  ```
61
82
 
62
- 3. Check trust before making claims:
83
+ 4. Check trust before making claims:
63
84
 
64
85
  ```bash
65
86
  tokentrace doctor --json
66
87
  ```
67
88
 
68
- 4. Explain totals with evidence:
89
+ 5. Explain totals with evidence:
69
90
 
70
91
  ```bash
71
92
  tokentrace evidence --json
@@ -148,6 +148,14 @@ const roadmapSteps = [
148
148
  ["Dashboard API", "/api/roadmap", "Fetch the same roadmap status from a running local dashboard."]
149
149
  ];
150
150
 
151
+ const mcpAgentEntries = [
152
+ ["Registry", "io.github.abhiyoheswaran1/tokentrace", "Use this name when an MCP client discovers TokenTrace from the registry."],
153
+ ["Start", "tokentrace mcp", "Start the local stdio MCP server. Startup is read-only and does not scan files."],
154
+ ["First tool", "get_agent_guide", "Return the recommended operating loop, install snippets, and AGENTS.md copy block."],
155
+ ["Self-test", "tokentrace mcp selftest --json", "Verify MCP initialization, tool listing, guide output, and scan refusal."],
156
+ ["Scan rule", "confirmLocalScan=true", "Only pass this to run_scan when the human expects a local filesystem scan."]
157
+ ];
158
+
151
159
  const workflows = [
152
160
  {
153
161
  problem: "No records imported",
@@ -506,6 +514,27 @@ export default function GuidePage() {
506
514
  </p>
507
515
  </div>
508
516
  </div>
517
+ <div className="border-t p-4">
518
+ <div className="flex items-center gap-2">
519
+ <LockKeyhole className="h-4 w-4 text-primary" />
520
+ <h3 className="text-sm font-semibold leading-tight">MCP for agents</h3>
521
+ </div>
522
+ <p className="mt-2 max-w-[72ch] text-sm leading-6 text-muted-foreground">
523
+ MCP clients should connect locally, call <MonoText>get_agent_guide</MonoText> first, and use evidence before reporting
524
+ token, cost, model, or session numbers. The full copy-paste workflow lives in <MonoText>docs/agent-adoption.md</MonoText>.
525
+ </p>
526
+ <div className="mt-4 grid gap-3 md:grid-cols-2 xl:grid-cols-5">
527
+ {mcpAgentEntries.map(([label, value, detail]) => (
528
+ <div key={label} className="rounded-md border bg-muted/30 p-3">
529
+ <FieldLabel>{label}</FieldLabel>
530
+ <div className="mt-2 min-h-10 break-words text-sm font-medium leading-5">
531
+ <MonoText>{value}</MonoText>
532
+ </div>
533
+ <p className="mt-2 text-xs leading-5 text-muted-foreground">{detail}</p>
534
+ </div>
535
+ ))}
536
+ </div>
537
+ </div>
509
538
  <div className="border-t p-4">
510
539
  <h3 className="text-sm font-semibold leading-tight">Agent quickstart</h3>
511
540
  <div className="table-scroll mt-3">
@@ -135,11 +135,13 @@ var commands = [
135
135
  startsLongRunningProcess: true,
136
136
  requiresNetwork: false,
137
137
  safeForAutomation: false,
138
- useWhen: "An MCP-capable agent or client wants structured access to TokenTrace status, doctor, evidence, repair, report, and explicit scan tools.",
138
+ useWhen: "An MCP-capable agent or client wants structured access to TokenTrace guidance, status, doctor, evidence, repair, report, and explicit scan tools.",
139
139
  followUps: [
140
+ ["tokentrace", "mcp", "selftest", "--json"],
140
141
  ["tokentrace", "agent", "--json"]
141
142
  ],
142
143
  notes: [
144
+ "Agents should call get_agent_guide first after connecting through MCP.",
143
145
  "The MCP server itself does not scan files on startup.",
144
146
  "The run_scan MCP tool requires confirmLocalScan=true before reading local usage files and writing the local database."
145
147
  ]