Skip to main content
MCP server CX Codex

TokenZero — Claude Code MCP server: what it does, install

TokenZero scans code for wasted LLM tokens, compares model pricing, and reshapes request payloads for caching. Use it from a coding agent or CI.

Apache-2.0 updated 2026-10-28

Install into Claude Code · Platform CLI: remote server All methods and platforms ↓
claude mcp add --transport http mcp https://api.tokenzero.sh/mcp
Open on GitHub

What TokenZero does

TokenZero gives a coding agent tools for inspecting LLM spend patterns. audit_repo_token_waste reads the local project and flags large uncached prompts, detached templates, model choices that do not fit simple extraction or classification work, looped LLM calls, and model IDs without current pricing. calculate_model_arbitrage compares model options, while optimize_prompt_payload sends a supplied request body to the service for adjustment.

The audit is static: it examines source code rather than request traffic, so its cost figures are estimates based on listed prices. The analyzer stays on the machine and can process a diff or fail CI after a chosen recoverable-cost threshold. The MCP package runs through npx; the CLI can also initialize a project and add provider base URLs to .env after consent.

optimize_prompt_payload sends its input to https://tokenzero.sh unless TOKENZERO_URL changes the destination. Keep secrets out of that payload. Provider keys pass through the gateway without being stored.

What it helps with

  • spot prompts that lack caching directives
  • compare alternative model prices
  • check the cost impact of a pull request
  • find LLM calls placed inside loops
  • prepare a request body for caching

Example prompts for the agent

  • Run audit_repo_token_waste on this repository and list the token-waste findings.
  • Use calculate_model_arbitrage to compare models for this request.
  • Send this non-secret body to optimize_prompt_payload and make it more cache-friendly.

How to install TokenZero

1Platform CLI: remote server

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

2Platform CLI

claude mcp add --env TOKENZERO_URL=<TOKENZERO_URL> --env TOKENZERO_KEY=<TOKENZERO_KEY> --transport stdio tokenzero -- npx -y @tokenzero/mcp

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about TokenZero

How do I install TokenZero in Claude Code?

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

What does TokenZero do?

It gives coding agents a local project audit, model price comparisons, and request-payload preparation for caching. Its CLI also supports project setup, usage checks, and signed savings receipt verification.

Does TokenZero send the repository or secrets to its service?

The repository audit and model comparison run locally. The body supplied to optimize_prompt_payload goes to https://tokenzero.sh, so secrets should stay out of that input.

Similar MCP servers

All MCP servers for AI and ML →

Project sponsors

Companies that keep this analytics open