ContextCrumb
LLM context gets messy fast: meeting notes, logs, issue threads, docs, transcripts, and tool descriptions all pile up until the useful signal is buried under filler.
ContextCrumb is a token-level compressor for LLM and agent workflows. It looks at text word by word and removes low-signal tokens while keeping the surviving text in the original order.
That is the idea behind the name: the context is still there, but the loose crumbs are shaken off before they reach your model. Less bloat in the prompt. More room for the parts that matter.
ContextCrumb is not a summarizer. It does not rewrite your document into a new explanation. It keeps the source sequence and deletes expendable words.
Original
ContextCrumb is designed for coding agents, MCP tools, and prompt pipelines that need to read a large local text file before sending it to an LLM. It prints only the compressed text by default, so an agent can capture stdout and use it as shortened context.Compressed
ContextCrumb designed coding agents, MCP tools, prompt pipelines need read large local text file before sending LLM. Prints compressed text default, agent capture stdout use shortened context.Same order. Less padding. More room for the next file.
Why ContextCrumb?
Use case | What changes |
Agent file loading | Read long notes, docs, transcripts, and logs before they hit the context window. |
Prompt pipelines | Shrink natural-language inputs without hand-writing summarizers. |
MCP catalogs | Compress verbose tool/resource descriptions while preserving names and schemas. |
Local workflows | Run ONNX inference by default, with cached model files after first download. |
Trust-building | Use |
Best fit: docs, notes, transcripts, issue threads, logs, research context, and other natural-language files. For source code where exact syntax matters, prefer raw file loading or use a conservative keep ratio.
pip install contextcrumbOptional extras:
pip install "contextcrumb[mcp]"
pip install "contextcrumb[serve]"
pip install "contextcrumb[torch]"ContextCrumb uses the ONNX backend by default, so normal users do not need PyTorch or Transformers installed. Model files are cached locally after the first download.
from contextcrumb import ContextCompressor
compressor = ContextCompressor()
result = compressor.compress(
"ContextCrumb deletes low-value words while preserving useful context.",
)
print(result.text)
print(result.stats)Read and compress a file:
from contextcrumb import ContextCompressor
compressor = ContextCompressor()
result = compressor.compress_file("notes.txt")
print(result.text)
print(result.stats["token_keep_ratio"])The main agent-friendly command is load:
contextcrumb load notes.txtIt prints only compressed text by default, which makes it easy for agents, hooks, shell scripts, and prompt pipelines to capture stdout and move on.
Useful commands:
contextcrumb load notes.txt --json
contextcrumb diff notes.txt
contextcrumb inspect notes.txt
contextcrumb statsdiff marks deleted tokens like this:
kept words [-deleted words-] kept wordsContextCrumb includes an optional MCP stdio adapter for agent clients that can run Python tools through uvx.
pip install "contextcrumb[mcp]"Published-package MCP config:
{
"mcpServers": {
"contextcrumb": {
"command": "uvx",
"args": [
"--from",
"contextcrumb[mcp]",
"contextcrumb-mcp"
]
}
}
}The MCP server exposes:
compress_text
compress_fileContextCrumb also ships contextcrumb-shrink, an MCP proxy that compresses verbose catalog descriptions before an agent sees them while forwarding tool names, schemas, calls, results, and resource contents unchanged.
Model weights and a hosted demo are public on Hugging Face:
Model: ymao20/contextcrumb-32m
Playground: contextcrumb-32m-demo
Roadmap
Planned for later:
Public docs for advanced compression modes and service deployment.
JavaScript or TypeScript client.
Hosted API experiments.
npm publishing.
Development
uv pip install --python .\.venv\Scripts\python.exe -e ".[dev,mcp]"
.\.venv\Scripts\python.exe -m pytest
.\.venv\Scripts\python.exe -m buildRelease notes are tracked in CHANGELOG.md.
License
Apache-2.0. See LICENSE.
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.
Latest Blog Posts
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/Yuchen20/Context-Crumb'
If you have feedback or need assistance with the MCP directory API, please join our Discord server