MCP Compressor logo

MCP Compressor

Organization
atlassian-labs

An MCP server wrapper for reducing tokens consumed by MCP tools, available in typescript, python, and rust

Publisheratlassian-labs
Repositorymcp-compressor
LanguageRust
Forks
14
Stars
136
Available tools
0
Transport typestdio
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    MCP Compressor exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    136 stars and 14 forks from the linked repository.

mcp-compressor

MCP Toplist

Release Build status Commit activity License

mcp-compressor helps agents use large MCP servers without spending huge amounts of context on tool descriptions and schemas.

It can run as a CLI MCP proxy, or be embedded directly from Python, TypeScript, or Rust.

Why mcp-compressor?

A powerful MCP server can expose dozens or hundreds of tools. Each tool has a name, description, input schema, and sometimes large nested JSON Schema details. Sending all of that to a model up front can waste thousands of tokens before the agent has done any useful work.

For example, large public MCP servers can spend thousands or tens of thousands of tokens on tool descriptions alone. That creates three problems:

  • models spend context on tools they may never call,
  • cost increases for every request that carries the tool list,
  • adding multiple MCP servers quickly overwhelms practical context budgets.

mcp-compressor changes the interaction pattern: the model sees a small compressed surface first, asks for the full schema only for the selected tool, and then invokes that tool.

Opt into bounded tool responses in any proxy mode with --shrinkfit (20,000 characters) or --shrinkfit=10000. Object responses retain their top-level shape and add truncation instructions. CLI/Code/Just Bash sessions save the full original in a private temporary file; MCP callers can recall with full=true using a session cache or bypassing shrinking on a backend call. See recoverable response shrinking.

Pattern 1: compressed MCP proxy

Use this when you want any MCP client to see a smaller tool surface.

The frontend usually exposes only:

  • get_tool_schema
  • invoke_tool
  • optionally list_tools at max compression

MCP protocol negotiation

The stdio and streamable HTTP frontends accept both legacy initialize clients and modern 2026-07-28 discovery clients, including Python MCP SDK 2.2.0 in auto, legacy, or explicit 2026-07-28 mode. Backend connections initialize independently, so modern clients can use legacy backends without sending frontend negotiation metadata to them. Backends must support legacy initialize; modern-only backends are not supported. Application tool-call metadata and tool result content, annotations, structured content, and error flags are preserved.

Modern catalog and resource-read responses use ttlMs: 0 and private cache scope. Catalogs remain static for the connection; dynamic change subscriptions are not advertised or supported. Legacy responses omit modern protocol fields.

Pattern 2: local proxy for SDKs and generated clients

Use this when your application wants to embed compression directly and call tools from code or shell commands.

The SDK starts a local session proxy for generated clients. Generated clients call that proxy using a session token. Your app does not need to spawn a mcp-compressor stdio subprocess.

Features

Quick example

=== "CLI"

```bash
mcp-compressor -c medium -- python server.py
```

=== "Python"

```python
from mcp_compressor import CompressorClient

with CompressorClient(
    servers={"alpha": {"command": "python", "args": ["server.py"]}},
    compression_level="medium",
) as proxy:
    print([tool.name for tool in proxy.tools])
    print(proxy.invoke("echo", {"message": "hello"}))
```

=== "TypeScript"

```ts
import { CompressorClient } from "@atlassian/mcp-compressor";

const proxy = await new CompressorClient({
  servers: { alpha: { command: "python", args: ["server.py"] } },
  compressionLevel: "medium",
}).connect();

try {
  console.log(proxy.tools.map((tool) => tool.name));
  console.log(await proxy.invoke("echo", { message: "hello" }));
} finally {
  proxy.close();
}
```

=== "Rust"

```rust
use mcp_compressor::compression::CompressionLevel;
use mcp_compressor::sdk::{CompressorClient, ServerConfig};
use serde_json::json;

let proxy = CompressorClient::builder()
    .server("alpha", ServerConfig::command("python").arg("server.py"))
    .compression_level(CompressionLevel::Medium)
    .build()
    .connect()
    .await?;

let result = proxy.invoke("echo", json!({ "message": "hello" })).await?;
```

Generated clients

CLI Mode generates shell commands:

bash
mcp-compressor --cli-mode --server-name atlassian -- https://mcp.atlassian.com/v1/mcp
atlassian get-accessible-atlassian-resources

Code Mode generates Python or TypeScript functions:

python
# generated-py/atlassian.py
import atlassian

resources = atlassian.get_accessible_atlassian_resources()
ts
import { getAccessibleAtlassianResources } from "./generated-ts/atlassian.ts";

const resources = await getAccessibleAtlassianResources();

See Code Mode and generated clients for more detail.

Where to go next

  1. Install the package you need.
  2. Run the quickstart.
  3. Read how compression works.
  4. Choose between CLI usage, SDK usage, generated clients, and Just Bash.

Installation

TypingMind
{
  "mcpServers": {
    "mcp-compressor": {
      "command": "uvx",
      "args": [
        "mcp-compressor",
        "{{config.SERVER_COMMAND_OR_URL}}"
      ],
      "env": {
        "SERVER_COMMAND_OR_URL": "<SERVER_COMMAND_OR_URL>"
      }
    }
  }
}

Use MCP Compressor MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MCP Compressor is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MCP Compressor as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MCP Compressor MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mcp-compressor": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MCP Compressor MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MCP Compressor MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MCP Compressor to help me with this task?
MCP Compressor
Sure. I read it.
Here is what I found using MCP Compressor.

Frequently asked questions

What is the MCP Compressor MCP server used for?

MCP Compressor is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MCP Compressor MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MCP Compressor with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MCP Compressor MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MCP Compressor connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MCP Compressor MCP to TypingMind?

MCP Compressor runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MCP Compressor MCP provide in TypingMind?

MCP Compressor exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MCP Compressor MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MCP Compressor requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇