v2.21.9
First-Class MCP Support for Pi Coding Agent
Added — pi-lean-ctx v2.0.0 with Embedded MCP Bridge
- Embedded MCP client — pi-lean-ctx now spawns the lean-ctx binary as an MCP server (JSON-RPC over stdio) and registers all 20+ advanced tools (ctx_session, ctx_knowledge, ctx_semantic_search, ctx_overview, ctx_compress, ctx_metrics, ctx_agent, ctx_graph, ctx_discover, ctx_context, ctx_preload, ctx_delta, ctx_edit, ctx_dedup, ctx_fill, ctx_intent, ctx_response, ctx_wrapped, ctx_benchmark, ctx_analyze, ctx_cache, ctx_execute) as native Pi tools.
- Automatic pi-mcp-adapter compatibility — If lean-ctx is already configured in
~/.pi/agent/mcp.json(via pi-mcp-adapter), the embedded bridge is skipped to avoid duplicate tool registration. - Dynamic tool discovery — Tool schemas come directly from the MCP server at runtime, not hardcoded. The
disabled_toolsconfig is respected. - Auto-reconnect — If the MCP server process crashes, the bridge reconnects automatically (3 attempts with exponential backoff). CLI-based tools (bash, read, grep, find, ls) continue working regardless.
/lean-ctxcommand enhanced — Now shows binary path, MCP bridge status (embedded vs. adapter), and list of registered MCP tools.
Added — Pi auto-detection in lean-ctx setup
- Pi Coding Agent is now auto-detected alongside Cursor, Claude Code, VS Code, Zed, and all other supported editors. Running
lean-ctx setupwrites~/.pi/agent/mcp.jsonautomatically. lean-ctx init --agent pinow also writes the MCP server config to~/.pi/agent/mcp.jsonwithlifecycle: lazyanddirectTools: true.
Improved — Pi diagnostics
lean-ctx doctornow shows three Pi states: "pi-lean-ctx + MCP configured", "pi-lean-ctx installed (embedded bridge active)", or "not installed".
Documentation
- README for pi-lean-ctx completely rewritten with MCP tools table, pi-mcp-adapter compatibility guide, and
disabled_toolsconfiguration. - PI_AGENTS.md template updated with MCP tools section.
Upgrade
cargo install lean-ctx # or
npm update -g lean-ctx-bin # or
brew upgrade lean-ctxFull Changelog: v2.21.9...v2.21.9