pi-mcp-adapter
by nicobailon·★ 689·Score 55
Token-efficient MCP adapter for Pi coding agent that reduces context window usage by lazy-loading MCP servers.
Overview
Pi MCP Adapter addresses the problem of verbose tool definitions that consume excessive context tokens. Instead of loading all MCP server tools upfront, this adapter implements a proxy approach that only connects servers when specific tools are actually needed. It automatically reads standard MCP configuration files from multiple locations including ~/.config/mcp/mcp.json and project-specific .mcp.json files. The adapter supports multiple lifecycle modes: lazy (default), eager, and keep-alive, with configurable idle timeouts and direct tools option for frequently used servers.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this when using Pi with multiple MCP servers and you're hitting context limits, or when you want to integrate existing MCP configurations without configuration overhead.
When NOT to choose this
Don't choose this if you're not using Pi, or if you prefer all MCP tools to be directly available without proxy discovery.
Tools this server exposes
2 tools extracted from the READMEmcpProxy tool to access MCP servers on-demand, avoiding context bloat
chrome_devtools_take_screenshotTake a screenshot of the page or element using Chrome DevTools
Comparable tools
Installation
pi install npm:pi-mcp-adapterOr for Claude Desktop:
{
"pi": {
"mcpServers": {
"pi-mcp-adapter": {
"command": "npx",
"args": ["pi-mcp-adapter"]
}
}
}
}FAQ
- How does this reduce token usage?
- Instead of including full MCP tool definitions (which can be 10k+ tokens), the adapter uses a single proxy tool (~200 tokens) and only connects to actual servers when specific tools are needed.
- What MCP configuration files does it support?
- The adapter automatically reads ~/.config/mcp/mcp.json, .mcp.json, and Pi-specific overrides (~/.pi/agent/mcp.json and .pi/mcp.json) with a clear precedence order.
Compare pi-mcp-adapter with
Last updated · Auto-generated from public README + GitHub signals.