MCP Cost Tracker Router MCP Server

Real-time cost awareness for MCP agent workflows

Local serverstdio

What is the MCP Cost Tracker Router MCP server?

Real-time cost awareness for MCP agent workflows. That is what the mcp cost tracker router mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

Local-first cost awareness for MCP agent workflows. Token counts are calculated offline using js-tiktoken — no proxy, no API round-trip, no spend data leaving your machine. When costs climb, routing suggestions point you to cheaper models before the invoice arrives.

  • Per-tool cost breakdown — See exactly which tool calls are consuming the most tokens and budget
  • Budget alerts — Set a session spend threshold and get warned at 80% and 100% before you exceed it
  • Offline token counting — Uses js-tiktoken for accurate counts — no API calls required
  • Model routing suggestions — Recommends cheaper models for the current task type (advisory, never enforced without opt-in)
  • Multi-provider pricing — Tracks costs across Claude, OpenAI, and Gemini models from a single configurable pricing table
  • Spend history — Query daily, weekly, and monthly totals by model or tool

The tools it exposes

The server publishes 14 tools. What each one is for:

  • get_session_cost — Returns token totals and USD cost estimates for the current session. Read-only
  • get_tool_costs — Returns per-tool cost breakdown for the session, sorted by cost descending. Read-only
  • reset_session — Start a new cost-tracking session. Previous session data is retained in history
  • record_usage — Record token usage for a tool call. Takes tool_name, model (optional), input_tokens, and output_tokens. Emits a budget warning notification if 80% of
  • set_budget_alert — Set a budget threshold in USD (threshold_usd). Warns at 80% and 100% of the threshold. Use with --enforce-budget to block calls beyond the limit
  • suggest_model_routing — Heuristic model recommendation by task type. Takes task_description and optional constraints.max_cost_usd. Returns recommended model with reasoning
  • check_routing_policy — Check whether a model is allowed for a given task type under the routing policy. Takes task_type and model
  • get_spend_history — Query historical spend aggregated by period (day/week/month). Returns breakdown by model and tool. Read-only
  • estimate_workflow_cost — Pre-run cost estimation for a multi-step workflow. Takes a steps array with tool_name, estimated_input_tokens, estimated_output_tokens, and optional
  • export_spend_report — Generate a single-file HTML spend report with session breakdown, historical spend, model cost comparison, and budget status. Read-only
  • export_budget_audit — Export the audit log of budget enforcement decisions. Accepts optional from_date, to_date, and format (json/csv). Read-only
  • set_project — Create or update a project with an optional budget_usd. Takes project_name

Getting it running

The server ships on npm as @modelcontextprotocol/inspector, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What it needs from you

  • Node.js v20.19 or newer. - npm.

How it compares

Among the planning and project tracking options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. MCP Cost Tracker Router's toolset — get_session_cost, get_tool_costs, reset_session and 11 more — is a fair guide to whether it matches your workflow. It is maintained by dbsectrainer; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against MCP Cost Tracker Router's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch MCP Cost Tracker Router.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
get_session_costReturns token totals and USD cost estimates for the current session. Read-only.
get_tool_costsReturns per-tool cost breakdown for the session, sorted by cost descending. Read-only.
reset_sessionStart a new cost-tracking session. Previous session data is retained in history.
record_usageRecord token usage for a tool call. Takes tool_name, model (optional), input_tokens, and output_tokens. Emits a budget warning notification if 80% of threshold is reached.
set_budget_alertSet a budget threshold in USD (threshold_usd). Warns at 80% and 100% of the threshold. Use with --enforce-budget to block calls beyond the limit.
suggest_model_routingHeuristic model recommendation by task type. Takes task_description and optional constraints.max_cost_usd. Returns recommended model with reasoning and estimated cost.
check_routing_policyCheck whether a model is allowed for a given task type under the routing policy. Takes task_type and model.
get_spend_historyQuery historical spend aggregated by period (day/week/month). Returns breakdown by model and tool. Read-only.
estimate_workflow_costPre-run cost estimation for a multi-step workflow. Takes a steps array with tool_name, estimated_input_tokens, estimated_output_tokens, and optional model. Read-only.
export_spend_reportGenerate a single-file HTML spend report with session breakdown, historical spend, model cost comparison, and budget status. Read-only.
export_budget_auditExport the audit log of budget enforcement decisions. Accepts optional from_date, to_date, and format (json/csv). Read-only.
set_projectCreate or update a project with an optional budget_usd. Takes project_name.
tag_sessionTag the current session with a project_name for cost allocation.
get_project_costsGet cost report for a project. Takes project_name and optional since (ISO date). Read-only.

How to install the MCP Cost Tracker Router MCP server

{
  "mcpServers": {
    "cost-tracker": {
      "command": "npx",
      "args": ["-y", "mcp-cost-tracker-router@latest"]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

  • Node.js v20.19 or newer. - npm.

Example prompts to try

  • Use MCP Cost Tracker Router to get session cost.
  • Use MCP Cost Tracker Router to get tool costs.
  • Use MCP Cost Tracker Router to reset session.

Frequently asked questions

It connects MCP Cost Tracker Router to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (get_session_cost, get_tool_costs, reset_session, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with MCP Cost Tracker Router directly.