# Agent Cost MCP Server

> Agent Cost MCP Server is a free MCP server for ai models and llm tooling. Price LLM runs per successful task and track spend against a budget, locally. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Free
- **Platforms:** CLI, macOS, Windows, Linux
- **Repository:** https://github.com/karmendra8386/agent-cost-mcp-server
- **MCP Registry name:** io.github.karmendra8386/agent-cost-mcp-server
- **Categories:** [AI models and LLM tooling](https://ai-powered.com/categories/ai-and-llm), [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-11-23

## About

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.

## Features

- **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

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add agent-cost-mcp-server -- uvx agent-cost-mcp-server
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "agent-cost-mcp-server": {
      "command": "uvx",
      "args": [
        "agent-cost-mcp-server"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "agent-cost-mcp-server": {
      "command": "uvx",
      "args": [
        "agent-cost-mcp-server"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```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.

### VS Code (~/.copilot/mcp-config.json)

```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.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add agent-cost-mcp-server -- uvx agent-cost-mcp-server
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.agent-cost-mcp-server]
command = "uvx"
args = ["agent-cost-mcp-server"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```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

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```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 (~/.config/devin/mcp_config.json)

```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 (cline_mcp_settings.json)

```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 (Zed settings.json)

```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 (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "agent-cost-mcp-server": {
      "command": "uvx",
      "args": [
        "agent-cost-mcp-server"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```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 (~/.kiro/settings/mcp.json)

```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.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "agent-cost-mcp-server": {
      "command": "uvx",
      "args": [
        "agent-cost-mcp-server"
      ]
    }
  }
}
```

## Tools

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_cost` (name 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_status` (name suggests: reads): Reports spend, remaining budget and per-model breakdown for a task.

## 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.

## Alternatives

- [headroom](https://ai-powered.com/mcp/headroom-3): headroom is an open-source MCP server for ai models and llm tooling.
- [omniget](https://ai-powered.com/mcp/omniget): omniget is an open-source MCP server for ai models and llm tooling.
- [Agent-Native Analytics](https://ai-powered.com/mcp/agent-native-analytics): Agent-Native Analytics is an open-source MCP server for analytics and data.
- [next-ai-draw-io](https://ai-powered.com/mcp/next-ai-draw-io-2): next-ai-draw-io is an open-source MCP server for ai models and llm tooling.
- [mcp-for-blender](https://ai-powered.com/mcp/mcp-for-blender): mcp-for-blender is an open-source MCP server for design and media.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [tyk](https://ai-powered.com/mcp/tyk): tyk is an open-source MCP server for developer tools.
- [unity-mcp](https://ai-powered.com/mcp/unity-mcp-2): unity-mcp is an open-source MCP server for ai models and llm tooling.

---
Source: https://ai-powered.com/mcp/agent-cost-mcp-server
