MCP server and proxy that compresses LLM prompts, tool output, and replies to cut token cost.
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.
Local proxy that compresses LLM API traffic so you pay less. Same answers, smaller bill.
β31% input Β· β74% output Β· β66% round-trip cost Β· 112 live A/B cases Β· ~5Β ms/call Β· no model to load
Using Claude Code? One install also gets you /sub
to serve it through CLIProxyAPI.
Proxy Β· CLI Β· MCP Β· library (Python Β· Ruby Β· Swift Β· Kotlin Β· JS/WASM)
What it does β’ Install β’ Day to day β’ In action β’ Works with β’ Claude Code β’ Numbers β’ Config β’ CLI & library
You run Claude Code, Codex, Cursor, or your own app. Every turn, the tool sends a large request: system prompt, tools, history, raw command output. You pay for every token of that, including the parts that do not help the model.
A 200-line build log with two errors. Tool schemas resent on every call. JSON with hundreds of near-identical rows. That bulk is still billed.
llmtrim sits on your machine as a local proxy, trims the waste, and forwards a smaller request. The reply is unchanged. You keep the same tools and answers; you spend less.
Compression cannot raise your bill or break a request; worst case is zero savings. Everything runs locally, nothing is sent to us. In action β
For Claude Code the same install also wires /sub to route sessions through another subscription. Details β
That's it. setup starts a local proxy, wires your shell, and enables recoverable tool-output shaping. When Claude Code is present, it also turns on /sub. You do not run a separate install for that.
| You want | Run |
|---|---|
| First install | llmtrim setup |
| New version | llmtrim update (then llmtrim ensure after npm/brew/cargo) |
| Something broken | llmtrim ensure Β· llmtrim doctor --fix Β· or f in status |
Any tool that honors
HTTPS_PROXYworks (Claude Code, Codex, Cursor, Aider, your SDK). GitHub Copilot does not (certificate pinning). Full list β
Full options: INSTALL.md.
Menu-bar / system-tray popover with the same savings numbers. Bundled in Homebrew, Scoop, and npm; setup can enable open-at-login. Open with llmtrim tray. On Linux desktops, interactive ensure can fetch the tray binary from the latest release (needs libwebkit2gtk-4.1 and libayatana-appindicator3).
Same technique as mitmproxy, scoped to LLM API hosts only. setup changes three things; llmtrim uninstall reverses all three:
~/.llmtrim/ (name-constrained; cannot intercept your bank or email)HTTPS_PROXY + CA trustNo API keys stored (your tool's auth is forwarded). Prompts never touch disk; only anonymous token counts. Recoverable tool results stay in bounded daemon RAM for five hours by default and disappear on restart. Full threat model: SECURITY.md.
| Situation | Command |
|---|---|
| Watch savings | llmtrim status |
After npm / brew / cargo upgrade | llmtrim ensure (or f in status) |
| Diagnose | llmtrim doctor Β· repair with doctor --fix |
| Pause / resume proxy | llmtrim stop Β· llmtrim start |
| Force one session through llmtrim | llmtrim wrap claude |
| Remove everything | llmtrim uninstall |
After setup, update, or ensure, owned Claude Code /sub stays in sync with the binary.
Time series: llmtrim status --daily Β· --weekly Β· --monthly Β· --json Β· --csv.
An agent ran a build. The tool returned 58 lines; two were errors. All 58 would have been billed.
4,662 chars β 978 (β79%). Errors stay verbatim. Repeated INFO lines fold into a template plus the values (lossless when the range is regular).
Try it on a request body of your own:
Log folding is one stage. Others kick in on different waste:
| Waste | What happens |
|---|---|
| Build logs, diffs, grep dumps | Keep errors / changes / matches; fold the rest |
| Long pasted context | Keep chunks relevant to the question |
| Source code | Keep useful bodies; rest β signatures |
| Tool schemas every turn | Trim + keep the cache prefix stable |
| Huge JSON arrays | Compact table (TOON) or sample |
| Verbose model replies | Ask for terser output where safe |
[!IMPORTANT] Compression cannot raise your bill or break a request. Each stage is re-measured with the provider's real tokenizer and undone if it does not save tokens. If the provider rejects the compressed body, the original is resent. Worst case is zero savings.
Existing prompt-cache prefixes (cache_control) are left alone. On shell-capable agent turns, a newly arriving tool result may be shaped once before its first cache write; the exact raw result remains recoverable with the emitted llmtrim recall r_β¦ command.
Stages run in savings order. Nothing under a cache_control marker is rewritten.
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/llmtrim)<a href="https://allmcps.com/mcp/llmtrim"><img src="https://allmcps.com/api/badge/llmtrim?style=directory" alt="Llmtrim on AllMCPs" /></a>