A
程序员努力
AI导航AI编程实战PromptMCP市场Skills市场

程序员努力

AI 编程资源库 - 聚合 AI 编程教程、提示词、MCP 与 Skills 资源

内容栏目

  • AI导航
  • AI编程实战
  • Prompt
  • MCP市场
  • Skills市场
  • 全站搜索

教程分类

  • 进阶技巧
  • 入门指南
  • 最佳实践
  • Claude Code
  • Cline教程
  • GitHub Copilot
  • Cursor教程
  • 提示词工程

关于

  • 关于我们
  • GitHub

© 2026 程序员努力. All rights reserved.

← 返回MCP市场
h

headroom

社区使用中

by headroomlabs-ai

Headroom 是一个面向 AI Agent 的上下文压缩层,可在内容到达 LLM 之前压缩工具输出、日志、文件、RAG 块及对话历史,在保持答案质量的前提下显著减少 token 消耗(JSON 数据可减少 60-95%,编码 Agent 减少 15-20%)。它以 Python/TypeScript 库、代理服务器、MCP server 及命令行包装器等多种形式提供,支持

AI/MLStdio(本地命令行)Python

安装配置

将以下配置添加到你的 AI 编程助手中

预览配置(粘贴到 claude_desktop_config.json 或 Cursor 设置中)

{
  "mcpServers": {
    "headroom": {}
  }
}

启动命令

npm install headroom-ai # TypeScript SDK only — no

JSON配置

{}

描述

<div align="center"><pre> ██╗ ██╗███████╗ █████╗ ██████╗ ██████╗ ██████╗ ██████╗ ███╗ ███╗ ██║ ██║██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔═══██╗██╔═══██╗████╗ ████║ ███████║█████╗ ███████║██║ ██║██████╔╝██║ ██║██║ ██║██╔████╔██║ ██╔══██║██╔══╝ ██╔══██║██║ ██║██╔══██╗██║ ██║██║ ██║██║╚██╔╝██║ ██║ ██║███████╗██║ ██║██████╔╝██║ ██║╚██████╔╝╚██████╔╝██║ ╚═╝ ██║ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ The context compression layer for AI agents </pre></div> <p align="center"><strong>60–95% fewer tokens (for JSON data), 15-20% fewer tokens (for coding agents) · library · proxy · MCP · content-aware compressors · local-first · reversible</strong></p> <p align="center"> <a href="https://github.com/chopratejas/headroom/actions/workflows/ci.yml"><img src="https://github.com/chopratejas/headroom/actions/workflows/ci.yml/badge.svg" alt="CI"></a> <a href="https://app.codecov.io/gh/chopratejas/headroom"><img src="https://codecov.io/gh/chopratejas/headroom/graph/badge.svg" alt="codecov"></a> <a href="https://pypi.org/project/headroom-ai/"><img src="https://img.shields.io/pypi/v/headroom-ai.svg" alt="PyPI"></a> <a href="https://www.npmjs.com/package/headroom-ai"><img src="https://img.shields.io/npm/v/headroom-ai.svg" alt="npm"></a> <a href="https://huggingface.co/chopratejas/kompress-v2-base"><img src="https://img.shields.io/badge/model-Kompress--v2--base-yellow.svg" alt="Model: Kompress-v2-base"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License: Apache 2.0"></a> <a href="https://headroom-docs.vercel.app/docs"><img src="https://img.shields.io/badge/docs-online-blue.svg" alt="Docs"></a> </p> <!-- mcp-name: io.github.headroomlabs-ai/headroom --> <p align="center"> <a href="https://headroom-docs.vercel.app/docs">Docs</a> · <a href="#get-started-60-seconds">Install</a> · <a href="#proof">Proof</a> · <a href="#agent-compatibility-matrix">Agents</a> · <a href="https://discord.gg/yRmaUNpsPJ">Discord</a> · <a href="llms.txt">llms.txt</a> </p> <p align="center"><sub> <b>AI agents / LLMs:</b> read <a href="llms.txt"><code>/llms.txt</code></a> here, or fetch <a href="https://headroom-docs.vercel.app/llms.txt">the live index</a> / <a href="https://headroom-docs.vercel.app/llms-full.txt">full docs blob</a>. </sub></p>
<p align="center"><a href="https://trendshift.io/repositories/20881" target="_blank"><img src="https://trendshift.io/api/badge/repositories/20881" alt="chopratejas%2Fheadroom | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a></p>

Headroom compresses everything your AI agent reads — tool outputs, logs, RAG chunks, files, and conversation history — before it reaches the LLM. Same answers, fraction of the tokens.

<p align="center"> <img src="HeadroomDemo-Fast.gif" alt="Headroom in action" width="820"> <br/><sub>Live: 10,144 → 1,260 tokens — same FATAL found.</sub> </p>

What it does

  • Library — compress(messages) in Python or TypeScript, inline in any app
  • Proxy — headroom proxy --port 8787, zero code changes, any language
  • Agent wrap — headroom wrap claude|codex|grok|copilot|cursor|aider|opencode|cline|continue|goose|openhands|openclaw|vibe|omp|zcode in one command; undo with headroom unwrap <tool>
  • MCP server — headroom_compress, headroom_retrieve, headroom_stats for any MCP client
  • Cross-agent memory — shared store across Claude, Codex, Gemini, Grok, auto-dedup
  • headroom learn — mines failed sessions, writes corrections to CLAUDE.local.md (default, gitignored) or CLAUDE.md / AGENTS.md / GEMINI.md / GROK.md
  • Output token reduction — trims what the model writes back (not just what you send): drops ceremony/restated code and skips deep "thinking" on routine steps. See Output token reduction.
  • Reversible (CCR) — originals are cached for retrieval on demand

How it works (30 seconds)

 Your agent / app
   (Claude Code, Cursor, Codex, LangChain, Agno, Strands, your own code…)
        │   prompts · tool outputs · logs · RAG results · files
        ▼
    ┌────────────────────────────────────────────────────┐
    │  Headroom   (runs locally — your data stays here)  │
    │  ────────────────────────────────────────────────  │
    │  CacheAligner  →  ContentRouter  →  CCR            │
    │                    ├─ SmartCrusher   (JSON)        │
    │                    ├─ CodeCompressor (AST)         │
    │                    └─ Kompress-v2-base (text, HF)  │
    │                                                    │
    │  Cross-agent memory  ·  headroom learn  ·  MCP     │
    └────────────────────────────────────────────────────┘
        │   compressed prompt  +  retrieval tool
        ▼
 LLM provider  (Anthropic · OpenAI · Bedrock · …)
  • ContentRouter — detects content type, selects the ri…

统计信息

66k

星标

5.1k

Fork

Python

语言

2026/8/16

更新

Apache-2.0

开源协议

标签

上下文压缩Token优化MCPAI AgentRAGClaude

链接

主页GitHubApache-2.0

相关服务器

p

private-gpt

PrivateGPT 是一个开源 API 层,将本地模型转化为生产级 AI 应用,提供 RAG、工具调用、MCP 连接器、text-to-sql 等能力。它本身不运行模型,而是通过 OpenAI 兼容接口连接 Ollama、vLLM 等推理服务器,并遵循 Claude API 规范,适合构建私有化、本地部署的 AI 产品。

AI/MLStdio57k
S

SurfSense

SurfSense 是一款开源的 NotebookLM 替代品,专为 AI agents 设计,提供开放网络研究平台。它通过统一的 REST API 或 MCP server 连接 Reddit、YouTube、Instagram、Google Search 等实时数据源,返回结构化 JSON 数据,并内置知识库、引用检索与自动化报告功能。项目支持自托管,适合需要实时网络数据与

AI/MLStdio16k
h

hexstrike-ai

HexStrike AI MCP Agents 是一个基于 MCP 协议的高级网络安全自动化平台,允许 Claude、GPT、Copilot 等 AI 代理自主调用 150+ 安全工具,实现自动化渗透测试、漏洞发现、漏洞赏金和 CTF 挑战。其多智能体架构包含智能决策引擎、12+ 专业 AI Agent 及实时可视化面板,显著提升安全研究的效率与智能化水平。

开发工具Stdio11k
m

mcp-toolbox

MCP Toolbox for Databases 是一个开源的 Model Context Protocol (MCP) server,用于将 AI agents、IDE 和应用程序直接连接到企业级数据库。它提供开箱即用的预构建工具(如 list_tables、execute_sql)用于数据探索,同时也是一个自定义工具框架,支持构建安全的生产级 AI 工具,包括结构化查询、

数据库Stdio16k