What problem does it solve?
pi-mcp-adapter solves the context-window bloat problem caused by exposing hundreds or thousands of MCP tool definitions to an LLM-backed coding agent, slowing decisions and wasting tokens.
Core Features & Use Cases
- Token-efficient MCP proxy: exposes a single compact proxy tool that discovers MCP capabilities on-demand instead of loading everything at once
- Lazy loading lifecycle: connects only when tools are actually called, disconnecting after idle time to reduce overhead
- Direct tool registration options: registers a selected subset of high-priority tools for stronger LLM visibility while keeping the rest proxy-based
- Standard MCP config support: reads
.mcp.json plus ~/.config/mcp/mcp.json and Pi project overrides to minimize manual wiring
- Interactive Pi configuration: configure and troubleshoot via the
/mcp overlay, including reconnection and OAuth triggering
- OAuth support: supports autoAuth and interactive OAuth flows for servers that require authorization
- Resource and UI integration: supports MCP resources and can open MCP UI payloads using the MCP UI standard
Quick Start
Add a .mcp.json in your project root with the servers you want, then restart Pi and call the proxy tool mcp to lazily discover and use tools from those servers.