MCP Cost Tracker Router logo

MCP Cost Tracker Router

Tracks MCP workflow costs locally, provides budget alerts, recommends models, and exports spend, audit, and chargeback reports.

Install MCP Cost Tracker Router

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-cost-tracker-router": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-cost-tracker-router@latest"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio mcp-cost-tracker-router -- npx -y mcp-cost-tracker-router@latest

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

Automated check passed— started and listed 15 tools correctly ().

Overview

The mcp-cost-tracker-router MCP server tracks token usage and estimated USD costs for MCP agent workflows using local SQLite storage. It records usage, reports session and per-tool spending, applies budget alerts, and can enforce a configured session limit. Routing tools recommend models and check task policies, while history, project allocation, HTML, audit, and chargeback exports support cost analysis. Reach for it when you need offline cost visibility without sending prompts or responses through a proxy.

Use cases

  • Track token and USD estimates for MCP sessions
  • Set budget warnings and enforce session limits
  • Compare model costs before running workflows
  • Allocate MCP spending to projects
  • Export spend, audit, and chargeback reports

Key features

  • Offline token counting with js-tiktoken
  • Per-session and per-tool cost breakdowns
  • Budget warnings and optional enforcement
  • Heuristic model routing recommendations
  • SQLite spend history and project allocation
  • HTML, JSON, and CSV reporting

Tools15

What MCP Cost Tracker Router lets your agent do. Expand a tool for its parameters.

Verified live~1.5k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

16/16 checks healthy over the last 89d

What it can do

From the 15 tools this server returned when we ran it; 15 declare their own safety hints.

Handles credentials · 4Read-only tools · 15
Network at startup3 connections
Files written at startup3
Install scriptsNone
npm provenanceNot published
Package age228 days
Maintainers1

Observed 2026-11-07 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 9d ago via OSV.dev · mcp-cost-tracker-router@latest (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads363Package downloads in the last 30 days.
Last commit1mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed15Callable tools this server registers over MCP.

How MCP Cost Tracker Router works

What mcp-cost-tracker-router does

The mcp-cost-tracker-router MCP server adds local cost accounting and model-routing assistance to MCP agent workflows. It estimates token-based spending across Claude, OpenAI, and Gemini models using a configurable pricing table. Usage metadata is stored in a local SQLite database; prompt and response content are not stored.

The server covers four related areas: current-session tracking, budget controls, historical reporting, and project allocation. Session tools show total tokens and estimated cost, rank tools by spend, start a new session, and record usage for individual calls. Project tools associate sessions with named projects and produce project-level cost or chargeback information.

How it works

Token counts are calculated offline with js-tiktoken, so counting does not require an API request. Costs are estimates based on the local pricing configuration and may differ from a provider invoice. A built-in table includes models from Claude, OpenAI, and Gemini, while a custom JSON pricing file can override individual prices.

Set a session threshold to receive warnings at 80% and 100% of the configured amount. Starting the server with budget enforcement enabled allows calls that would exceed the limit to be blocked. The audit log records budget enforcement decisions for later export.

The routing features are advisory unless budget enforcement is enabled. suggest_model_routing accepts a task description and an optional maximum cost, then returns a model recommendation, reasoning, and estimated cost. check_routing_policy tests whether a specified model is allowed for a task type.

Setup and configuration

The mcp-cost-tracker-router MCP server requires Node.js 20.19 or newer and npm. A typical stdio configuration runs the package with npx and its latest tag. It can also run over Streamable HTTP by supplying an HTTP port, which is intended for sharing one tracking instance across a team.

Relevant command-line options include:

  • --budget-alert sets the session threshold in USD.
  • --enforce-budget enables blocking after the threshold; it requires --budget-alert.
  • --db or --db-path selects the SQLite file, defaulting to ~/.mcp/costs.db.
  • --pricing-table supplies custom model prices.
  • --default-model sets the fallback model, defaulting to claude-sonnet-4-6.
  • --http-port enables Streamable HTTP instead of stdio.

Tools and capabilities

The mcp-cost-tracker-router MCP server provides pre-run workflow estimates, daily, weekly, or monthly spend history, and a self-contained HTML spend report. Budget audit data can be exported as JSON or CSV. Chargeback reports can group records by project or session and also support JSON or CSV output.

Sessions can be tagged to projects, and projects may have an optional budget. Read-only reporting tools include current cost, per-tool cost, historical spend, workflow estimates, project costs, spend reports, and audit exports. State-changing tools include usage recording, session reset, budget configuration, project updates, and session tagging.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Cost Tracker Router

mcp-cost-tracker-router is an MCP server that connects MCP agent workflows to local SQLite cost tracking and configurable model pricing. Its main tools record usage, report session and tool costs, set budget alerts, suggest model routing, estimate workflows, query spend history, and export spend, audit, and chargeback reports.

Install it through an MCP client configuration that runs `npx -y mcp-cost-tracker-router@latest`. The server requires Node.js 20.19 or newer and npm. Add command-line flags in the configuration's `args` array when you need budgets, a custom database, pricing, or HTTP mode.

Yes, Cursor is listed as a supported MCP client. Configure the server with the package command and optional arguments in Cursor's MCP server settings.

No, it does not store prompt or response content. It stores tool-call metadata such as token counts, model names, and timestamps in a local SQLite database. Cost values remain estimates based on the local pricing table.

Start the server with both `--budget-alert=<amount>` and `--enforce-budget`. It warns at 80% and 100% of the threshold, and enforcement can block calls that would push the session beyond the configured limit.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Cost Tracker Router AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-cost-tracker-router?style=directory)](https://allmcps.com/mcp/mcp-cost-tracker-router)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-cost-tracker-router"><img src="https://allmcps.com/api/badge/mcp-cost-tracker-router?style=directory" alt="MCP Cost Tracker Router on AllMCPs" /></a>