khmuhtadin-pi-stitch-mcp

内容来源:README.md(说明文档) · 原始地址 · 查看安装指南

原始内容

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 by name with JSON arguments.

Slash commands

  • /stitch-mcp-set-key <key> — set the Google Stitch API key in memory (not persisted across restarts; use GOOGLE_STITCH_API_KEY env var for persistence).
  • /stitch-mcp-register [tool1,tool2|*] — optional: register selected MCP tools as native pi tools with a stitch_ 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 to https://stitch.googleapis.com/mcp.
  • STITCH_MCP_TIMEOUT_MS — defaults to 30000.

Development

npm install
npm run typecheck
npm pack --dry-run

License

MIT