Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
fix: use stable cli entrypoint for mcp command resolution
Om Thorat2c9b072e81f1
diff --git a/headroom/cli/mcp.py b/headroom/cli/mcp.pyindex abdd57a1a..44d466e17 100644--- a/headroom/cli/mcp.py+++ b/headroom/cli/mcp.py@@ -8,7 +8,6 @@ needing API key access.import jsonimport shutilimport subprocess-import sysfrom pathlib import Pathfrom typing import Any@@ -25,15 +24,9 @@ DEFAULT_PROXY_URL = "http://127.0.0.1:8787"def get_headroom_command() -> list[str]:"""Get the command to run headroom MCP server.- Returns the most reliable way to invoke headroom based on installation.+ Returns the CLI invocation used by Claude Code config."""- # Check if headroom is in PATH- headroom_path = shutil.which("headroom")- if headroom_path:- return ["headroom", "mcp", "serve"]-- # Fall back to python -m- return [sys.executable, "-m", "headroom.ccr.mcp_server"]+ return ["headroom", "mcp", "serve"]def load_mcp_config() -> dict[str, Any]: