LeanRigor MCP Server
A local-first MCP gateway that reduces context overhead in coding-agent sessions by exposing only relevant tools and enforcing task-appropriate engineering gates, with privacy-first defaults and no network calls until explicitly enabled.
README
LeanRigor
Less context. Full engineering rigor.
A local-first, cross-agent engineering harness. LeanRigor removes unnecessary context from coding-agent sessions while preserving the design, test, security and verification gates the task's risk level actually requires.
npx leanrigor init
The contract
This is the part to read before the numbers.
- Required engineering gates are never removed to save tokens. Verification is mandatory at every risk level; a critical task cannot skip its threat model, approval or rollback plan for any reason, including a token budget.
- Savings count only for work that passed. A reduction achieved by producing a wrong answer is not a reduction, and it is excluded from every total.
- Every number states its measurement mode and coverage. A local estimate is never called provider usage, and two measurement modes are never added together into an unlabelled total.
- Nothing is destroyed. Every projection carries a handle that restores the original bytes, or is explicitly marked summary-only.
- Telemetry is off by default, and
leanrigor telemetry inspectprints the exact payload before you decide. - Energy figures are versioned estimate ranges, never datacenter measurements. See docs/environmental-methodology.md.
Measured result
From the deterministic corpus in evals/, reproducible with one command:
npx leanrigor benchmark
| Metric | Value | Cases | Measurement |
|---|---|---|---|
| Median context reduction | 93.3% | 8 passing | byte-only |
| Pass-rate delta vs baseline | 0.0 points | 8 | deterministic verifier |
| Completion rate | 100% | 8 | — |
Per-case figures, the raw result and the release-gate verdict are in docs/benchmarks/. Every percentage there states the case count and the measurement mode behind it.
What this does not claim. These cases measure what LeanRigor's own transformations do to a payload — no model is involved.
Skill evaluation
The skills have now been evaluated against a real model (Codex CLI, gpt-5.5),
baseline versus with-skill, with deterministic checks:
| Skill | Baseline | With skill | Uplift | Reps |
|---|---|---|---|---|
| senior-system-design | 2/6 | 6/6 | +66.7 points | 1 |
| product-brainstorming | 0/5 | 4/5 | +80.0 points | 1 |
| verification | 16/20 | 18/20 | +10.0 points | 4 |
All three trigger descriptions are bounded: the router selected none of them on any of the nine non-trigger prompts.
Do not quote those numbers without the caveat. Running the verification
suite three times on an unchanged configuration produced +40, +20 and −20
points. A 60-point swing means anything below roughly twenty points at n=1 is
noise, and the two large results above are single runs. Full write-up, including
the five defects found in the evaluation harness itself and the two found in the
skills, is in docs/benchmarks/skill-eval.md.
What it does
| Piece | Job |
|---|---|
| MCP gateway | Exposes 4 tools to your host instead of 200. Tools are searched, not broadcast; large results are stored locally and returned as a compact, handle-backed projection. |
| TokenLeaf Engine | Measures what was actually saved, per measurement mode, and refuses to count savings from failed work. |
| Rigor Gates | Classifies task risk deterministically — no model call — and selects the smallest sufficient set of engineering gates. |
| Verified Skills | Three portable Agent Skills with licenses, provenance records, context budgets and evaluation suites. |
Supported hosts
| Host | Status |
|---|---|
| Claude Code | supported |
| Codex | supported |
| Gemini CLI | not yet; adapter planned |
leanrigor init detects what is installed, previews every file change, backs
up anything it modifies, and never writes before you confirm.
Commands
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
Privacy defaults
No account. No network call of its own until you enable telemetry. Prompts, source code, file paths, repository names and tool payloads are never sent anywhere, at any setting — the ledger and telemetry schemas have no field that could carry them. See docs/privacy.md.
Uninstall
npx leanrigor init --uninstall
Files are restored to their original bytes. The only thing left behind is an
append-only audit record under .leanrigor/.
Current limitations
Stated plainly, because a harness that overstates itself is worse than none:
- Two of the three skill-uplift results are n=1, and run-to-run variance on
this suite has reached 60 points. Re-run with
--repeatbefore relying on them. - Four of the five
verificationcases do not discriminate — the baseline passes them every time, so they measure nothing. That suite needs harder cases. - Ablation has not been run. No section of any skill has yet been shown to earn the context it costs.
- Every skill number comes from one CLI and one model.
- The benchmark's
gateway+workflowandgateway+workflow+skillconditions are not implemented yet; onlybaselineandgatewayrun today. - Risk classification is regex-and-path based. It is deliberately conservative and will over-classify before it under-classifies, but it is not clever.
- The Codex adapter rewrites
config.toml, which drops TOML comments. The install plan warns about this and the original is backed up. - No Gemini CLI adapter yet.
- The published package bundles the internal
@leanrigor/*workspaces; those APIs are not stable and are not published separately.
Documentation
- Getting started
- Measurement boundaries — what is measured, estimated and unknowable
- Environmental methodology
- Privacy
- Evaluations
- Security policy
- Governance
Contributing
Bounded, ownable extension surfaces are documented in docs/extensions/: projectors, host adapters and skill packs. Each has an acceptance contract, so a contribution can be judged against a stated bar rather than a maintainer's mood.
License
Apache-2.0. Third-party notices, and the reuse ledger, are in THIRD_PARTY_NOTICES.md. No third-party source or prose has been copied into this repository.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。