# TokenZero

> TokenZero is a freemium MCP server for ai models and llm tooling. Meter, budget and audit LLM spend, with a token-waste scanner for your code. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** API, CLI
- **Website:** https://tokenzero.sh
- **Repository:** https://github.com/tokenzero-ai/tokenzero
- **MCP Registry name:** io.github.tokenzero-ai/tokenzero
- **Categories:** AI models and LLM tooling
- **Listing updated:** 2026-11-15

## About

TokenZero describes itself as an independent ledger of record for AI spend. Point an SDK's base URL at its gateway, or push usage you already log, and every model call becomes a receipt with model, tokens, provider-reported cost and a counterfactual baseline. Receipts are signed with Ed25519 and hash-chained per workspace, store hashes and metadata only rather than prompts or responses, and can be checked with an open-source verifier. You bring your own provider keys and pay providers directly.

The MCP server adds three tools for coding agents: `audit_repo_token_waste` and `calculate_model_arbitrage` run entirely on your machine, while `optimize_prompt_payload` sends the request body you give it to the TokenZero service, so keep secrets out of it. The static audit looks for large uncached prompts, frontier models doing extraction or classification, LLM calls inside loops and retired model ids. Its figures are estimates at list prices; verified savings come only from gateway receipts.

The open-source tools, including the CLI and a GitHub Action that comments on pull requests, are Apache-2.0 licensed.

## Features

- **Signed receipts:** One chained, verifiable record per model call.
- **Repo token-waste audit:** Static scan for caching and model-choice savings.
- **Model arbitrage pricing:** Compare alternative models at list prices.
- **Cache-friendly payloads:** Rewrite request bodies to improve prompt caching.
- **PR cost check:** A GitHub Action reports cost changes on each pull request.
- **Budget control:** Per-agent and per-key budgets.
- **Bring your own keys:** Provider keys pass through and are not stored.

## Good for

- Audit a repository for wasted LLM tokens
- Cap spend per agent or API key
- Prove what an AI workload cost with verifiable receipts
- Gate CI when recoverable token waste exceeds a threshold
- Make a prompt friendlier to caching

## Install

### Claude Code (Terminal)

```sh
claude mcp add --transport http tokenzero https://tokenzero.sh/mcp
```

### Claude Desktop (Settings → Connectors → Add custom connector)

```sh
https://tokenzero.sh/mcp
```

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

```json
{
  "mcpServers": {
    "tokenzero": {
      "url": "https://tokenzero.sh/mcp"
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "tokenzero": {
      "type": "http",
      "url": "https://tokenzero.sh/mcp"
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "tokenzero": {
      "serverUrl": "https://tokenzero.sh/mcp"
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "tokenzero": {
      "type": "http",
      "url": "https://tokenzero.sh/mcp"
    }
  }
}
```

## Tools

- `audit_repo_token_waste`: Audit the open project for token waste locally
- `calculate_model_arbitrage`: Price alternative models locally
- `optimize_prompt_payload`: Make a request body cache-friendly via the TokenZero service

## FAQ

### Does it read my prompts?

The ledger stores hashes and metadata only. The optimize_prompt_payload tool sends the body you provide to TokenZero, so avoid secrets in it.

### Who holds my provider keys?

You do. Keys pass through the gateway and are not stored; you pay providers directly.

### Are the savings numbers exact?

Audit figures are static estimates at list prices. Verified savings come from gateway receipts.

### What licence do the tools use?

The open-source repository is Apache-2.0.

### Is TokenZero free?

TokenZero has a free plan, with paid plans for more usage or features.

### How do I add TokenZero to Claude Code?

Run this command in your terminal: claude mcp add --transport http tokenzero https://tokenzero.sh/mcp

### What are the best alternatives to TokenZero?

The closest alternatives to TokenZero are Claude Code Ultimate Guide, signafAIde, Toolkien, Lugh and HypePaper.

## Alternatives

- [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.
- [signafAIde](https://ai-powered.com/mcp/signafaide): signafAIde is a freemium MCP server for security.
- [Toolkien](https://ai-powered.com/mcp/toolkien): Toolkien is an open-source MCP server for ai models and llm tooling.
- [Lugh](https://ai-powered.com/mcp/lugh): Lugh is an open-source MCP server for ai models and llm tooling.
- [HypePaper](https://ai-powered.com/mcp/hypepaper): HypePaper is a freemium MCP server for ai models and llm tooling.
- [Agent Data Tools: Compact (find, describe, run)](https://ai-powered.com/mcp/agent-data-tools-compact-find-describe-run): Agent Data Tools: Compact (find, describe, run) is a freemium MCP server for developer tools.
- [Angel Agent Guard: pre-purchase check + prompt-injection scan](https://ai-powered.com/mcp/angel-agent-guard-pre-purchase-check-prompt-injection-scan): Angel Agent Guard: pre-purchase check + prompt-injection scan is a freemium MCP server for ai models and llm tooling.
- [Mizan Calibration](https://ai-powered.com/mcp/mizan-calibration): Mizan Calibration is a free MCP server for ai models and llm tooling.

---
Source: https://ai-powered.com/mcp/tokenzero
