pi-mono icon indicating copy to clipboard operation
pi-mono copied to clipboard

feat(coding-agent): Add MCP extension example

Open badlogic opened this issue 1 week ago • 3 comments

Summary

Add an extension example that integrates MCP (Model Context Protocol) servers.

Implementation

Configuration

  • Read ~/.pi/agent/mcp.json and <cwd>/.pi/mcp.json
  • Follow the established format used by Claude Code and other harnesses

MCP Server Connection

  • Connect to MCP servers (stdio and SSE transports) using the MCP TypeScript SDK
  • Expose each server's tools as custom tools with naming: mcp_<server-name>_<toolname>

/mcp Command

Custom UI component with multiple screens:

  1. Server List Screen

    • Show all configured MCP servers
    • Green dot for connected, red X for failed
    • Select a server to view details
  2. Server Detail Screen

    • Display server tools
    • Enable/disable server dynamically (adds/removes tools via setActiveTools)

badlogic avatar Jan 08 '26 11:01 badlogic