Agent Cost MCP Server
Price LLM runs per successful task and track spend against a budget, locally
Agent Cost MCP Server is a free MCP server for ai models and llm tooling. It runs locally on your machine and is started by your AI client.
- Pricing
- Free
- Platforms
- CLI, macOS, Windows
- Runs
- Locally
- What it can do
- Can change data (1 tool)
- Version
- 0.1.1
- Listing updated
Similar MCP servers
Install
Add with the CLI
Run in a terminal
claude mcp add agent-cost-mcp-server -- uvx agent-cost-mcp-serverAdd --scope user to use it in every project, or --scope project to share it in .mcp.json.
Or share it with your project
Add to .mcp.json
{
"mcpServers": {
"agent-cost-mcp-server": {
"command": "uvx",
"args": [
"agent-cost-mcp-server"
]
}
}
}Add to claude_desktop_config.json
{
"mcpServers": {
"agent-cost-mcp-server": {
"command": "uvx",
"args": [
"agent-cost-mcp-server"
]
}
}
}Settings → Developer → Edit Config, then quit and reopen Claude Desktop.
Add to ~/.cursor/mcp.json
{
"mcpServers": {
"agent-cost-mcp-server": {
"command": "uvx",
"args": [
"agent-cost-mcp-server"
]
}
}
}Use .cursor/mcp.json in a project to share it with the project.
Add to ~/.copilot/mcp-config.json
{
"mcpServers": {
"agent-cost-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"agent-cost-mcp-server"
]
}
}
}Or put the same entry in .mcp.json at your workspace root to share it.
Add with the CLI
Run in a terminal
codex mcp add agent-cost-mcp-server -- uvx agent-cost-mcp-serverOr add to config.toml
Add to ~/.codex/config.toml
[mcp_servers.agent-cost-mcp-server]
command = "uvx"
args = ["agent-cost-mcp-server"]Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"agent-cost-mcp-server": {
"command": "uvx",
"args": [
"agent-cost-mcp-server"
]
}
}
}Gemini CLI and Antigravity
Gemini CLI
Add to ~/.gemini/settings.json
{ "mcpServers": { "agent-cost-mcp-server": { "command": "uvx", "args": [ "agent-cost-mcp-server" ] } } }Or run: gemini mcp add -s user agent-cost-mcp-server uvx -- agent-cost-mcp-server
Antigravity
Add to ~/.gemini/config/mcp_config.json
{ "mcpServers": { "agent-cost-mcp-server": { "command": "uvx", "args": [ "agent-cost-mcp-server" ] } } }Use .agents/mcp_config.json to add it to one workspace only.
Devin Desktop (formerly Windsurf)
Add to ~/.config/devin/mcp_config.json
{ "mcpServers": { "agent-cost-mcp-server": { "command": "uvx", "args": [ "agent-cost-mcp-server" ] } } }On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.
Cline
Add to cline_mcp_settings.json
{ "mcpServers": { "agent-cost-mcp-server": { "command": "uvx", "args": [ "agent-cost-mcp-server" ] } } }Open it from the MCP Servers icon → Configure → Configure MCP Servers.
Zed
Add to Zed settings.json
{ "context_servers": { "agent-cost-mcp-server": { "command": "uvx", "args": [ "agent-cost-mcp-server" ] } } }Open it with zed: open settings file. Merge context_servers into the settings you already have.
JetBrains AI Assistant and Junie
AI Assistant
Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add
{ "mcpServers": { "agent-cost-mcp-server": { "command": "uvx", "args": [ "agent-cost-mcp-server" ] } } }Junie
Add to ~/.junie/mcp/mcp.json
{ "mcpServers": { "agent-cost-mcp-server": { "command": "uvx", "args": [ "agent-cost-mcp-server" ] } } }Use .junie/mcp/mcp.json to share it with a project.
Kiro
Add to ~/.kiro/settings/mcp.json
{ "mcpServers": { "agent-cost-mcp-server": { "command": "uvx", "args": [ "agent-cost-mcp-server" ] } } }Use .kiro/settings/mcp.json to add it to one workspace only.
Using several servers? Build one config file with the MCP config generator.
Configuration
AGENT_COST_LEDGER_PATHOptional path for the local spend-ledger file used by record_spend / budget_status.
About Agent Cost MCP Server
The point of this server is that cost per token is the wrong yardstick for agent work. Its comparison tool ranks models by expected cost per successful task, meaning cost per attempt divided by success rate, so a cheap model that fails often can rank below a pricier reliable one. The README's example shows Nova Micro cheapest per run yet fourth per success.
It ships with a dated pricing snapshot of list prices for major Bedrock and OpenAI-compatible models, needs no AWS account or API key, and makes no network calls at runtime. Spend is appended to a local JSON ledger at ~/.agent-cost-mcp-server/ledger.json, or a path you set. Enforcing a budget is left to the agent framework; the server only reports status.
It is a port of the author's tokenecon cost model and requires Python 3.10 or newer; install with uvx or pip.
Tools this server provides (5)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 1 of 5 tools changes data; 3 names don't say.
From the server's own tool labels and tool names; not verified by us.
- price_usage
- Input, output and total cost in USD for one usage record.
- estimate_run_costName suggests: changes
- Cost of one run plus the same workload priced on other models.
- compare_models_for_task
- Ranks models by expected cost per successful task.
- record_spend
- Appends a priced entry to the local ledger.
- budget_statusName suggests: reads
- Reports spend, remaining budget and per-model breakdown for a task.
What it does
- Cost per success ranking
- Ranks models using supplied or default success rates.
- Run estimates
- Prices one run and the same workload on every other model.
- Spend ledger
- Records spend per task in a local JSON file.
- Budget status
- Reports spent, remaining and over-budget per task and model.
- Offline pricing snapshot
- Bundled dated list prices, no network calls.
Good for
- Compare models by cost per successful task before choosing one
- Record what an agent run spent
- Check mid-run whether a task is over budget
- Estimate cost before launching a long job
Pricing
Free
Free; pricing snapshot is bundled
Agent Cost MCP Server FAQ
Does Agent Cost MCP Server enforce budgets?
No. It reports status; stopping a run is up to the agent framework.
Where is spend stored?
In a local JSON ledger, with nothing leaving the machine.
Are prices live?
No. They come from a dated snapshot you should verify against provider pages.
How do I install Agent Cost MCP Server?
With uvx agent-cost-mcp-server or pip install agent-cost-mcp-server.
How do I add Agent Cost MCP Server to Claude Code?
Run this command in your terminal: claude mcp add agent-cost-mcp-server -- uvx agent-cost-mcp-server
What are the best alternatives to Agent Cost MCP Server?
The closest alternatives to Agent Cost MCP Server are headroom, omniget, Agent-Native Analytics, next-ai-draw-io and mcp-for-blender.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.



