get_session_costLABSCO SUMMARY
The bill, before the bill.
Cost trackers normally work by proxying your traffic, which means your prompts transit someone else's server and your tooling breaks when theirs does. This counts tokens locally instead, and tells you which tool call is the expensive one while you can still do something about it.
What it is
A local-first MCP server for cost awareness in agent workflows. Token counts are computed offline with js-tiktoken and stored in local SQLite; no traffic is proxied through a vendor.
What you get
- The running cost of the current session
- A per-tool breakdown, so you can see which calls are consuming the budget
- Routing suggestions towards cheaper models for the current task type — advisory, never enforced without opting in
- Pricing across Claude, OpenAI and Gemini models from one configurable table
- Budget alerts at 80% and 100% of a session threshold you set
- Spend history by day, week and month, broken out by model or by tool
- Sessions tagged to named projects, with chargeback reports
- A self-contained single-file HTML spend report with charts and budget status
- An append-only audit log of every budget enforcement decision
Requirements
Node — the package is mcp-cost-tracker-router on npm. Everything is local: js-tiktoken does the counting, SQLite does the storage, and there is no proxy in the path, so no uptime but your own to depend on.
Setup effort
One command — npx -y mcp-cost-tracker-router@latest
USE CASES
Knowing where a session stands right now
Read the running cost mid-run rather than finding out at invoice time.
Finding the expensive tool
Break the session down per tool and see which calls dominate.
Deciding whether a cheaper model would do
Ask for a routing suggestion for the task type you are on — it is advice, not an override.
Staying inside a budget you set
Watch the session cost against your threshold, with warnings at 80% and 100%.
Explaining a spike after the fact
Read the per-tool breakdown alongside the session total to see what changed.
15 tools
Listed in project docs. Your client may show a different list.
get_tool_costsreset_sessionrecord_usageset_budget_alertsuggest_model_routingcheck_routing_policyget_spend_historyestimate_workflow_costexport_spend_reportexport_budget_auditset_projecttag_sessionget_project_costsexport_chargebackBEFORE YOU INSTALL
What to know first
Tools you get
15 tools named in the project's documentation.
Requires
- npx on PATH
- Node.js v20.19 or later
INSTALLATION
Connect your client
Add the block to your client, or run the command directly.
Server setup
Configuration file
{
"mcpServers": {
"cost-tracker": {
"command": "npx",
"args": [
"-y",
"mcp-cost-tracker-router@latest"
]
}
}
}npx
npx -y mcp-cost-tracker-router@latest