MCP Configs2026年5月13日·1 分钟阅读

lean-ctx — Context Runtime (MCP + Shell Hook)

lean-ctx is a local-first context runtime (MCP + shell hook) that compresses file reads and CLI output to cut token waste for coding agents.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Native · 94/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Mcp
安装
Curl
信任
信任等级:Established
入口
curl -fsSL https://leanctx.com/install.sh | sh
通用 CLI 安装命令
npx tokrepo install a86dee69-dfc9-5674-9c1d-1c39f807e0f6
介绍

lean-ctx 是面向 AI 编码 agent 的本地上下文层:在内容进入模型前压缩文件读取与命令行输出。README 提到可减少 60–95% token,并提供 59 个工具与 10 种读取模式。

Best for: 经常让 AI 跑 git/测试/构建,想显著减少 token 浪费的开发者

Works with: Rust 单文件二进制;MCP 客户端;Cursor/Codex/Claude Code 集成

Setup time: 4-10 minutes

Key facts (verified)

  • GitHub:1611 stars · 165 forks;最近更新 2026-05-13。
  • 许可证:Apache-2.0;作者头像与仓库链接均已通过 GitHub API 复核。
  • README 中核对过的入口命令:curl -fsSL https://leanctx.com/install.sh | sh

Main

  • 先跑 lean-ctx setup + doctor,确认 MCP 与 shell hook 在你的 agent/editor 里真的生效。

  • 按需选择读取模式:map/signatures/diff 等模式能显著省 token,同时保留重构所需的关键信息。

  • 跨容器/多工作区共享仓库时,按 README 建议用 .lean-ctx-id 区分项目,避免缓存/上下文串库。

Source-backed notes

  • README 标题区写明:可减少 60–95% token(缓存读取最高到 99%),并列出 59 tools / 10 read modes。
  • README 给出 60 秒上手流程:安装 → lean-ctx setuplean-ctx doctorlean-ctx gain --live
  • README 提供兼容矩阵,并给出按 agent 初始化的命令,如 lean-ctx init --agent codex / ... --agent claude

FAQ

  • 它只是 MCP server 吗?:不止。README 说明它同时包含 MCP server 与压缩命令行输出的 shell hook。
  • 能不能快速停用?:可以。README 的 Troubleshooting 区域给了当前 shell 立即停用命令 lean-ctx-off
  • 新手怎么安全开始?:先在日常开发中开 gain --live 观察节省效果,再逐步引入不同读取模式。
🙏

来源与感谢

Source: https://github.com/yvgude/lean-ctx > License: Apache-2.0 > GitHub stars: 1611 · forks: 165

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产