@manufosela/mcpack
v1.0.0
Published
Generic MCP response compression proxy. Like RTK but for MCP protocol.
Maintainers
Readme
MCPack
MCP Response Compression Proxy — Like RTK but for MCP servers.
Reduces LLM token consumption 60-90% by compressing MCP tool responses before they reach your AI agent.
How it works
MCPack sits between your LLM client (Claude Code, Cursor, etc.) and any MCP server as a transparent proxy:
LLM Client ←→ MCPack Proxy ←→ MCP Server
↓
Strips verbose fields
Truncates long arrays
Compacts JSON outputInstall
npm install -g mcpackQuick Start
Wrap any MCP server with MCPack:
# Before (raw MCP responses, high token usage):
planning-game-mcp
# After (compressed responses, 60-90% fewer tokens):
mcpack -- planning-game-mcpClaude Code Integration
In ~/.claude.json:
{
"mcpServers": {
"planning-game": {
"command": "mcpack",
"args": ["--preset", "planning", "--", "planning-game-mcp"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/key.json"
}
}
}
}Presets
| Preset | Use case | Compression |
|--------|----------|-------------|
| minimal | Any MCP — compact JSON only | ~30-40% |
| planning | Project management (tasks, sprints, cards) | ~70-85% |
| code | Code tools (diffs, patches, reviews) | ~60-75% |
| data | Database/data queries | ~50-65% |
| aggressive | Maximum savings for long sessions | ~80-90% |
mcpack --preset planning -- my-mcp-server
mcpack --preset aggressive -- my-mcp-serverCustom Config
Create mcpack.json:
{
"stripFromListItems": ["description", "body", "content"],
"stripAlways": ["changelog", "history"],
"maxArrayItems": 15,
"maxStringLength": 200,
"neverTruncateFields": ["id", "url", "email"],
"compactJson": true,
"transformers": {}
}mcpack --config ./mcpack.json -- my-mcp-serverWhat it compresses
| Strategy | Example | Savings |
|----------|---------|---------|
| Field stripping | Remove description, acceptanceCriteria from list items | 50-70% per item |
| Array truncation | 100 items → first 20 + count | 80% |
| Compact JSON | No indentation ({a:1} vs {\n a: 1\n}) | 30-40% |
| String truncation | 2000-char description → 300 chars | 85% |
Token Savings Example
A typical 30-minute Claude Code session managing 50 tasks:
| Operation | Without MCPack | With MCPack | Savings |
|-----------|----------------|-------------|---------|
| list_cards (50 tasks) | ~25,000 tokens | ~4,000 tokens | 84% |
| update_card × 30 | ~60,000 tokens | ~9,000 tokens | 85% |
| get_card × 10 | ~30,000 tokens | ~12,000 tokens | 60% |
| Session total | ~115,000 tokens | ~25,000 tokens | 78% |
Development
git clone https://github.com/manufosela/mcpack
cd mcpack
npm install
npm testLicense
MIT
