Server data from the Official MCP Registry
Analyze Claude Code token cost & context attribution. Local, read-only MCP server.
Analyze Claude Code token cost & context attribution. Local, read-only MCP server.
Valid MCP server (2 strong, 4 medium validity signals). No known CVEs in dependencies. ⚠️ Package registry links to a different repository than scanned source. Imported from the Official MCP Registry. 1 finding(s) downgraded by scanner intelligence.
8 files analyzed · 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-wartzar-bee-tokenscope": {
"args": [
"-y",
"@wartzar-bee/tokenscope-mcp"
],
"command": "npx"
}
}
}From the project's GitHub README.
See what your AI-coding session actually cost — and what's eating your context. A local, read-only CLI that parses your Claude Code session logs and shows where the money goes: model output vs. context being re-sent every turn (the hidden 60%+ of most bills).
$ npx @wartzar-bee/tokenscope
tokenscope ⏣ latest session
──────────────────────────────────────────────────────
Total cost $868.84 over 967 model turns
Where the money went
output (model writing) ████░░░░░░░░░░░░░░░░░░░░ 16% $137.24
cache read (re-sent ctx) ████████████████░░░░░░░░ 66% $577.59
cache write (new ctx) ████░░░░░░░░░░░░░░░░░░░░ 18% $153.67
Context size per turn (peak 822k · avg 404k · now 822k tokens)
▁▁▁▁▁▂▂▂▂▂▂▂▃▃▃▃▃▃▃▄▄▄▄▄▅▅▅▅▅▆▆▆▆▇▇▇▇▇▇█
Insights
• Re-sent (cached) context cost $577.59 (66% of spend) — context re-read every turn.
• Peak context ~822k tokens — /compact or a fresh session would cut per-turn cost.
• Only 16% of spend is the model's actual output.
(A real session, default Opus pricing. Your numbers will differ — prices are overridable.)
Agentic coding (Claude Code, etc.) produces surprise bills, and the cause is mundane: as a session grows, the whole context is re-sent every turn, so cost balloons even when the model writes little. Existing dashboards show totals; tokenscope shows the attribution — output vs. cache-read vs. cache-write vs. fresh input, the per-turn context-growth curve, cost by model, subagent spend, and which tools fill your context — with concrete "trim this" insights.
No install — runs via npx:
npx @wartzar-bee/tokenscope # your most recent Claude Code session
npx @wartzar-bee/tokenscope --all # aggregate every session
npx @wartzar-bee/tokenscope <file|dir> # a specific session .jsonl
npx @wartzar-bee/tokenscope --json # machine-readable
npx @wartzar-bee/tokenscope --share # privacy-safe shareable summary (markdown + SVG card)
npx @wartzar-bee/tokenscope --share-svg # just the SVG "cost report card"
Reads ~/.claude/projects/**/*.jsonl. Read-only, local, no network, no telemetry — open the source; nothing leaves your machine.
--share emits a compact summary built from aggregate numbers only — no file paths, no prompt/response content — so it's safe to paste in public:
--share-svg) — no binary deps; renders inline on GitHub and is trivially shareable.Prefer not to touch a terminal flag? The same render runs entirely in your browser at the web surface in web/: paste your --json output and it draws the full report + the SVG card locally — nothing is uploaded.
There's an MCP server that exposes the same engine to AI agents / MCP clients (Claude Desktop, Claude Code, etc.) as tools: analyze_claude_cost, get_cost_benchmark, and tokenscope_share_summary. Add it to your MCP config:
{ "mcpServers": { "tokenscope": { "command": "npx", "args": ["-y", "@wartzar-bee/tokenscope-mcp"] } } }
Then ask your agent "use tokenscope to analyze my last Claude Code session." It's the same local, read-only engine — see mcp/README.md.
Uses documented default prices (Anthropic cache multipliers: write 1.25×/2×, read 0.1× of input). Verify and override for your exact model/tier via ./.tokenscope.json:
{ "pricing": { "claude-opus-4": { "in": 15, "out": 75 } } }
Unknown models are flagged (never silently counted as $0). Token counts are read straight from the logs; cost = those counts × the prices shown.
npm test).--watch live meter; OpenAI/Codex log support.MIT. Not affiliated with Anthropic.
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.