TokenTrace MCP server
Local-first AI CLI usage analytics for agents.
0 stars62 downloads/wk
Reviews
Write oneNobody has reviewed TokenTrace yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
TokenTrace tools (13, 3 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
get_agent_guideReturn the recommended MCP operating loop, install snippets, copy-paste AGENTS.md guidance, and local-first guardrails.
get_anomaliesReturn modified-z-score (MAD) anomalies for the local daily token and cost trend. Pure-stats detector; spends zero AI tokens.
get_capabilitiesReturn the read-only TokenTrace agent discovery manifest. Does not initialize local app data.
get_classificationsReturn the local unknown-cost repair queue with deterministic classification suggestions (exact-model, family-fragment, or parser-source). Read-only; spends zero AI tokens.
get_evidenceReturn evidence behind a TokenTrace metric without raw prompt or message bodies.
get_handoffReturn the schema-versioned tokentrace.handoff.v1 envelope summarizing local scan state, repair queue, confidence, recent agent actions, and suggested next actions. Pure read; no scan.
get_preflightReturn a read-only local preflight decision before another coding-agent run: proceed, caution, or blocked with evidence and next actions.
get_repair_queueReturn grouped unknown-cost repair causes, next actions, and review state.
get_reportReturn a deterministic local report as markdown or JSON.
get_statusReturn the current local TokenTrace usage status snapshot as JSON.
query_usagewrite actionRun a deterministic, parameterized query over the local TokenTrace database. The caller supplies structured arguments; TokenTrace executes the SQL. No NL parsing happens server-side, so zero AI tokens are spent.
run_doctorwrite actionInspect scan freshness, parser trust, source coverage, package trust, and repair recommendations.
run_scanwrite actionExplicitly scan local AI CLI artifacts and update the local TokenTrace database. Requires confirmLocalScan=true.
Public scan report
scanner v0.1.9 · 2026-09-26 · same rubric, same numbers if you re-run it
- Code scan307 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 92 days ago8/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
What the publisher says
From the TokenTrace repository's README, as published. We do not edit it. Read it on GitHub
TokenTrace CLI
Local-first AI CLI usage analytics for developers and coding agents.
TokenTrace answers one practical question before the next expensive AI CLI run: is your local usage evidence ready to trust? It scans local Claude Code, Codex, structured usage logs, and usage-shaped local databases, then labels token and cost data as exact, estimated, unknown, cached, or non-cache. The dashboard opens on Today, with direct paths into Sessions, Evidence, and Fix Data.
TokenTrace is designed for local development machines first, with macOS-oriented defaults. It does not require a cloud account and does not send telemetry or logs anywhere.
Website · Source
What TokenTrace Helps You Do
- Check readiness before another coding-agent run with tokentrace preflight --json or MCP get_preflight.
- See today’s local cost, tokens, sessions, confidence, anomalies, and repair signals in one first screen.
- Trace every important number back to local files, parser state, sessions, model rates, and confidence labels.
- Fix missing cost data through a guided repair queue without uploading prompts or message bodies.
Start In Seconds
Run without installing:
npx tokentraceOr install globally:
npm install -g tokentrace
tokentraceThe command starts the local dashboard, chooses an available localhost port starting at 3030, opens your default browser, and keeps the server running until you press Ctrl+C.
CLI commands:
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Install directly
Runs npx -y tokentrace on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add tokentrace -- npx -y tokentrace
TokenTrace: common questions
- Is TokenTrace MCP server safe?
- Mostly: it is graded B (82/100). Read the TokenTrace safety report
- How do I install TokenTrace?
- It runs on your machine. Copy the Claude Code, Claude Desktop or Cursor config from the install section.
- Does TokenTrace need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is TokenTrace maintained?
- The last commit was 93 days ago (2026-06-26). The latest release is v0.21.2.