@vk0/agent Cost Mcp

by vk0dev

4.3k downloads
Not rated
GitHub

About

Local-first Claude Code cost analyzer. Parses JSONL session logs to surface per-tool spend, daily trends, and optimization hints.

Details

Author
vk0dev
Downloads
4,312
Categories
AI

- Cost queries: get_session_cost, get_tool_usage, get_cost_trend, get_subagent_tree
- Optimization analytics: get_tool_roi, suggest_optimizations, detect_cost_anomalies
- Predictive tools: get_cost_forecast, estimate_run_cost
- Configuration tools: configure_budget, set_monitor_webhook
- Operates entirely locally on JSONL session logs from Claude Code
- Privacy-preserving with zero cloud dependencies

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name @vk0/agent Cost Mcp
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install by adding an npx-based MCP server to your client configuration (Claude Desktop, Claude Code CLI, Cursor, or Cline). No global install required. Once configured, ask the agent “What tools does agent-cost expose?” to see the eleven available tools. Operates on existing session logs at ~/.claude/projects/.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "@vk0/agent cost mcp": {
            "agent-cost": {
                "command": "npx",
                "args": [
                    "-y",
                    "@vk0/agent-cost-mcp"
                ]
            }
        }
    }
}

McpServers

{
    "agent-cost": {
        "command": "npx",
        "args": [
            "-y",
            "@vk0/agent-cost-mcp"
        ]
    }
}

Quick visibility (native /cost, ccusage) vs Cost Guard forensics (@vk0/agent-cost-mcp)

Claude Code and ccusage already give you useful cost visibility. @vk0/agent-cost-mcp is for the next layer: forensics, attribution, and guardrails.

Use native /cost or ccusage when

- you want a quick current-session total or statusline number
- you need daily or period usage dashboards or burn-rate summaries
- you are looking for a polished human-facing monitoring UX
- nothing to configure

Use @vk0/agent-cost-mcp when

- you want per-tool cost share and ROI ranking with get_tool_roi and get_tool_usage
- you need parent↔subagent cost attribution across branches with get_subagent_tree
- you want anomaly detection against your local baseline with detect_cost_anomalies
- you need forward-looking spend estimates from get_cost_forecast or estimate_run_cost
- you want agent-readable budget caps and hard-stop guardrails via configure_budget
- you need machine-readable next-action suggestions and signed webhook alerts via suggest_optimizations and set_monitor_webhook

Best together

Use native /cost or ccusage for quick visibility; reach for @vk0/agent-cost-mcp when the next question is: which tool, subagent, or branch burned the budget, what happens if the run continues, and what should the agent do next? — answered locally from JSONL, machine-readable.

This package does not replace invoices, org-wide billing systems, or live runtime introspection. It is a local MCP surface for structured cost forensics and guardrails from Claude Code session logs.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.