Token Optimizer MCP
Lets your AI agent cut token use with caching, compression and smart file tools, and measure the savings per agent.
570 stars on GitHubby ooplesLicense MITUpdated 19 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add token-optimizer -- npx -y @ooples/token-optimizer-mcp
What to fill in
| Name | What it is | Required |
|---|---|---|
TOKEN_OPTIMIZER_CACHE_DIR | Directory path for cache storage (optional, defaults to ~/.token-optimizer-cache) | No |
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Show me how many tokens I saved this week per agent.
Compress this large log before you read it.
What it is
Token Optimizer MCP compresses what goes into the model's context window and measures the saving. The readme says it optimizes the bill, taking prompt caching prices into account, and ships a benchmark so you can check it. It also keeps a local knowledge graph shared across 16 command-line clients.
What it can do
- Caching of repeated content
- Compression of large tool output
- Smart file tools
- A local ledger of tokens saved per agent
- A live local knowledge graph shared across clients
- A proxy that moves large blocks out to files
When to use
- βΊWhen you want to see how many tokens each coding agent is using and saving
- βΊWhen you want to compress big logs and file reads before they reach the model
- βΊWhen you want several agents to share the same local knowledge graph
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
llm-cost-optimizerHelps your agent cut the cost of AI model use by choosing models, caching prompts, limiting tokens and logging spend before launch.geminiignore-finopsOptimizes the agent's token usage to reduce costs. Helps control what the agent considers to be more efficient.zipai-optimizerOptimizes token usage in prompts to save resources. It helps make communication with AI more efficient and cheaper.Frequently asked questions
Is it free and open source?
The readme shows a license badge and an npm package; no price is mentioned.
How much does it save?
The registry says 60 to 90 percent. The readme gives per-workload figures from its own benchmark.
Can I check the claims?
Yes. The readme says it ships the benchmark and commands to reproduce the tables.
Which clients does it work with?
The description names 16 CLI clients for the shared knowledge graph; the list is not in the part provided.
Does it compare itself to other tools?
Yes. The readme compares it with another compression tool, called Alternative A, on that tool's own fixtures.
Does it need an account?
The readme does not mention one.
If it does not work
- βΊCheck that Node.js is installed and recent enough.
- βΊRestart your MCP client fully after adding the server.
- βΊCheck the npm package name is @ooples/token-optimizer-mcp.
5 new skills a week. 1 minute to read.