Metadata-Version: 2.4
Name: compresh-mcp
Version: 0.1.0
Summary: MCP server for Compresh — production-grade context compression with Q-protective ranking, epistemic markers, and depth-aware adaptation
Author-email: Compresh Ltd <hello@compre.sh>
License: BUSL-1.1
Project-URL: Homepage, https://compre.sh
Project-URL: Documentation, https://compre.sh/docs
Project-URL: Issues, https://github.com/compresh/compresh-mcp/issues
Keywords: mcp,model-context-protocol,llm,agent,context-compression,compresh,q-protective,epistemic,tulving
Classifier: Development Status :: 3 - Alpha
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICES.md
Requires-Dist: mcp>=1.0.0
Requires-Dist: duckdb>=0.10.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: sentence-transformers>=2.2.0
Requires-Dist: scikit-learn>=1.3.0
Provides-Extra: tokenizer
Requires-Dist: tiktoken>=0.5.0; extra == "tokenizer"
Provides-Extra: summarizer
Requires-Dist: sumy>=0.11.0; extra == "summarizer"
Requires-Dist: nltk>=3.8.0; extra == "summarizer"
Provides-Extra: injection
Requires-Dist: torch>=2.0.0; extra == "injection"
Requires-Dist: transformers>=4.30.0; extra == "injection"
Provides-Extra: proxy
Requires-Dist: fastapi>=0.100.0; extra == "proxy"
Requires-Dist: uvicorn>=0.23.0; extra == "proxy"
Provides-Extra: verify
Requires-Dist: tiktoken>=0.7.0; extra == "verify"
Requires-Dist: transformers>=4.40.0; extra == "verify"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Requires-Dist: ruff>=0.4; extra == "dev"
Requires-Dist: mypy>=1.10; extra == "dev"
Dynamic: license-file

# 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`](https://github.com/compresh/tulbase)
> compression core. This is the **paid tier** distribution.

## 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](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

```bash
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](https://compre.sh/signup)
automatically.

## MCP client configuration

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

```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](./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

This repo is **private** during dogfood phase (May 2026). Public release
scheduled for Q3 2026 alongside the Compresh dashboard MVP.
