Stop overspending on LLM tokens

See what your prompts cost across GPT, Claude, and Gemini — then cut it. Free calculator below, plus an MCP server that does it automatically inside Claude & Cursor.

npm: mcp-token-optimizer · works with any MCP client · MIT
Free up to 800 chars · Get Pro for unlimited →
AI-compressed:
Review before use — AI compression can occasionally drop nuance. This is the engine behind the Pro tier.
Estimated tokens: (+ output)
Browser estimate (~chars/4). Install the MCP server for exact token counts, prompt slimming, and per-call automation.

Install in Claude / Cursor (30 seconds)

Add this to your MCP config (claude_desktop_config.json or .cursor/mcp.json):

{
  "mcpServers": {
    "token-optimizer": {
      "command": "npx",
      "args": ["-y", "mcp-token-optimizer"]
    }
  }
}

Then ask: "slim this system prompt and show what I'd save at 50k calls a month" or "which model is cheapest for this prompt?"

What it does

count_tokens

Exact token count + cost across models.

estimate_cost

Per-call + monthly/yearly spend.

slim_prompt

Compress prompts, measure $ saved.

compare_model_costs

Find the cheapest capable model.

Read: how to reduce LLM token costs →

Frequently asked questions

Token Optimizer is a free, open-source MCP server and cost calculator that cuts LLM token costs for developers on OpenAI, Anthropic, and Gemini. Published June 2026 · MIT license · prices 9 models.

What is Token Optimizer?

Token Optimizer is a free, open-source MCP server (npm package mcp-token-optimizer) and web tool that cuts LLM token costs for developers building on OpenAI, Anthropic, and Google Gemini. It counts tokens, estimates cost, compresses prompts, and finds the cheapest capable model inside Claude, Cursor, or any MCP client.

How much can it cut my LLM costs?

Most teams overspend 60-80% on tokens. Rule-based prompt slimming typically saves 20-40%, and AI compression has cut sample prompts by up to 69%. Routing a task to a cheaper but capable model can save 100x or more versus a frontier model.

Does it work with Claude and Cursor?

Yes. Add it to claude_desktop_config.json or .cursor/mcp.json using the command: npx -y mcp-token-optimizer. It works with any MCP-compatible client.

Is Token Optimizer free?

Yes. The MCP server and the web calculator are free and open-source under the MIT license, published June 2026. A Pro tier adds AI-powered prompt compression for deeper savings.

How does it count tokens?

It uses the gpt-tokenizer library for exact OpenAI token counts and close estimates for Claude and Gemini, then prices them against a current cost table covering 9 models.