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:
Claude Code already has useful native cost visibility. This MCP is for the next layer of local analysis.
/cost or /usage when a quick current-session or recent-usage check is enough.get_subagent_tree, get_cost_forecast, local budget caps, or webhook alerts.This is not invoice truth, org-wide billing, or live runtime introspection. It is a local MCP surface over Claude Code session logs.
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.