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:

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)→

Original post →

More from coding & agent

coding & agent channel →