Densely: Open-Source MCP for Lossless Context Compression
No_Advertising2536 · reddit · 2026-08-11
A developer open-sourced 'densely', an MCP server tackling the issue of agent contexts filling up with stale tool outputs. It provides lossless context compression, saving 2-8x tokens.
Core Features:
- Compress: Converts large logs/JSON into dense payloads with plain-text sidecars.
- Search: Runs regex server-side on compressed payloads, returning only matching lines to the model.
- Expand: Exact line-range retrieval, byte-identical and SHA256-verified.
Technical Highlights:
It uses lzma compression and re-encodes bytes into words that cost exactly one token in the target tokenizer. Since Anthropic's vocabulary isn't public, the author empirically harvested a Claude-native alphabet via the counttokens endpoint. A 172KB log achieved 72.2% token savings with prediction errors under 0.1%.
Related event: Open-Source Tool 'densely' Losslessly Compresses LLM Context(2 posts)→
More from coding & agent
- Developer Jokes About Becoming Claude's QA: The Reality of AI Pair Programming — dejavucoder · 2026-08-11
- DeepDoc: Open-Source AI Tool for Deep Research on Local Documents — tom_doerr · 2026-08-11
- Paper Proposes CEAA: Cognitive Architecture for Embodied Virtual Agents — Aimilios Hadjiliasi · 2026-08-11
- Beyond Pipelines: Exploring Multi-Agent Shared Chat Architectures — ronin4001 · 2026-08-11
- mgrep: A CLI-native Multimodal Semantic Search Tool Hits 4.3k Stars on GitHub — tom_doerr · 2026-08-11
- DeepSeek-V4-Flash in Action: Acting as an Autonomous Linux Sysadmin — breksyt · 2026-08-11