MCP · Updated 2026-11-18
MCP tool output compression: keep the lines that answer the question
MCP tools return whatever the server sends back: full JSON objects, long logs, whole files, pages of search hits. All of it lands in the model's context, and it is paid for again on every turn it stays there. SuperCompress compresses MCP tool results against the question your agent is working on, so the model reads the lines that answer it instead of the whole dump.
compress_context tool reports original_tokens and compressed_tokens (estimates; the hosted HTTP API calls the second one kept_tokens).
Related: compare context compression tools that sit on tool output, including Headroom alternatives, Caveman alternatives and ScaleDown alternatives. See also MCP context bloat and how to reduce tool call output tokens.
Compare every tool: context compression and token tools compared, Headroom alternatives, and the complete guide to context compression.
Why MCP token usage grows
Most MCP servers wrap an API and pass its response straight through. A single call can return dozens of records with every field filled in, a full build log, or an entire file when the agent needed one function. The model has to read all of it to find the part that matters, and the tool result keeps riding along in the conversation on later turns.
- API wrappers return complete objects: nested metadata, URLs, timestamps and fields nobody asked about.
- Logs and CI output bury one failing line under thousands of passing ones. Here is how to compress a failed CI log before the model reads it.
- File reads and search tools return whole files or long hit lists when the question is about one symbol.
How SuperCompress compresses MCP tool results
SuperCompress is hosted, extractive and query-aware.
- You send two things: the tool output as
context, and the current question or task asquery. The query is never compressed. - It picks lines, it does not write them. SuperCompress keeps the original lines from the tool output that answer that question and drops the rest. File paths, error messages, IDs and code in the kept lines stay as written. Preprocessing may rewrite JSON or collapse repeated stack frames before lines are chosen.
- You see the result. The
compress_contextMCP tool reportsoriginal_tokensandcompressed_tokens(estimates, not provider-billed totals; the hosted HTTP API calls the second onekept_tokens). When the savings would be too small the content passes through unchanged andcompressed_tokensis left out.
Set it up in your coding agent
Setup links your SuperCompress account in the browser, detects the coding agents on your machine and wires each one. It adds the SuperCompress MCP server, and it installs hooks where the agent supports them:
npm install -g supercompress-proxy && supercompress setup
Your agent then has four MCP tools:
| Tool | What it does |
|---|---|
compress_context | Takes a bulky context (tool output, logs, diffs, files) and the user's query, and returns the kept lines with original_tokens and compressed_tokens (estimates; the hosted HTTP API calls the second one kept_tokens). |
connect_account | Links the agent to your SuperCompress account. |
usage_summary | Shows token totals and quota for the connected account. |
runway_check | Checks your provider rate-limit runway (5-hour, weekly and monthly windows) before large or multi-step work, and suggests whether to go ahead, checkpoint or wait. |
Run supercompress doctor at any time to check what is wired up. The full harness list is in the coding agents guide. Cursor-specific steps are on how to reduce Cursor token usage. Claude Code-specific steps are on how to reduce Claude Code token usage. Goose-specific steps are on how to reduce Goose token usage, and OpenClaw-specific steps, including its tool-result hooks, are on how to reduce OpenClaw token usage.
Building your own MCP host or agent
If you run the agent loop yourself, compress each large tool result before you append it to the messages you send to the model. The hosted MCP endpoint is:
https://www.supercompress.dev/api/mcp
Or call the HTTP API directly with an API key from the dashboard:
curl -X POST https://www.supercompress.dev/api/v1/compress \
-H "X-API-Key: sc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"context": "<the MCP tool result>", "query": "<what the agent is trying to answer>"}'
Request fields and response fields are in the API reference.
How it compares to other ways to reduce MCP token usage
There are two separate costs in an MCP setup: the tool definitions the model sees on every turn, and the tool results that come back from each call. Different tools go after different parts.
| Approach | What it changes | How it decides what to keep |
|---|---|---|
| SuperCompress | The content of a tool result (or any large context) | Against the current question: keeps the original lines that answer it and drops the rest |
| compressmcp | Large JSON tool responses in Claude Code | Keeps every value and abbreviates repeated JSON keys, with a key dictionary the model reads to decode them |
| Bifrost Code Mode | Tool definitions and multi-step tool workflows across many MCP servers | Exposes four meta-tools; the model writes Python (Starlark) that runs the tool calls in a sandbox and returns only the final result |
These approaches do not exclude each other. Code Mode shrinks the tool catalog, key abbreviation shrinks JSON structure, and SuperCompress decides which parts of a result are worth reading for the question at hand.
When it helps, and when to skip it
- Good fit: large, mixed tool results where only part of the output matters for the current question, such as logs, search hits, file reads and API responses with many records.
- Skip it: small results, or results the agent must see in full, such as a file it is about to edit line by line.
Pricing
Current plans and your free allowance are shown in the dashboard.
FAQ
What is MCP tool output compression?
It means shrinking what an MCP tool returns (JSON payloads, logs, file reads, search results) before the model reads it. SuperCompress does this against the question the agent is working on: it keeps the original lines that answer that question and drops the rest. Preprocessing may rewrite JSON or collapse repeated stack frames before lines are chosen.
Does SuperCompress rewrite or summarize MCP tool results?
No. It is extractive and query-aware. It selects original lines against the question and drops the rest instead of writing a summary, so file paths, error messages and code in the kept lines stay as written. Preprocessing may rewrite JSON or collapse repeated stack frames before lines are chosen.
What do I send besides the tool output?
The current question or task. SuperCompress uses it to decide which lines to keep, and it never compresses the question itself.
How do I see how many tokens SuperCompress removed from a tool result?
The compress_context MCP tool reports original_tokens and compressed_tokens. The hosted HTTP API calls the second one kept_tokens. These counts are estimates, not provider-billed totals, and when the savings would be too small the content passes through unchanged and compressed_tokens is left out. The usage_summary MCP tool shows totals for your account.
How is this different from compressmcp or Bifrost Code Mode?
compressmcp abbreviates JSON keys in large MCP responses and keeps every value. Bifrost Code Mode hides many MCP tool definitions behind four meta-tools and runs tool calls in a sandbox. SuperCompress works on the content of a tool result and chooses which original lines to keep based on the current question, so it can sit alongside either approach.
How much does SuperCompress cost?
Current plans and your free allowance are shown in the dashboard at https://www.supercompress.dev/dashboard.