Real-time cost awareness for MCP agent workflows
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.
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.
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-onlyget_tool_costs — Returns per-tool cost breakdown for the session, sorted by cost descending. Read-onlyreset_session — Start a new cost-tracking session. Previous session data is retained in historyrecord_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% ofset_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 limitsuggest_model_routing — Heuristic model recommendation by task type. Takes task_description and optional constraints.max_cost_usd. Returns recommended model with reasoningcheck_routing_policy — Check whether a model is allowed for a given task type under the routing policy. Takes task_type and modelget_spend_history — Query historical spend aggregated by period (day/week/month). Returns breakdown by model and tool. Read-onlyestimate_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 optionalexport_spend_report — Generate a single-file HTML spend report with session breakdown, historical spend, model cost comparison, and budget status. Read-onlyexport_budget_audit — Export the audit log of budget enforcement decisions. Accepts optional from_date, to_date, and format (json/csv). Read-onlyset_project — Create or update a project with an optional budget_usd. Takes project_nameThe 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.
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.
| Tool | What it does |
|---|---|
| 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 threshold is reached. |
| 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 and estimated cost. |
| 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 model. Read-only. |
| 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. |
| tag_session | Tag the current session with a project_name for cost allocation. |
| get_project_costs | Get cost report for a project. Takes project_name and optional since (ISO date). Read-only. |
{
"mcpServers": {
"cost-tracker": {
"command": "npx",
"args": ["-y", "mcp-cost-tracker-router@latest"]
}
}
}Configuration as documented by the project. Restart the client after saving.
Your workspace, on speaking terms with AI — search, read and write Notion pages and databases.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Search and read your Drive — Docs, Sheets and files become context your assistant can actually use.
Your assistant inside the workspace — read channels, search history, post messages and tame the noise.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Stop letting your assistant hallucinate n8n node parameters — this server hands it the real schemas, templates and validation.