/ Directorio / Playground / pi-mcp-adapter
● Comunidad nicobailon ⚡ Instantáneo

pi-mcp-adapter

por nicobailon · nicobailon/pi-mcp-adapter

Hook 200 MCP tools into the Pi coding agent for ~200 tokens — one proxy tool lazy-loads servers only when you actually call them.

pi-mcp-adapter is an adapter for Pi (badlogic/pi-mono), a minimalist coding agent. Instead of eagerly loading every MCP tool's schema into Pi's context, it exposes a single mcp proxy tool (~200 tokens) that supports search, describe, and tool calls. Servers start lazily and auto-disconnect after idle.

Por qué usarlo

Características clave

Demo en vivo

Cómo se ve en la práctica

pi-mcp-adapter.replay ▶ listo
0/0

Instalar

Elige tu cliente

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "pi-mcp-adapter": {
      "command": "npx",
      "args": [
        "-y",
        "pi-mcp-adapter"
      ],
      "_inferred": true
    }
  }
}

Abre Claude Desktop → Settings → Developer → Edit Config. Reinicia después de guardar.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "pi-mcp-adapter": {
      "command": "npx",
      "args": [
        "-y",
        "pi-mcp-adapter"
      ],
      "_inferred": true
    }
  }
}

Cursor usa el mismo esquema mcpServers que Claude Desktop. La configuración del proyecto prevalece sobre la global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "pi-mcp-adapter": {
      "command": "npx",
      "args": [
        "-y",
        "pi-mcp-adapter"
      ],
      "_inferred": true
    }
  }
}

Haz clic en el icono MCP Servers de la barra lateral de Cline y luego en "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "pi-mcp-adapter": {
      "command": "npx",
      "args": [
        "-y",
        "pi-mcp-adapter"
      ],
      "_inferred": true
    }
  }
}

Mismo formato que Claude Desktop. Reinicia Windsurf para aplicar.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "pi-mcp-adapter",
      "command": "npx",
      "args": [
        "-y",
        "pi-mcp-adapter"
      ]
    }
  ]
}

Continue usa un array de objetos de servidor en lugar de un mapa.

~/.config/zed/settings.json
{
  "context_servers": {
    "pi-mcp-adapter": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "pi-mcp-adapter"
        ]
      }
    }
  }
}

Añádelo a context_servers. Zed recarga en caliente al guardar.

claude mcp add pi-mcp-adapter -- npx -y pi-mcp-adapter

Un solo comando. Verifica con claude mcp list. Quita con claude mcp remove.

Casos de uso

Usos del mundo real: pi-mcp-adapter

Run Pi with 10+ MCP servers without blowing the context window

👤 Power users of the Pi coding agent ⏱ ~20 min intermediate

Cuándo usarlo: You want filesystem, git, github, postgres, playwright, fetch, firecrawl — more than Pi can eagerly load.

Requisitos previos
  • Pi installed — See badlogic/pi-mono
Flujo
  1. Install the adapter
    Run pi install npm:pi-mcp-adapter and restart Pi.✓ Copiado
    → Adapter listed in Pi's extensions
  2. Configure all your MCPs
    Add filesystem, git, github, postgres MCPs to pi-mcp-adapter in lazy mode.✓ Copiado
    → Servers registered; no boot overhead
  3. Use via search
    Use mcp({search: 'list files'}) to find the right tool, then call it.✓ Copiado
    → Relevant tool surfaced; then called

Resultado: Full MCP ecosystem available inside Pi, with a tiny context footprint.

Errores comunes
  • Search misses a tool because description is bad — Promote frequent tools to 'direct tools' so Pi sees them eagerly

Promote your 3 most-used MCP tools to first-class Pi tools

👤 Devs who use Pi daily ⏱ ~10 min beginner

Cuándo usarlo: You notice Pi calling mcp({search: ...}) every time before using filesystem read — add it as a direct tool to skip the dance.

Flujo
  1. Identify hot tools
    Which mcp tool calls show up most in my recent Pi session logs?✓ Copiado
    → Top-N list
  2. Mark as direct
    Configure these as direct tools in pi-mcp-adapter settings.✓ Copiado
    → Tools now appear as first-class Pi tools

Resultado: Faster agent loop + lower token spend on repetitive tool discovery.

Errores comunes
  • Too many direct tools = defeats the purpose — Keep direct-tool count to ≤5; promote only if frequency is high

Use OAuth-protected MCP servers (e.g. Linear, Slack) with Pi

👤 Pi users on enterprise MCPs ⏱ ~15 min intermediate

Cuándo usarlo: Your MCP server requires OAuth and you'd rather not hand-craft token refresh.

Flujo
  1. Enable autoAuth
    Set autoAuth: true in pi-mcp-adapter config for the linear server.✓ Copiado
    → Pi opens browser on first use
  2. Authorize in browser
    Approve the scope request; tokens are persisted.✓ Copiado
    → Subsequent calls use refreshed tokens automatically

Resultado: OAuth-protected MCP integrations 'just work' in Pi.

Errores comunes
  • Tokens stored unencrypted on disk — Use an encrypted home directory or OS keychain bridge

Combinaciones

Combínalo con otros MCPs para multiplicar por 10

pi-mcp-adapter + filesystem + git-2 + github

Full dev loop inside Pi with lazy tool loading

Register filesystem, git, and github via pi-mcp-adapter in lazy mode.✓ Copiado

Herramientas

Lo que expone este MCP

HerramientaEntradasCuándo llamarCoste
mcp {search?: str} | {describe?: str} | {tool?: str, args?: JSON-string} Universal proxy — the only tool Pi sees by default ~200 tokens eager + on-demand tool execution
/mcp-auth <server> server name Manually trigger OAuth for a specific server free

Coste y límites

Lo que cuesta ejecutarlo

Cuota de API
None of its own — proxies to underlying MCPs
Tokens por llamada
~200 tokens eager overhead vs N*~500 for full tool listing
Monetario
Free, open source
Consejo
Start lazy. Only promote tools to direct when telemetry shows Pi calls them ≥5× per session.

Seguridad

Permisos, secretos, alcance

Almacenamiento de credenciales: OAuth tokens in ~/.pi/mcp-adapter/ — treat as sensitive
Salida de datos: Depends on configured upstream MCPs

Resolución de problemas

Errores comunes y soluciones

mcp({tool: ...}) says 'tool not found'

Tool name is case-sensitive and namespaced by server. Use describe first to get the exact name.

OAuth loop never completes

Adapter's local callback port may be blocked. Check the redirect URL matches what's registered with the provider.

Server starts but tool calls hang

Upstream MCP crashed silently. Switch to eager mode temporarily to see the boot error.

Verificar: pi-mcp-adapter logs

Alternativas

pi-mcp-adapter vs otros

AlternativaCuándo usarlaContrapartida
Raw MCP integrationYou run Pi with only 1-2 MCP serversSimpler, but eats context as you add servers
mcp-gatewayYou need security/PII redaction across many MCPs (not just token efficiency)Python gateway; aimed at security more than token-saving

Más

Recursos

📖 Lee el README oficial en GitHub

🐙 Ver issues abiertas

🔍 Ver todos los 400+ servidores MCP y Skills