Compendium
Allows using a local Ollama model for smarter summarization and query-aware filtering, falling back to heuristics when Ollama is unavailable.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Compendium
MCP server that shrinks noisy context before it reaches the model: filter logs, compress bulky text/JSON, redact secrets, chunk huge files, and keep only what a question needs.
One tool (compendium), one action field, deterministic heuristics that need no model. An optional local Ollama model improves the two "smart" actions.
Install (Cursor / Claude Desktop)
Requires Node.js 18+. No Rust toolchain needed — the launcher downloads a prebuilt binary once.
Add to ~/.cursor/mcp.json (or the project's .cursor/mcp.json, or Claude Desktop's MCP config):
{
"mcpServers": {
"compendium": {
"command": "npx",
"args": ["-y", "compendium-mcp"]
}
}
}Reload MCP. You should see a single tool named compendium. That's it.
Prebuilt binaries: macOS (arm64, x64), Linux (x64, arm64), Windows (x64). Other platforms: cargo build --release and set COMPENDIUM_BINARY=/path/to/compendium in the server env.
Optional: smarter summaries with Ollama
summarize_smart and filter_relevant use a small local model when one is configured; otherwise they fall back to heuristics. One command sets it up:
npx -y compendium-mcp setup-ollama --write-mcpIt detects (or --installs) Ollama, pulls qwen2.5:3b, probes http://127.0.0.1:11434/v1, and writes COMPENDIUM_LOCAL_LLM_URL / COMPENDIUM_LOCAL_LLM_MODEL into ~/.cursor/mcp.json (--project for .cursor/mcp.json). Reload MCP and call {"action":"llm_status"} — reachable: true means smart actions will report backend: "local_llm".
Any OpenAI-compatible loopback server works (llama.cpp, Lemonade, …): set the two env vars yourself. Remote hosts are rejected on purpose.
Related MCP server: claw-tsaver
Actions
| Use it for | Main fields |
| Strip ANSI/boilerplate, collapse whitespace, keep/drop regex lines |
|
| Domain-aware scrub of cargo / npm / docker / git / kubectl output |
|
| Dense rewrite of bulky text, code, or JSON |
|
| Outline / conversation / file-tree summary |
|
| Local-model summary (heuristic fallback) |
|
| Keep only lines relevant to a question (local model or BM25) |
|
| Redact secrets, neutralize prompt-injection phrases |
|
| BM25-rank candidates for a query |
|
| Split a huge corpus into |
|
| Park a blob outside the prompt under a short key |
|
| Measure size |
|
| Session savings per action |
|
| Is the local model configured and reachable? |
|
| List actions, or fields + example for one action |
|
Every response is { "ok": true, "action": "filter", "result_json": "{…}" } — parse result_json for the action payload. Add "sanitize_input": true to any text action to scrub secrets first. compress / summarize leave inputs under 1000 characters untouched unless force: true.
Example:
{
"action": "filter",
"text": "…noisy log…",
"filter": { "strip_ansi": true, "keep_patterns": ["ERROR|WARN"] }
}More samples in examples/. Unsure which action fits? Call {"action":"help"}.
Environment
All optional.
Variable | Default | Meaning |
| (unset) | OpenAI-compatible loopback base URL; enables smart actions |
|
| Model id on that server |
| (unset) | Bearer token for locked loopback servers |
|
| HTTP timeout (first model load can be slow) |
|
|
|
|
| Soft output cap for compress/summarize |
|
| Bypass compress/summarize below this length ( |
|
| Heuristic token estimate |
|
| BPE encoding when built with |
| (unset) | npm launcher: use this binary instead of downloading |
|
| Logs go to stderr only |
Build from source
cargo build --release # heuristic token counts
cargo build --release --features real-tokens # exact BPE counts via tiktoken
cargo testPoint your MCP config at target/release/compendium directly, or keep npx and set COMPENDIUM_BINARY.
Design
Deterministic by default. Heuristic paths need no network and produce byte-identical output, which keeps prompt prefix caches warm.
Local-first. Smart actions only ever call a loopback URL; there is no cloud path.
stdout is JSON-RPC. All logging goes to stderr.
Community
Contributing · Changelog · Architecture · Security · Support · Code of Conduct
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
The MCP gateway with an EU-hosted, persistent memory layer that shrinks your token bill.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that optimizes token usage by caching data during language model interactions, compatible with any language model and MCP client.42ISC
- AlicenseAqualityDmaintenanceAn MCP server that helps AI agents reduce token usage by compressing, summarizing, and managing conversation/context data more efficiently.11MIT
- FlicenseAqualityDmaintenanceA fully offline MCP server for token estimation, prompt compression, model routing, and semantic caching to optimize LLM usage costs and efficiency.9-
- AlicenseBqualityDmaintenanceLocal MCP server for token optimization, providing tools to compress code/JSON, optimize prompts, and manage placeholder-based content redaction and hydration to reduce LLM token usage.5ISC