原始内容
pi Stitch MCP Extension
A pi package that bridges pi to the Google Stitch remote MCP server (https://stitch.googleapis.com/mcp). Stitch is Google's design-to-code platform — generate pixel-perfect Flutter, React (JSX), and SwiftUI components from Figma designs.
It exposes a small, generic bridge instead of registering dozens of Stitch tools by default. This keeps pi's tool list compact while still allowing the model to discover and call any Stitch MCP tool.
Installation
pi install npm:@khmuhtadin/pi-stitch-mcp
Prerequisites
You need a Google Stitch API key. Set it via:
export GOOGLE_STITCH_API_KEY="your-api-key-here"
Or inside pi:
/stitch-mcp-set-key your-api-key-here
Registered tools
stitch_mcp_list_tools— list tools exposed by the Stitch MCP server.stitch_mcp_call_tool— call any Stitch MCP tool bynamewith JSONarguments.
Slash commands
/stitch-mcp-set-key <key>— set the Google Stitch API key in memory (not persisted across restarts; useGOOGLE_STITCH_API_KEYenv var for persistence)./stitch-mcp-register [tool1,tool2|*]— optional: register selected MCP tools as native pi tools with astitch_prefix./stitch-mcp-reset— reset the connection.
Configuration
Optional environment variables:
GOOGLE_STITCH_API_KEY— your Google Stitch API key (recommended).STITCH_MCP_URL— defaults tohttps://stitch.googleapis.com/mcp.STITCH_MCP_TIMEOUT_MS— defaults to30000.
Development
npm install
npm run typecheck
npm pack --dry-run
License
MIT