MCP server that cuts LLM token costs — for Claude, Cursor, any MCP client
claude mcp add mcp-token-optimizer -- npx -y mcp-token-optimizer{
"mcpServers": {
"mcp-token-optimizer": {
"command": "npx",
"args": ["-y", "mcp-token-optimizer"]
}
}
}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
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.
[](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
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。