pi-mono
pi-mono copied to clipboard
feat(coding-agent): Add MCP extension example
Summary
Add an extension example that integrates MCP (Model Context Protocol) servers.
Implementation
Configuration
- Read
~/.pi/agent/mcp.jsonand<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:
-
Server List Screen
- Show all configured MCP servers
- Green dot for connected, red X for failed
- Select a server to view details
-
Server Detail Screen
- Display server tools
- Enable/disable server dynamically (adds/removes tools via
setActiveTools)