MCP server that reduces token usage by caching, diffing, and maintaining a knowledge graph to optimize agent context windows.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag โ we're steadily working through the catalog.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Token Optimizer MCP.
Spend less context, keep the conclusions, and audit every claim across 16 coding clients.
One local ledger for optimizer tools, live-graph substitutions, every agent, and the graph's own cost.
Your agent burns most of its context on work it already did: re-reading files that have not changed, dumping a whole file to see three lines, running unbounded searches, and re-deriving conclusions it reached last session and then forgot.
Token Optimizer attacks that on four fronts.
1. It makes the expensive call impossible. Install the plugin and a built-in
Read of a 200 KB file is denied, with the refusal naming the cached,
diffed replacement. Same for Grep, Glob, Edit, Write, and cat /
head / grep -r through the shell. Re-reading a file you already read this
session returns only a diff โ usually the single biggest win, and one that
size-based rules structurally cannot catch. There is no setting to turn on.
2. It remembers what your agent worked out. A per-project knowledge graph accumulates findings, decisions and dead ends as a side effect of working, then feeds them back the moment the agent touches the relevant file. A finding costs ~150 tokens to carry. Re-deriving it costs 5kโ50k.
3. It measures itself, in public, and tells you when it is losing. A materialized before/actual-return measurement for MCP progressive disclosure, with later expansions debited from the same net. Modeled graph substitutions and the randomized control arm for downstream graph effects remain separate. Every number is measured, visibly collecting, excluded, or absent.
4. It attributes the traffic. Returned context, optional cost equivalents, and net transport avoided are grouped by operation and MCP handshake identity. Codex, Claude Code, Gemini, and any other connected client get separate rows. Old records without identity remain explicitly unattributed instead of being assigned to whichever agent happens to be open now.
No account, no telemetry, no hosted service. MIT, so it is usable at work.
The screenshots in this README come from the shipped server reading persisted local data, not a design mockup. In the capture above it reports:
Collecting.The dashboard now reads native CLI usage receipts and prices uncached input, cache reads, cache writes, and output with the exact captured provider, model, route, request-time tier, and versioned official source. Ambiguous model ids stay Not priced instead of receiving a blended guess. API/list-price equivalents are kept separate from provider-reported charges and are never labeled as a subscription invoice. See the token accounting contract.
Claude Code โ install the plugin, not the bare MCP server. The plugin is what enforces; adding the server alone just gives the model tools it can ignore.
That is the entire installation. All sixteen clients โ
Then, whenever you want to know what to do next:
One ranked queue: what is costing the most per session, with an optional monthly cost equivalent only after you configure your own effective rate. Each line names how to fix it. Not a dashboard, not six reports โ a queue.
Every agent session ends the same way: the reasoning evaporates. The next session re-derives it, at full price, forever.
This builds a living per-project graph โ nodes for files, symbols, tasks and
findings; edges for derived_from, contains, supersedes, contradicts,
related โ and it fills itself in from real work. No ingestion job, no
embedding model, no rebuild step, no query to formulate.
None of that is in your repository. It exists only because an agent once burned tokens finding it out โ and every other tool throws it away at the end of the session.
What a default install actually produces. The structural graph โ files,
symbols, tasks, and the edges between them โ is captured from ordinary tool
traffic with no configuration at all. Findings are produced two ways. At session
end, derive reads evidence already on disk (command outcomes and exit codes,
red-to-green transitions, corrections, re-read churn) and writes findings from
it: no model call, no credential, nothing sent anywhere. And the active model
records durable conclusions itself through wiki_write.
The model-based semantic harvest is the third path, and the only one that
needs something you do not already have. It is not opt-in โ
TOKEN_OPTIMIZER_HARVEST=0 turns it off โ but its real gate is a credential:
with none it reports off:no-key, which is the state on CI, corporate machines,
and subscription-only logins. Point TOKEN_OPTIMIZER_HARVEST_ENDPOINT at a
local model and it runs free and private, with nothing leaving the machine.
npx token-optimizer-doctor states which of these is live.
| Classic RAG | This |
|---|---|
| Retrieves evidence; the model re-derives meaning each time | Retrieves verdicts โ the reasoning already happened |
| Index built by a batch ingestion job | Accretes from real agent traffic โ coverage follows attention |
| Similarity search | Traversal โ this symbol and its callers |
| Model must formulate a query | Fires when the model reaches for a file |
| Staleness invisible; serves rotted chunks confidently | Staleness computed from content hashes, served with the invalidating diff |
| Returns only what is in the documents | Returns dead ends, which exist nowhere in your source tree |
Traversal plus lexical search: deterministic, instant, explainable, and it works offline.
A plain deny costs a full turn: the model calls Read, is refused, re-plans,
calls smart_read. But at refusal time we already hold the file and the
snapshot the graph stored โ so the refusal carries the answer inside it.
Nothing to re-plan, no second call. Turn cost drops from one to zero.
And when the graph already holds the verdict a tool output would support, the output never enters context at all. Not compressed. Absent.
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/ooples-token-optimizer-mcp)<a href="https://allmcps.com/mcp/ooples-token-optimizer-mcp"><img src="https://allmcps.com/api/badge/ooples-token-optimizer-mcp?style=directory" alt="Token Optimizer MCP on AllMCPs" /></a>