LeanRigor MCP Server
LeanRigor
更少的上下文。完整的工程严谨性。
一个本地优先、跨智能体的工程框架。LeanRigor 在保留任务风险等级实际所需的设计、测试、安全和验证关卡的同时,移除了编码智能体会话中不必要的上下文。
npx leanrigor init契约
这是在看数字之前需要阅读的部分。
必要的工程关卡绝不会为了节省 token 而被移除。 验证在每个风险等级都是强制性的;关键任务不能因任何原因(包括 token 预算)跳过其威胁模型、审批或回滚计划。
节省只计入通过的工作。 通过产生错误答案而实现的缩减不算缩减,并且被排除在所有总计之外。
每个数字都说明其测量模式和覆盖范围。 本地估计绝不会被称为提供商使用量,两种测量模式也绝不会被加在一起形成一个未标记的总计。
没有任何东西被销毁。 每个投影都带有一个可以恢复原始字节的句柄,或者被明确标记为仅摘要。
遥测默认关闭,并且
leanrigor telemetry inspect会在你决定之前打印确切的载荷。能耗数据是版本化的估计范围,而非数据中心测量值。请参阅 docs/environmental-methodology.md。
Related MCP server: mcp-guardian
测量结果
来自 evals/ 中的确定性语料库,可通过一条命令重现:
npx leanrigor benchmark指标 | 值 | 用例数 | 测量方式 |
中位上下文缩减 | 93.3% | 8 个通过 | 仅字节 |
与基线相比的通过率差异 | 0.0 个百分点 | 8 | 确定性验证器 |
完成率 | 100% | 8 | — |
每个用例的详细数据、原始结果以及发布关卡判定均在 docs/benchmarks/ 中。那里的每个百分比都说明了其背后的用例数量和测量模式。
本数据未声称的内容。 这些用例测量的是 LeanRigor 自身的转换对载荷所做的处理——不涉及任何模型。
技能评估
这些技能现已针对真实模型(Codex CLI,gpt-5.5)进行了评估,基线对比带技能,并带有确定性检查:
技能 | 基线 | 带技能 | 提升 | 重复次数 |
高级系统设计 | 2/6 | 6/6 | +66.7 个百分点 | 1 |
产品头脑风暴 | 0/5 | 4/5 | +80.0 个百分点 | 1 |
验证 | 16/20 | 18/20 | +10.0 个百分点 | 4 |
所有三个触发描述都是有边界的:路由器在九个非触发提示中均未选择它们中的任何一个。
引用这些数字时必须附带该警告。 在未更改配置的情况下运行 verification 套件三次,分别产生了 +40、+20 和 −20 个百分点的结果。60 个百分点的波动意味着任何低于大约二十个百分点(n=1)的结果都是噪声,而上面的两个较大结果是单次运行的结果。完整报告(包括在评估框架本身中发现的五个缺陷以及在技能中发现的两个缺陷)位于 docs/benchmarks/skill-eval.md。
它的作用
组件 | 职责 |
MCP 网关 | 向你的主机暴露 4 个工具,而不是 200 个。工具是被搜索的,而非广播的;大型结果存储在本地,并以紧凑的、由句柄支持的投影形式返回。 |
TokenLeaf 引擎 | 按测量模式测量实际节省了多少,并拒绝将失败工作的节省计入。 |
严谨性关卡 | 确定性分类任务风险(无需模型调用),并选择最小且足够的工程关卡集合。 |
已验证的技能 | 三个可移植的智能体技能,带有许可证、来源记录、上下文预算和评估套件。 |
支持的主机
主机 | 状态 |
Claude Code | 已支持 |
Codex | 已支持 |
Gemini CLI | 尚未支持;适配器已计划 |
leanrigor init 会检测已安装的内容,预览每个文件更改,备份其修改的任何内容,并且在你确认之前绝不写入。
命令
npx leanrigor init # install, with a preview and confirmation
npx leanrigor init --dry-run # show the plan, write nothing
npx leanrigor init --uninstall # restore the original files
npx leanrigor doctor # diagnose the installation
npx leanrigor mcp serve # run the gateway (hosts launch this)
npx leanrigor benchmark # run the reproducible benchmark
npx leanrigor report # local session report
npx leanrigor report --share # local SVG card, aggregate counts only
npx leanrigor skills list
npx leanrigor skills install verification
npx leanrigor telemetry status隐私默认设置
无账户。在你启用遥测之前,没有它自己的网络调用。提示、源代码、文件路径、仓库名称和工具载荷永远不会被发送到任何地方,在任何设置下都是如此——账本和遥测模式中没有可以携带它们的字段。请参阅 docs/privacy.md。
卸载
npx leanrigor init --uninstall文件将恢复到其原始字节。唯一留下的是 .leanrigor/ 下的仅追加审计记录。
当前限制
坦率地说,因为一个夸大自身的框架比没有更糟糕:
三个技能提升结果中有两个是 n=1,并且该套件的运行间方差已达到 60 个百分点。在依赖它们之前,请使用
--repeat重新运行。五个
verification用例中有四个没有区分度——基线每次都通过它们,因此它们什么也测量不到。该套件需要更难的用例。尚未进行消融实验。 尚未证明任何技能的任何部分值得其消耗的上下文。
每个技能数字都来自一个 CLI 和一个模型。
基准测试的
gateway+workflow和gateway+workflow+skill条件尚未实现;目前只运行baseline和gateway。风险分类基于正则表达式和路径。它故意保守,会过度分类而非分类不足,但并不聪明。
Codex 适配器会重写
config.toml,这会丢弃 TOML 注释。安装计划会警告这一点,并且原始文件会被备份。尚无 Gemini CLI 适配器。
发布的包捆绑了内部的
@leanrigor/*工作空间;这些 API 不稳定,也未单独发布。
文档
贡献
有边界、可拥有的扩展接口在 docs/extensions/ 中有文档说明:投影器、主机适配器和技能包。每个都有验收契约,因此可以根据明确的标准(而非维护者的情绪)来判断贡献。
许可证
Apache-2.0。第三方声明和重用记录在 THIRD_PARTY_NOTICES.md 中。没有第三方源代码或散文被复制到此仓库中。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Open-source MCP gateway with per-agent tool permissions, call approvals and tool-change review.
MCP gateway with runtime security policy, tool-call-level control, and audit of agent actions.
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
An MCP gateway for teams deploying AI tools at scale to employee-facing and headless agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceLocal-first MCP server that provides project context, verification gates, and structured tools for coding agents to discover knowledge, run diagnostics, and execute allowlisted commands within a repository.MIT
- AlicenseNot gradedqualityDmaintenanceA gateway that enforces permissions, sanitization, approval, and audit for AI agent MCP tool calls, with a policy engine and local proxy CLI.1MIT
- AlicenseNot gradedqualityBmaintenanceA local-first MCP server that lets AI agents use gated APIs without holding keys, enforcing declarative policies, injecting secrets server-side, and auditing access without content.107 npm3Apache 2.0
- AlicenseAqualityDmaintenanceAn MCP server that sits between coding agents and local tools, using a tiny on-device model to route tool calls and requiring confirmations for destructive actions, while only exposing four tools to the host.4MIT