MCPcopy Index your code
hub / github.com/chopratejas/headroom-zed

github.com/chopratejas/headroom-zed @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
3 symbols 3 edges 1 files 1 documented · 33% updated 3mo ago★ 382 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Headroom for Zed

Context compression for Zed's AI agent. Same answers, fraction of the tokens.

What it does

This extension registers Headroom as an MCP context server in Zed, giving the AI agent three tools:

Tool What it does
headroom_compress Compress large content (files, JSON, logs, search results) on demand
headroom_retrieve Retrieve original uncompressed content by hash
headroom_stats Show session stats: tokens saved, cost saved, recent events

Setup

1. Install Headroom

pip install "headroom-ai[mcp]"

2. Install the extension

In Zed: Extensions → search HeadroomInstall

That's it. Zed's agent now has access to compression tools.

3. (Optional) Automatic compression for all traffic

The MCP tools above are on-demand — the agent calls them when it wants to compress. For automatic compression of every LLM request, start the Headroom proxy:

headroom proxy

Then add to your Zed settings (settings.json):

{
  "language_models": {
    "openai": {
      "api_url": "http://localhost:8787/v1"
    }
  }
}

Now every request is automatically compressed — 50-90% fewer tokens, same quality. The MCP tools and proxy work independently or together.

How it works

The extension tells Zed to run headroom mcp serve as a background process. This starts Headroom's MCP server, which exposes the compression tools over the Model Context Protocol. Zed's agent can then call these tools like any other MCP tool.

Compression uses Headroom's full pipeline: SmartCrusher for JSON, CodeCompressor for code, Kompress for text (with [ml] extra). Originals are stored locally for the session and retrievable on demand — nothing is lost.

Requirements

  • Headroompip install "headroom-ai[mcp]"
  • Python 3.10+
  • headroom command in PATH

License

Apache License 2.0

Core symbols most depended-on inside this repo

new
called by 0
src/lib.rs
context_server_command
called by 0
src/lib.rs

Shape

Method 2
Class 1

Languages

Rust100%

Modules by API surface

src/lib.rs3 symbols

For agents

$ claude mcp add headroom-zed \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page