mcp-cost-tracker-router
v1.0.1Real-time cost awareness for MCP agent workflows
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_session_cost
Returns token totals and USD cost estimates for the current session. All costs are estimates; verify with your LLM provider's billing dashboard.
get_tool_costs
Returns per-tool cost breakdown for the current session, sorted by cost descending. Useful for identifying the most expensive operations. All costs are estimates.
set_budget_alert
Set a budget threshold in USD. A warning is emitted when session costs reach 80% or 100% of this threshold. Use with --enforce-budget to block calls beyond the limit.
| Parameter | Type | Description |
|---|---|---|
threshold_usd * | number | Budget threshold in USD (must be > 0) |
reset_session
Start a new cost-tracking session. Previous session data is retained in history and accessible via get_spend_history.
get_spend_history
Query historical spend aggregated by time period (day/week/month). Returns breakdown by model and tool across all sessions. All costs are estimates.
| Parameter | Type | Description |
|---|---|---|
period | string | Time period to aggregate. Defaults to "week". |
record_usage
Record token usage for a tool call. Logs LLM API cost estimates into the tracker. Emits a budget warning (notifications/message) if 80% of threshold is reached. Pricing table versions are tracked in CHANGELOG.md.
| Parameter | Type | Description |
|---|---|---|
input_tokens * | number | Number of input/prompt tokens (estimate) |
output_tokens * | number | Number of output/completion tokens (estimate) |
tool_name * | string | Name of the tool or operation being recorded |
model | string | Model used (e.g. claude-sonnet-4-6). Defaults to server default model. |
suggest_model_routing
Heuristic model recommendation by task type. Analyzes the task description and returns a recommended model with reasoning and estimated cost per 1K tokens. Optionally factors in cost constraints.
| Parameter | Type | Description |
|---|---|---|
task_description * | string | Description of the task (e.g. 'classify this tweet', 'generate a REST API', 'analyze this 50-page document') |
constraints | object |
estimate_workflow_cost
Pre-run cost estimation for a multi-step workflow. Provide a list of tool steps with estimated token counts and models to get total and per-step cost estimates. Output is clearly labeled as ESTIMATE.
| Parameter | Type | Description |
|---|---|---|
steps * | array | List of workflow steps to estimate |
export_spend_report
Generate a single-file HTML spend report with session cost breakdown, historical spend by period, model cost comparison chart (CSS bars), and budget status. No external CDN dependencies.
export_budget_audit
Export audit log of budget enforcement decisions. Optionally filter by date range and format as JSON or CSV.
| Parameter | Type | Description |
|---|---|---|
format | string | Output format. Defaults to "json". |
from_date | string | ISO date start filter |
to_date | string | ISO date end filter |
set_project
Create or update a project with an optional budget in USD.
| Parameter | Type | Description |
|---|---|---|
project_name * | string | Unique project name |
budget_usd | number | Optional budget in USD for the project |
get_project_costs
Get cost report for a project, optionally filtered by a since date.
| Parameter | Type | Description |
|---|---|---|
project_name * | string | Project name |
since | string | ISO date to filter from |
tag_session
Tag the current session with a project name for cost allocation.
| Parameter | Type | Description |
|---|---|---|
project_name * | string | Project name to associate with this session |
export_chargeback
Generate a chargeback report for internal team billing, grouped by project or session.
| Parameter | Type | Description |
|---|---|---|
from_date * | string | ISO date start of period |
to_date * | string | ISO date end of period |
format | string | Output format. Defaults to "json". |
group_by | string | Group by "project" or "session". Defaults to "project". |
check_routing_policy
Check whether a model is allowed for a given task type under the routing policy.
| Parameter | Type | Description |
|---|---|---|
model * | string | Model name to check |
task_type * | string | Task type (e.g. summarization, reasoning) |