
Llm Usage & Cost Tracker
@zhaoyue722
About Llm Usage & Cost Tracker
A local-first, multi-provider cost meter for LLM usage, exposed as MCP tools. Captures every call into a local SQLite ledger and lets any coding agent query spend, compare providers, and get recommendations — no cloud, no account. First-class support for Chinese providers (Qwen,
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"llm-usage": {
"command": "uvx",
"args": [
"llm-usage-mcp"
]
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is Llm Usage & Cost Tracker?
Llm Usage & Cost Tracker is a local-first MCP server and CLI that captures LLM API calls across multiple providers (Anthropic, OpenAI, DeepSeek, Qwen), calculates costs, and answers spend queries through an agent or terminal. It is a cost meter, not a router.
How to use Llm Usage & Cost Tracker?
Install via uv tool install llm-usage-mcp (or clone from source). Set at least one provider API key as an environment variable. Run the capture proxy (llm-usage-proxy), which listens on 127.0.0.1:5525. Point your LLM client’s base URL to the proxy. Use the MCP server (e.g., claude mcp add llm-usage -- uv run llm-usage-mcp) to ask agent questions, or run CLI commands like llm-usage spend, llm-usage compare, and llm-usage recommend.
Key features of Llm Usage & Cost Tracker
- Local-first SQLite storage, no telemetry.
- Supports Anthropic, OpenAI, DeepSeek, and Qwen.
- MCP server with seven query tools.
- CLI with subcommands for spend, compare, recommend.
- Capture proxy logs all API calls idempotently.
- Cross-provider cost comparison and recommendation.
- Works with streaming and non-streaming calls.
- No SaaS signup or account needed.
Use cases of Llm Usage & Cost Tracker
- Monitor daily, weekly, or monthly spend per provider or model.
- Compare hypothetical workload costs across all priced models.
- Get the cheapest model recommendation for a budget and workload.
- Integrate with Claude Code, Cursor, or any MCP client.
- Manually log usage when the capture proxy is not in use.
FAQ from Llm Usage & Cost Tracker
What does it do vs a router?
It is a cost meter, not a router. It tells you what you spent and which provider fits a workload, but never changes your calls. It pairs happily alongside a router or a model-leaderboard tool.
What are the runtime requirements?
Python 3.13+, uv or pipx for installation. SQLite is built into Python, no extra database setup.
Where does my usage data live?
All data is stored locally in a SQLite file at ~/.llm-usage/usage.db.
Which providers are supported?
Anthropic, OpenAI, DeepSeek, and Qwen are supported for both streaming and non-streaming. More providers (Gemini, Bedrock, Moonshot) are planned.
How do I authenticate and connect?
API keys are set as environment variables (e.g., ANTHROPIC_API_KEY). The proxy holds keys server-side; clients point their base URL at http://127.0.0.1:5525 and never need keys directly.
Frequently asked questions
What does it do vs a router?
It is a cost meter, not a router. It tells you what you spent and which provider fits a workload, but never changes your calls. It pairs happily alongside a router or a model-leaderboard tool.
What are the runtime requirements?
Python 3.13+, uv or pipx for installation. SQLite is built into Python, no extra database setup.
Where does my usage data live?
All data is stored locally in a SQLite file at `~/.llm-usage/usage.db`.
Which providers are supported?
Anthropic, OpenAI, DeepSeek, and Qwen are supported for both streaming and non-streaming. More providers (Gemini, Bedrock, Moonshot) are planned.
How do I authenticate and connect?
API keys are set as environment variables (e.g., `ANTHROPIC_API_KEY`). The proxy holds keys server-side; clients point their base URL at `http://127.0.0.1:5525` and never need keys directly.
Basic information
More MCP servers
Capital.com MCP
capital-com-svCFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 81.31% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understa
Groundwork
Rarefied-EarthGroundwork: company memory for your AI tools. Docs public. Source closed. Public proof needs no account.

OpenLore
aakarimServe your docs to AI agents over SSH and MCP. Agents use ls, cat, grep, find, and pipes against a virtual filesystem backed by your documentation. Identity-scoped access, governed writing with human approval, and portab
3gpp-mcp
higebuAn MCP (Model Context Protocol) server that makes 3GPP specifications accessible to LLMs.
FiatDock
fiatdockA marketplace where AI agents discover and pay each other per call in USDC over x402 - settlement goes DIRECTLY to the seller's wallet, so there are no accounts, no API keys and no subscriptions. Buy from 24 live MCP ser
Comments