LeanLane
MCP server that keeps AI agents from over-engineering by providing decision ladders, diff scoring, and prune reviews. It helps enforce minimal-code discipline through CLI, SDKs, and MCP tools.
README
LeanLane
Stop AI agents from over-building. Decision ladder, diff scoreboard, prune review, MCP tools, and installable agent skills — local-first, measurable, and safe.
Part of Talocode. Optional cloud routes under /v1/leanlane/*.
| npm | npm install -g @talocode/leanlane |
| PyPI | pip install talocode-leanlane |
| CLI | leanlane |
| MCP | leanlane mcp |
| Cloud | https://api.talocode.site/v1/leanlane/* |
| Auth | TALOCODE_API_KEY (cloud only) |
| Repo | https://github.com/talocode/leanlane |
| License | MIT |
Why LeanLane?
Coding agents often solve a ticket by inventing frameworks: new packages, wrappers, abstractions, and hundreds of lines nobody asked for. That burns tokens, slows reviews, and leaves brittle code.
LeanLane puts a senior “write less” discipline into the loop:
- Decide before writing — climb a fixed ladder (skip → reuse → stdlib → native → installed dep → one-liner → minimum new code).
- Score the diff — LOC, new files, dependencies, abstraction signals, grade A–F.
- Review for over-engineering — delete-list, not vibe comments.
- Rules / skill — always-on agent instructions with modes (
lite/full/ultra/off). - Safety floor — never cut validation, security, accessibility, or understanding for fewer lines.
Open tool people can trust. Hosted power when teams want shared scoreboards and API metering.
Install
npm install -g @talocode/leanlane
# or
npx @talocode/leanlane --help
pip install talocode-leanlane
Quickstart (CLI)
# What should the agent do *before* coding?
leanlane decide --task "add a date picker to the form"
# Score the working tree diff
leanlane score --git
# Review a file for bloat
leanlane review --file src/app.ts
# Export always-on rules into the repo
leanlane rules --mode full --out AGENTS.leanlane.md
# Export SKILL.md for agent hosts
leanlane skill --mode full --out skills/leanlane/SKILL.md
# Default mode for new sessions
leanlane mode set full
# MCP stdio server for agents
leanlane mcp
Example: decide
leanlane decide --task "add a date picker" --mode full
Returns a recommended rung (often native_platform for date pickers), rationale, full ladder, safety floor, and agent instructions.
Example: score a diff
leanlane score --diff "$(git diff HEAD~1)" --mode full
{
"ok": false,
"score": 42,
"grade": "D",
"metrics": {
"filesTouched": 4,
"linesAdded": 280,
"newDependencies": 1,
"newFiles": 2
},
"findings": [ ... ]
}
Exit code 2 when the score fails the mode threshold (useful in CI).
TypeScript SDK
import {
decide,
scoreDiff,
reviewCode,
getRuleset,
createLeanLaneClient,
} from '@talocode/leanlane'
const plan = decide({
task: 'add a date picker',
nativeCandidate: '<input type="date">',
})
const score = scoreDiff({
diff: await Deno.readTextFile('patch.diff'), // or any unified diff string
mode: 'full',
})
const client = createLeanLaneClient() // uses TALOCODE_API_KEY for cloud
await client.health()
Local engine calls need no API key. The client is for optional Talocode Cloud routes.
Python SDK
import os
from leanlane import LeanLaneClient, decide, score_diff
print(decide(task="add a date picker"))
print(score_diff(diff=open("patch.diff").read()))
client = LeanLaneClient(api_key=os.environ.get("TALOCODE_API_KEY"))
print(client.health())
MCP
leanlane mcp
Exposes:
| Tool | Purpose |
|---|---|
leanlane_decide |
Ladder decision before coding |
leanlane_score_diff |
Score unified diffs |
leanlane_review |
Over-engineering review + delete-list |
leanlane_rules |
Mode ruleset markdown |
leanlane_health |
Version + capabilities |
Example host config (stdio):
{
"mcpServers": {
"leanlane": {
"command": "leanlane",
"args": ["mcp"]
}
}
}
Modes
| Mode | Behavior |
|---|---|
off |
No lean pressure |
lite |
Prefer reuse/stdlib; fail only on high/critical bloat |
full |
Default ladder + fail on high findings or weak score |
ultra |
Aggressive minimalism; medium findings fail |
export LEANLANE_MODE=full
# or
leanlane mode set ultra
Safety floor (never cut)
- Input validation at trust boundaries
- Error handling that prevents data loss
- Security-sensitive paths
- Accessibility for user-facing UI
- Understanding the problem before shrinking the diff
- One runnable check for non-trivial logic
Cloud routes (optional)
Base: https://api.talocode.site
| Path | Credits (indicative) |
|---|---|
GET /v1/leanlane/health |
0 |
GET /v1/leanlane/pricing |
0 |
GET /v1/leanlane/capabilities |
0 |
POST /v1/leanlane/decide |
2 |
POST /v1/leanlane/score |
5 |
POST /v1/leanlane/review |
5 |
POST /v1/leanlane/rules |
1 |
GET /v1/leanlane/skill |
1 |
Auth: Authorization: Bearer $TALOCODE_API_KEY or X-Api-Key.
Agent skill
leanlane skill --out skills/leanlane/SKILL.md
Compatible with Codra, Cursor-style skill folders, Claude Code-style skills, and OpenCode-style workflows. Copy into your agent’s skills directory or keep under .agents/skills/leanlane/.
CI gate example
leanlane score --git --mode full || exit 1
Related packages
| Package | Install |
|---|---|
| LeanLane (this) | npm i @talocode/leanlane · pip install talocode-leanlane |
| VerifyLane | npm i @talocode/verifylane · pip install talocode-verifylane |
| PolicyLane | npm i @talocode/policylane |
| StyleLane | npm i @talocode/stylelane |
| EvalLane | npm i @talocode/evallane |
| TraceLane | npm i @talocode/tracelane |
| GateLane | npm i @talocode/gatelane |
Talocode ecosystem
| Product | Role |
|---|---|
| LeanLane | (this package) stop agent over-building |
VerifyLane · pip install talocode-verifylane |
Deterministic code verification |
| PolicyLane | Allow/deny + redaction |
| StyleLane | Constitution packs |
| EvalLane | Assertion eval suites |
| TraceLane | Agent run tracing |
| RetryLane | Retries & circuit breakers |
| PromptLane | Prompt versioning |
| HandoffLane | Schema handoffs |
| GateLane | MCP gateway |
SearchLane · pip install talocode-searchlane |
Agent web search |
ContextLane · pip install contextlane |
Shared agent context |
| MemoryLane | Agent memory |
Tera · pip install talocode-tera |
Capability API |
Codra · pip install talocode-codra |
Coding agent |
StackLane · pip install talocode |
Keys, wallet, metering |
Tradia · pip install tradia |
Trading agents |
ScreenLane · pip install talocode-screenlane |
Screen context |
XSearchLane · npm i @talocode/xsearchlane |
X search |
XProLane · pip install talocode-xprolane |
X pro workflows |
| Agent Browser | Browser automation |
| ClipLoop | Clip / media loops |
| InvoiceLane | Invoicing |
| GeoLane | Geo utilities |
DevTool · pip install talocode-devtool |
Dev tooling |
More: github.com/talocode · talocode.site · docs.talocode.site
License
MIT © Talocode
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。