MartinLoop
Puts budgets, verifier gates and run receipts around coding-agent jobs started from an MCP host
Compresses large tool outputs, logs and files for an assistant on request, keeping the originals retrievable
By Headroom Labs Python Local · stdio AI and MLDeveloper tools
69 popularity score ★ 79k
Opens the app, which asks before it adds the server.
uv tool install "headroom-ai[mcp]"claude mcp add headroom -- headroom mcp serve{
"mcpServers": {
"headroom": {
"command": "headroom",
"args": [
"mcp",
"serve"
]
}
}
}{
"mcpServers": {
"headroom": {
"command": "headroom",
"args": [
"mcp",
"serve"
]
}
}
}{
"servers": {
"headroom": {
"type": "stdio",
"command": "headroom",
"args": [
"mcp",
"serve"
]
}
}
}[mcp_servers.headroom]
command = "headroom"
args = ["mcp", "serve"]gemini mcp add --scope user headroom headroom -- mcp serveHEADROOM_PROXY_URL |
Optional: Proxy address used as the fallback store for headroom_retrieve. The --proxy-url flag sets the same thing. |
|---|---|
HEADROOM_MCP_READ |
Optional: Set to on to add the headroom_read file tool. |
HEADROOM_BEACON |
Optional: Set to off to stop the anonymous usage upload, which is on by default. DO_NOT_TRACK=1 and HEADROOM_TELEMETRY=off also stop it. |
HEADROOM_MCP_MODEL |
Optional: Model name to attach to recorded compression stats, which otherwise show it as unknown. |
HEADROOM_MCP_CLIENT |
Optional: Overrides the client name recorded in session stats. |
Headroom Labs builds Headroom to shrink what a coding agent reads: tool output, logs, JSON, search results and file contents. The package ships several things (a Python and TypeScript library, an OpenAI-compatible proxy, wrappers for agents such as Claude Code and Codex). This page covers the MCP server, which is the `headroom mcp serve` command from the Python package.
The assistant decides when to call it. It hands a large block of text to headroom_compress and gets back a shorter version plus a hash. The original stays in a local store for an hour, so headroom_retrieve can return the full text later if the short one turns out to be missing something. If you also run the proxy, retrieval falls back to the proxy's own store when the hash is not held locally. headroom_stats reports how many tokens the session has saved, including counts from sub-agents that run their own copy of the server.
The source registers a fourth tool the README does not list. Setting HEADROOM_MCP_READ=on adds headroom_read, which reads a file from disk and caches it, then answers repeat reads of an unchanged file with a short marker in place of the whole file. The docs also describe a query option on headroom_retrieve for searching inside an original, but the tool schema in the server source takes only the hash.
| Runtime | Python 3.11+ |
|---|---|
| Runs on | macOS, Windows, Linux |
Install the package with the MCP extra: pip install "headroom-ai[mcp]", or uv tool install "headroom-ai[mcp]" so the headroom command lands on your PATH. Clients such as Codex that do not inherit your shell PATH need the absolute path from command -v headroom. headroom mcp install registers it with Claude Code. Retrieval from the proxy's store needs headroom proxy running separately.
It suits someone running Claude Code, Cursor or Codex on large logs and JSON who wants the agent to shrink content on demand without routing traffic through a proxy. Everything runs locally and the core tools only transform text the assistant hands them, so the main things to weigh are the usage beacon (switch it off with HEADROOM_BEACON=off) and the optional file-reading tool. If you want every request compressed without the assistant choosing to, the makers point to headroom proxy instead. People on Intel Macs or Python older than 3.11 will need Docker or a newer interpreter.
4 only read. A ? marks an optional parameter.
headroom_compresscontent: stringheadroom_retrievehash: stringheadroom_statsheadroom_readfile_path: stringfresh?: boolean