Skip to main content

MCP server for Compresh — production-grade context compression with Q-protective ranking, epistemic markers, and depth-aware adaptation

Project description

compresh-mcp

MCP server for Compresh — production-grade context compression for LLM agent conversations.

Compresh adds Q-protective ranking, epistemic marker classification, and depth-aware adaptation on top of the open-source tulbase compression core. This is the paid tier distribution.

Architecture (0.2.0+)

  • Local: bundled tulbase (MIT, vendored as compresh_mcp.tulbase) runs on every turn for fast compression + cold-storage support (fetch_compressed / list_compressed MCP tools).
  • Server: TUL 1.0 layers (Q-protective ranking, epistemic markers, semantic store) run on Compresh infrastructure via the /v1/tul1 endpoint, gated by your Compresh API key + tier.
  • Degraded mode: if /v1/tul1 is unreachable, compresh-mcp transparently falls back to the local tulbase result so compression never blocks.

Previously (0.1.0, yanked), TUL 1.0 classifiers shipped inside the client package. That distribution leaked paid features into the local install and is no longer recommended — install 0.2.0 or later. See CHANGELOG.md for the migration note.

What's the difference vs tulbase-mcp?

Feature tulbase-mcp (free, open-source) compresh-mcp (paid)
Base LexRank summarization
Modality elision (code, terminal, JSON, stack traces)
Cold storage + fetch_compressed
Protection Zone (Claim 1e)
Q-protective sentence ranking (Q1–Q4 categorization)
Epistemic markers (VR/HR/CR/UC)
Semantic store (cross-turn Q3 dedup)
Saving telemetry to Compresh dashboard
Multi-device sync (planned)

In Compresh's bench (Compresh-bench v1, 600-turn multi-model), Q-protective ranking adds 5–12 percentage points of equivalence preservation vs base LexRank at the same token savings — Pareto improvement.

Pricing

See https://compre.sh/pricing. Three tiers:

  • Tier-A (integrated MCP/OAuth metadata, e.g. Cowork, Claude Code, Cursor): saving-share %25 on actual model cost
  • Tier-B (family-level provider declaration): saving-share %25 on the family's cheapest model price
  • Tier-C (anonymous / local LLM / free models): flat $0.20 per 1M saved input tokens

Every new user: $30 free credit (90-day expiry), $10 minimum budget (charged $7.5 after standard %25 discount).

Installation

pip install compresh-mcp

On first run, you'll be prompted for your Compresh API key. If you don't have an account, your browser opens to compre.sh/signup automatically.

MCP client configuration

Claude Code (~/.claude/mcp.json)

{
  "mcpServers": {
    "compresh": {
      "command": "compresh-mcp",
      "env": {
        "COMPRESH_API_KEY": "sk-comp_...",
        "COMPRESH_API_BASE": "https://api.compre.sh"
      }
    }
  }
}

Cursor (~/.cursor/mcp.json)

Same structure as Claude Code.

Cowork

Cowork → Settings → Tools → MCP servers → Add:

  • Command: compresh-mcp
  • Environment: COMPRESH_API_KEY=sk-comp_...

Tools exposed

Same four tools as tulbase-mcp, with enhanced behavior:

  • compress — Q-protective compression by default (protection_mode="balanced")
  • fetch_compressed, list_compressed, stats — same interface

Plus paid-tier extras:

  • usage — current cycle budget, free credit balance, savings metrics

License

Business Source License 1.1 — see LICENSE. Production use permitted with valid Compresh API key. License automatically converts to MIT after 4 years (Year 2030).

Patents

Q-protective sentence ranking + Protection Zone are covered by TR-TPMK patent application 2026/007305 (Compresh Ltd, May 2026). A valid Compresh subscription grants implementation license.

Status

v0.1.0 — first public release, May 2026. Active development. APIs may change before v1.0. Issues and pull requests welcome.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compresh_mcp-0.2.0.tar.gz (64.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

compresh_mcp-0.2.0-py3-none-any.whl (71.7 kB view details)

Uploaded Python 3

File details

Details for the file compresh_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: compresh_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 64.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for compresh_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f8082ab37c6d0ab076075b734f93085302f1703814dd8ac236e85588d340e569
MD5 5e5eb44097757156d816ac9efa6842e0
BLAKE2b-256 a1cf785f0441d7c17c6dd807c6bca86c943407833939b7f88dcbf62d834d470e

See more details on using hashes here.

File details

Details for the file compresh_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: compresh_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 71.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for compresh_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b79d9d60d67f9b3e7e29e7f9496ca6c7ee0c482bcae74dee27c4fb02b0406300
MD5 5e91cdf8fd7663df85ee60c7e8284b64
BLAKE2b-256 8c6d76f8cc5a7b44ffd38619d044a50e911de1a680dd9b1a792210d7e6c0fb63

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page