Skip to main content
ClaudeWave

MCP server that cuts LLM token costs — for Claude, Cursor, any MCP client

MCP ServersOfficial Registry0 stars0 forksJavaScriptUpdated 10d ago
Install in Claude Code / Claude Desktop
Method: NPX · mcp-token-optimizer
Claude Code CLI
claude mcp add mcp-token-optimizer -- npx -y mcp-token-optimizer
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "mcp-token-optimizer": {
      "command": "npx",
      "args": ["-y", "mcp-token-optimizer"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
Use cases

MCP Servers overview

# mcp-token-optimizer

**An MCP server that cuts your LLM token costs.** Give your AI assistant (Claude, Cursor, or any MCP client) the ability to measure, price, and shrink prompts before they cost you money.

Teams routinely overspend 60–80% on LLM tokens through bloated prompts and using a pricier model than the task needs. This server adds four tools that make those savings one call away — no LLM call required for the optimization itself, so it's free and instant.

## Tools

| Tool | What it does |
|---|---|
| `count_tokens` | Token count for any text + input cost across common models (or one model). |
| `estimate_cost` | Per-call **and** monthly/yearly spend for a prompt, model, output size, and call volume. |
| `slim_prompt` | Safely compresses a prompt (shortens verbose phrases, drops filler, dedupes lines, normalizes whitespace) and reports tokens and **dollars saved**. |
| `compare_model_costs` | Costs the same prompt across many models and recommends the **cheapest** one. |

Token counts use `gpt-tokenizer` (exact for OpenAI; a close estimate for Claude/Gemini). Prices are an editable mid-2026 snapshot in `lib.js` — verify against each provider's pricing page.

## Install

Add to your MCP client config:

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

- **Claude Desktop:** add the block above to `claude_desktop_config.json`.
- **Cursor:** add it to `.cursor/mcp.json`.
- **Any MCP host:** run the binary `mcp-token-optimizer` (stdio transport).

Then ask your assistant things like:
- *"Count the tokens in this prompt and tell me the cost on gpt-4o vs gpt-4o-mini."*
- *"Slim this system prompt and show me what I'd save at 50,000 calls a month."*
- *"Which model is cheapest for this prompt with ~400 tokens of output?"*

## Run locally

```bash
npm install
npm test
npx mcp-token-optimizer   # starts the stdio server
```

## License
MIT
aianthropicclaudecost-optimizationcursorllmmcpmodel-context-protocolopenaiprompt-engineeringtoken-optimization

What people ask about mcp-token-optimizer

What is rccola990-cloud/mcp-token-optimizer?

+

rccola990-cloud/mcp-token-optimizer is mcp servers for the Claude AI ecosystem. MCP server that cuts LLM token costs — for Claude, Cursor, any MCP client It has 0 GitHub stars and was last updated 10d ago.

How do I install mcp-token-optimizer?

+

You can install mcp-token-optimizer by cloning the repository (https://github.com/rccola990-cloud/mcp-token-optimizer) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.

Is rccola990-cloud/mcp-token-optimizer safe to use?

+

rccola990-cloud/mcp-token-optimizer has not been audited yet by our security agent. Review the original repository on GitHub before using it in production.

Who maintains rccola990-cloud/mcp-token-optimizer?

+

rccola990-cloud/mcp-token-optimizer is maintained by rccola990-cloud. The last recorded GitHub activity is from 10d ago, with 0 open issues.

Are there alternatives to mcp-token-optimizer?

+

Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.

Deploy mcp-token-optimizer to your cloud

Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.

Maintain this repo? Add a badge to your README

Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.

Featured on ClaudeWave: rccola990-cloud/mcp-token-optimizer
[![Featured on ClaudeWave](https://claudewave.com/api/badge/rccola990-cloud-mcp-token-optimizer)](https://claudewave.com/repo/rccola990-cloud-mcp-token-optimizer)
<a href="https://claudewave.com/repo/rccola990-cloud-mcp-token-optimizer"><img src="https://claudewave.com/api/badge/rccola990-cloud-mcp-token-optimizer" alt="Featured on ClaudeWave: rccola990-cloud/mcp-token-optimizer" width="320" height="64" /></a>

More MCP Servers

mcp-token-optimizer alternatives