distill-mcp-v2

distill-mcp-v2

distill-mcp-v2 is a high-performance, network-dependency-free Python FastMCP server designed to aggressively optimize Large Language Model (LLM) context windows. It provides specialized tools for compressing and analyzing massive AI-agent payloads without losing critical semantic information.

Category
访问服务器

README

<div align="center"> <h1>Distill v2</h1> <p><strong>Model Context Protocol (MCP) Server for Massive Context Engineering & Compression</strong></p>

CI PyPI version License: MIT Python </div>


⚡ Overview

distill-mcp-v2 is a high-performance, network-dependency-free Python FastMCP server designed to aggressively optimize Large Language Model (LLM) context windows. It provides specialized tools for compressing and analyzing massive AI‑agent payloads without losing critical semantic information.

By filtering noise, stabilizing cache prefixes, and running multi-model token cost estimations locally, Distill v2 dramatically reduces API costs and preserves LLM reasoning abilities when dealing with heavy payloads like infinite logs, monolithic API schemas, and multi-agent war room transcripts.

🚀 Performance & Token Compression

Our rigorous, independent stress-testing benchmarks (audited via pytest and chaos blueprints) prove that distill-mcp-v2 achieves up to 99.7% token compression while retaining 100% of the crucial context.

Scenario Payload Profile Raw Tokens Distilled Tokens Savings %
Trace Avalanche Heavy Java Stacktraces 150,027 546 99.6%
Schema Monolith Massive Microservice JSON 56,588 1,355 97.6%
Incident War Room Multi-Agent Chat Logs 117,952 371 99.7%

(Tested against Claude-3-Opus budgets. Scenario 1 reduced costs from $2.25/call to $0.008/call.)

Read the full Benchmark & Execution Report for deeper insights.

🛠 Features & Toolset

Distill v2 exposes 8 precise tools to agents via the Model Context Protocol:

  1. distill_json — Compresses raw JSON payloads, retaining anomalies, exceptions, and errors.
  2. distill_logs — Compresses raw .log files, preserving head/tail contexts and stack traces.
  3. distill_schema — Compacts massive MCP tool catalogs and JSON schemas to structural parameters.
  4. distill_response — Progressively prunes, minifies, and truncates outputs to fit strict token budgets.
  5. distill_conversation — Extracts goals, decisions, blockers, and actions from multi-agent transcripts without leaking raw ISO timestamps.
  6. stabilize_for_cache — Maps chaotic raw identifiers (UUIDs, hex IDs) to sequential placeholders to stabilize LLM prompt caching.
  7. analyze_tokens — Accurately estimates token counts using tiktoken (cl100k_base).
  8. compare — Computes detailed diffs and cost-savings analyses between raw and distilled payloads.

📦 Quick Start

Installation

Distill v2 requires Python 3.10+. We recommend using uv or pip in an isolated virtual environment.

# Clone the repository
git clone https://github.com/yatinkoul/distill.git
cd distill

# Create a virtual environment and activate it
python -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -e .

Running the Server

Run the FastMCP server, which natively binds to a stateless HTTP endpoint.

# Run the FastMCP server (default host: 0.0.0.0, port: 8000)
distill --host 0.0.0.0 --port 8000
# Or using uvicorn directly:
.venv/bin/uvicorn src.main:app --host 0.0.0.0 --port 8000

The server exposes a JSON‑RPC endpoint at http://localhost:8000/mcp.

🧪 Stress Testing & Development

The repository ships with an exhaustive stress-test runner that dynamically allocates ports, executes deterministic payload scenarios, and validates the integrity of the distilled outputs.

To run the complete test suite (118/118 passing):

# Install development dependencies
pip install -e ".[dev]"

# Run the test suite
pytest

To manually execute the stress-testing blueprints and regenerate the benchmark report:

python stress_tests_blueprints/run_blueprints.py

📖 Documentation

🤝 Contributing

Contributions, issues, and feature requests are welcome! Please read our CONTRIBUTING.md (coming soon) for guidelines on how to propose improvements. Ensure all tests and linting (ruff) pass before submitting pull requests.

📜 License

This project is licensed under the MIT License – see the LICENSE file for details.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选