Lossless compression proxy in front of MCP tool servers that forwards the original unchanged unless exact decoding is proven. Case study
Details
MCP, the Model Context Protocol, is the standard that connects tools to AI agents. terse is a proxy that sits in front of MCP tool servers and compresses what they return without losing anything. If it cannot prove that a compressed payload rebuilds the original exactly, it forwards the original unchanged. On nine GitHub API payloads, its best case, the compressed form uses 59% fewer tokens. A replay of my own Claude Code sessions, priced at what each call was billed, found it removes 23% of what MCP results cost, under 1% of a session’s bill, almost all of it from two tools in long sessions. The project is public under the MIT license, and the repository includes a benchmark harness so you can measure the saving on your own tools.
src/terse/ the codec, proxy and policy
scripts/bench/ the TOON comparison in this page
tests/ 73 test files
corpus/ pinned benchmark payloads
BENCHMARKS.md every figure, dated
VERIFY.md how to check the claims
Generated automatically from the repository. Browse it.