Local-first Claude Code cost analyzer. Parses JSONL session logs to surface per-tool spend, daily trends, and optimization hints. Zero cloud. No API key.
Use this MCP server when the user asks any of:
Pick your client. Everything runs through npx — nothing
to install globally.
{
"mcpServers": {
"agent-cost": {
"command": "npx",
"args": ["-y", "@vk0/agent-cost-mcp"]
}
}
}
claude mcp add --transport stdio agent-cost -- npx -y @vk0/agent-cost-mcp
{
"mcpServers": {
"agent-cost": {
"command": "npx",
"args": ["-y", "@vk0/agent-cost-mcp"]
}
}
}
{
"mcpServers": {
"agent-cost": {
"command": "npx",
"args": ["-y", "@vk0/agent-cost-mcp"],
"disabled": false,
"alwaysAllow": []
}
}
}
Parse a single Claude Code session and return token totals, turn count, and estimated USD cost.
Aggregate tool invocations across a session or project log directory with per-tool context-share percentages.
Roll session logs into a day-by-day cost trend for a local project path.
Generate lightweight optimization suggestions — cache ratios, abandoned calls, heaviest turns.
~/.claude/projects/*.jsonl ┌─────────────────┐
(Claude Code session logs) ──────▶ │ JSONL parser │
│ + pricing.ts │
└────────┬────────┘
│
▼
┌─────────────────┐
Agent tool call (stdio MCP) ──────▶ │ MCP server │ ─── JSON response
│ (4 tools) │
└─────────────────┘
Read-only on your local filesystem. No telemetry, no API key, no cloud sync. Delete the package and nothing remains.