Skip to main content

mcp-compressor Python SDK

Python SDK and CLI wrapper for mcp-compressor.

The public Python import is mcp_compressor:

from mcp_compressor import CompressorClient

Quick start

The primary SDK object is CompressorClient. It starts a local session and returns a CompressorProxy; no mcp-compressor stdio subprocess is required.

from mcp_compressor import CompressorClient

servers = {
    "alpha": {
        "command": "python",
        "args": ["alpha_server.py"],
    },
    "atlassian": {
        "url": "https://mcp.atlassian.com/v1/mcp",
    },
}

with CompressorClient(
    servers=servers,
    mode="compressed",
    compression_level="medium",
    include_tools=["getConfluencePage", "updateConfluencePage"],
    toonify=True,
) as proxy:
    print([tool.name for tool in proxy.tools])
    result = proxy.invoke(
        "getAccessibleAtlassianResources",
        {},
        server="atlassian",
    )
    print(result)

Modes

CompressorClient accepts these modes:

  • compressed — expose compressed wrapper tools such as <server>_get_tool_schema and <server>_invoke_tool.
  • cli — expose CLI/help tools for generated shell command usage.
  • bash — expose Just Bash command integration for command-oriented agents.

Generated Python and TypeScript clients are produced with proxy.write_client(...) rather than by selecting a long-lived session mode.

Just Bash metadata

Just Bash mode lets language hosts register backend MCP tools as shell-style commands:

from mcp_compressor import CompressorClient, create_just_bash_commands

with CompressorClient(servers=servers, mode="bash") as proxy:
    commands = {cmd.command_name: cmd for cmd in create_just_bash_commands(proxy)}
    print(commands["atlassian_get-accessible-atlassian-resources"]([]))

Duplicate backend command names are prefixed with the provider name, for example alpha_echo and beta_echo.

Generated clients

A connected proxy can write shell, Python, or TypeScript clients that call the live proxy:

with CompressorClient(servers=servers, compression_level="max") as proxy:
    proxy.write_client("cli", "./bin", name="atlassian")
    proxy.write_client("python", "./generated-py", name="atlassian")
    proxy.write_client("typescript", "./generated-ts", name="atlassian")

Packaging smoke test

Build a local wheel and verify it imports from a clean virtualenv:

uvx maturin build --release --out dist
python -m venv /tmp/mcp-compressor-wheel-test
/tmp/mcp-compressor-wheel-test/bin/python -m pip install "$PWD"/dist/*.whl
cd /tmp
/tmp/mcp-compressor-wheel-test/bin/python -c "from mcp_compressor import CompressorClient, ToolSpec"

CI runs the same kind of wheel smoke test before uploading the built wheel as an artifact.

Advanced helpers

Low-level helpers such as compress_tool_listing, parse_tool_argv, and ToolSpec remain available for tests and advanced integrations, but the primary SDK entry point is CompressorClient.

Summary-only host tool discovery

For host-owned Just Bash tools, use transform_tools_for_just_bash(tools, bash=bash, server_name="records", help_mode="summary", help_summary="Search and manage records.") to omit the subcommand catalog from the model-visible help description. Defaults remain help_mode="full"; the optional summary is caller-supplied capability text. Calling the help tool or records --help still returns the full catalog; per-command help and execution are unchanged. The low-level build_host_transform_plan helper accepts the same keyword options and returns separate helpDescription and helpText fields. This does not change MCP proxy compression levels or high-level client session configuration.

Metadata

Release files for mcp-compressor 0.39.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-compressor 0.39.0
File Size Uploaded Provenance Actions
mcp_compressor-0.39.0.tar.gz 214.9 kB Without provenance Details for mcp_compressor-0.39.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mcp-compressor 0.39.0
File Actions
mcp_compressor-0.39.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for mcp_compressor-0.39.0-cp311-abi3-win_amd64.whl
mcp_compressor-0.39.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for mcp_compressor-0.39.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
mcp_compressor-0.39.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for mcp_compressor-0.39.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
mcp_compressor-0.39.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for mcp_compressor-0.39.0-cp311-abi3-macosx_11_0_arm64.whl
mcp_compressor-0.39.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for mcp_compressor-0.39.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 50.5 MB

Release files / mcp_compressor-0.39.0.tar.gz

Download URL mcp_compressor-0.39.0.tar.gz
Size 214.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5135d140e9bf4ae3c9406b6f17093d96e400208b14cd80b54a553a453abab5f3
BLAKE2b-256 checksum
How to use checksums
bd8726980a4496b25995d209e4b6c54d704951586879b5b35b852f71cad079e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mcp_compressor-0.39.0-cp311-abi3-win_amd64.whl

Download URL mcp_compressor-0.39.0-cp311-abi3-win_amd64.whl
Size 9.5 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
389a86e595e9583fb517d1f4cf7ff9ae4c898104084f75c2a1fe580b57af69bd
BLAKE2b-256 checksum
How to use checksums
c4fe6127aec122487c9224b6d13b6d7b1d9728928cf032302237bff0eee84d5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mcp_compressor-0.39.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL mcp_compressor-0.39.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 10.5 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b45ca0dd2a83a720c6b9a311691a7149325b34dd1d77336bb79e6967a2ad17fd
BLAKE2b-256 checksum
How to use checksums
c58f46da4b3ae6580727c4cbc1d0aa3c237a3a27e604ba96858f76c9daf4e612
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mcp_compressor-0.39.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL mcp_compressor-0.39.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 10.7 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
313e9eb270fb20130b5dcf5728d938bd7d56540eadf4d268840c7b1ac1a3987a
BLAKE2b-256 checksum
How to use checksums
d3bf1fb2fe6d067aef06a32f1644aaa675d6d5c408018a87624c0158bc1d010a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mcp_compressor-0.39.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL mcp_compressor-0.39.0-cp311-abi3-macosx_11_0_arm64.whl
Size 9.7 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fef21629b92dc09d502f1f0c7217343e7456edd54cbf08f921aca4faa7d213e0
BLAKE2b-256 checksum
How to use checksums
ca87efa1273b72c8e4963b4550e20b528dac6b09fcf0d3e0426a138e4a1b8f73
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mcp_compressor-0.39.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL mcp_compressor-0.39.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 9.9 MB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9f940b1a5679005f4a094d11a4b21d00c8dd9aa4c0884d8f8af3a79819eb326c
BLAKE2b-256 checksum
How to use checksums
49df8ff5a16bfded6a27cfd03aad141289bbefce74f264f91daf5bf451cac202
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for mcp-compressor 0.39.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.39.0 This release

6 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page