Compendium
Allows using a local Ollama model for smarter summarization and query-aware filtering, falling back to heuristics when Ollama is unavailable.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Compendiumcompress this big log file down before I read it"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Compendium
MCP server that minimizes LLM token usage by compressing, summarizing, filtering, and chunk-referencing large context before it reaches the model.
Built in Rust with the official rmcp SDK.
Quick start (Cursor)
You need Node.js 18+. Compendium itself arrives via npm — no Rust install required.
1. Add the MCP server
Open Cursor MCP settings (~/.cursor/mcp.json or the project .cursor/mcp.json) and add:
{
"mcpServers": {
"compendium": {
"command": "npx",
"args": ["-y", "compendium-mcp"]
}
}
}Restart MCP / reload Cursor. You should see one tool named compendium.
That alone is enough: filter, compress, summarize, cache, and BM25 actions all work without a local model (fast heuristics).
2. (Optional) Smarter summaries with Ollama
Want better summarize_smart / filter_relevant? Run a small model on your machine and point Compendium at it.
Install Ollama and start it (default:
http://127.0.0.1:11434).Pull a chat model, for example:
ollama pull qwen:latest
# or a smaller one: ollama pull qwen2.5:3bExtend the MCP
envblock (URL must stay on localhost — Compendium blocks remote hosts on purpose):
{
"mcpServers": {
"compendium": {
"command": "npx",
"args": ["-y", "compendium-mcp"],
"env": {
"COMPENDIUM_LOCAL_LLM_URL": "http://127.0.0.1:11434/v1",
"COMPENDIUM_LOCAL_LLM_MODEL": "qwen:latest"
}
}
}
}Reload MCP, then ask the agent to call
compendiumwithaction: "summarize_smart".
In the result,"backend": "local_llm"means Ollama answered;"heuristic"means it fell back (Ollama down, wrong model name, or URL missing).
Notes
Package name on npm is
compendium-mcp(compendiumwas already taken). The CLI binary name is stillcompendium.First Ollama reply can be slow while the model loads; later calls are faster.
Other local OpenAI-compatible servers work the same way (e.g. Lemonade
http://127.0.0.1:13305/api/v1). See Environment.
Smoke-check from a terminal (any folder except this git repo root is fine):
npx -y compendium-mcp --helpBinary packaging details for maintainers: npm/DISTRIBUTION.md.
Related MCP server: claw-tsaver
Community
Transports
Mode | Command | Notes |
stdio (default) |
| Cursor / Claude Desktop |
Streamable HTTP/SSE |
| Requires |
Default HTTP bind: 127.0.0.1:8788 (override with arg or COMPENDIUM_HTTP_BIND).
Tools
Single MCP tool: compendium. Choose the operation with action:
| Purpose | Main fields |
| Strip ANSI, boilerplate, whitespace; densify JSON; keep/drop regexes |
|
| Dense representation of text/code/logs |
|
| Domain-aware stdout/stderr scrub (git, cargo, npm, docker, …) |
|
| Hierarchical summary (conversation / file tree / outline) |
|
| Local-SLM dense summary (heuristic fallback if unset/fails) |
|
| Query-aware keep of relevant lines (local SLM + heuristic fallback) |
|
| Drop filler / compress older chat turns |
|
| Split into |
|
| Fetch chunk content by id |
|
| Measure tokens |
|
| Session savings + latency/bypass/backend telemetry |
|
| Park bulky payload outside the prompt |
|
| Retrieve by key |
|
| Drop one key or clear cache |
|
| Redact secrets + neutralize IPI phrases |
|
| BM25-rank candidates / chunks for a query |
|
Optional on most text actions: sanitize_input: true scrubs before processing. Soft payloads under COMPENDIUM_SIGNAL_MIN_CHARS (default 1000) bypass compress / summarize / summarize_smart unless force: true.
filter accepts optional query (top-level or filter.query) for BM25 line keep. prune_history supports prune.strategy: "afm" (Critical / Thematic / Distant tiers; distant blob cached for cache_get).
Example:
{
"action": "filter",
"text": "…noisy log…",
"filter": { "strip_ansi": true, "keep_patterns": ["ERROR|WARN"] }
}Response envelope: { "ok": true, "action": "filter", "result_json": "{...}" }. Parse result_json as JSON for the action-specific payload.
Project layout
package.json / bin/run.js # npm wrapper for npx compendium-mcp
npm/ # platform packages + distribution docs
.github/workflows/ # release cross-compile + npm publish
src/
main.rs # CLI: stdio | http
lib.rs
config.rs # COMPENDIUM_* env config
server.rs # MCP tool handlers (rmcp macros)
http.rs # Streamable HTTP/SSE (feature = "http")
pipeline/
tokens.rs # heuristic or tiktoken BPE (feature = "real-tokens")
filter.rs
compress.rs
summarize.rs
smart.rs # summarize_smart + filter_relevant
local_llm.rs # OpenAI-compatible local SLM client
chunk.rs # chunk + resolve
cache.rs # session key/value cache
stats.rs # session savings counters
prune.rs # conversation history pruning
output.rs # domain-aware compress_output
tests/
integration.rs
e2e_smoke.rs # spawns binary, MCP handshake, all toolsBuild
# Default: heuristic tokens + stdio only
cargo build --release
# Exact BPE token counts (tiktoken-rs)
cargo build --release --features real-tokens
# Streamable HTTP transport
cargo build --release --features http
# Everything
cargo build --release --features real-tokens,httpBinary: target/release/compendium
Configure (advanced)
The Quick start config is enough for most people. Extra options:
Claude Desktop
Same command / args / env as Cursor, in Claude’s MCP config file.
Optional tuning env
"env": {
"RUST_LOG": "compendium=info",
"COMPENDIUM_DEFAULT_MAX_TOKENS": "2048",
"COMPENDIUM_TOKENIZER": "cl100k_base",
"COMPENDIUM_LOCAL_LLM_URL": "http://127.0.0.1:11434/v1",
"COMPENDIUM_LOCAL_LLM_MODEL": "qwen:latest"
}Local Cargo binary (developers)
{
"mcpServers": {
"compendium": {
"command": "/absolute/path/to/Compendium/target/release/compendium",
"env": {
"RUST_LOG": "compendium=info",
"COMPENDIUM_DEFAULT_MAX_TOKENS": "2048"
}
}
}
}Remote / sidecar (HTTP)
cargo run --features http -- http 127.0.0.1:8788
# MCP endpoint: http://127.0.0.1:8788/mcpPoint an MCP streamable-HTTP client at that URL (e.g. StreamableHttpClientTransport::from_uri).
Environment
Variable | Default | Meaning |
|
| Heuristic chars÷tokens (ignored with |
|
| BPE encoding: |
|
| Soft cap for compress |
|
| Blank-line collapse limit |
|
| Jaccard line-dedupe threshold |
|
| Default HTTP listen address |
| (unset) | OpenAI-compatible base URL (e.g. |
|
| Model id on that server (Ollama: e.g. |
| (unset) | Optional bearer token for locked loopback servers |
|
| HTTP timeout (first model load can be slow) |
|
| Bypass compress/summarize below this length ( |
|
| Logs on stderr only |
Example tool calls
Filter noisy terminal output
{
"name": "compendium_filter",
"arguments": {
"text": "\u001b[31mERROR\u001b[0m boom\n\n\nINFO ok",
"options": {
"strip_ansi": true,
"keep_patterns": ["ERROR|WARN"]
}
}
}Compress a large log
{
"name": "compendium_compress",
"arguments": {
"text": "...",
"options": {
"content_type": "log",
"max_tokens": 512
}
}
}Chunk a document into references
{
"name": "compendium_chunk",
"arguments": {
"text": "... huge file ...",
"options": {
"source": "file:///path/to/doc.md",
"chunk_tokens": 400,
"overlap_tokens": 40
}
}
}Prefer the returned index_text in the model context; pull individual chunk contents by id only when needed.
Query-aware filter (local SLM or heuristic fallback)
{
"action": "filter_relevant",
"text": "... noisy cargo/test log ...",
"query": "why did the auth tests fail",
"smart": { "max_tokens": 512, "fallback": true }
}Without COMPENDIUM_LOCAL_LLM_URL, summarize_smart / filter_relevant automatically use heuristics and set backend: "heuristic" plus fallback_reason in the result.
Local small language model
Follow Quick start §2 for Ollama.
Rules of thumb:
Only loopback URLs (
127.0.0.1,::1,localhost) — no cloud endpoints.Without
COMPENDIUM_LOCAL_LLM_URL, smart actions use heuristics and setbackend: "heuristic".Calls use
temperature=0andseed=0for stable outputs.Lemonade example:
COMPENDIUM_LOCAL_LLM_URL=http://127.0.0.1:13305/api/v1andCOMPENDIUM_LOCAL_LLM_MODEL=Qwen3-4B-GGUF.llama.cpp OpenAI server: same pattern — set URL to its
/v1base and the served model id.
Develop / test
cargo test
cargo test --features real-tokens
cargo test --features http --test http_smoke
cargo test --test e2e_smoke
cargo run --features http -- http 127.0.0.1:8788e2e_smoke spawns CARGO_BIN_EXE_compendium, completes the MCP initialize handshake over stdio, lists tools, then calls gateway actions. http_smoke (requires --features http) exercises streamable HTTP in-process.
Design notes
Deterministic by default — heuristic pipeline needs no network; smart actions only call a configured local OpenAI-compatible URL and fall back to heuristics when unset or failing.
Token backends — fast heuristic by default; opt into exact BPE with
real-tokens.Zero stdout pollution (stdio mode) — tracing goes to stderr so JSON-RPC framing stays clean.
Release profile — LTO + stripped binary for low footprint.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that optimizes token usage by caching data during language model interactions, compatible with any language model and MCP client.Last updated42
- AlicenseAqualityBmaintenanceAn MCP server that helps AI agents reduce token usage by compressing, summarizing, and managing conversation/context data more efficiently.Last updated11MIT
- FlicenseAqualityDmaintenanceA fully offline MCP server for token estimation, prompt compression, model routing, and semantic caching to optimize LLM usage costs and efficiency.Last updated9
- FlicenseBqualityCmaintenanceLocal 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.Last updated5
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/hocestnonsatis/Compendium'
If you have feedback or need assistance with the MCP directory API, please join our Discord server