/ 目錄 / 演練場 / Stitch MCP
● 社群 davideast ⚡ 即開即用

Stitch MCP

作者 davideast · davideast/stitch-mcp

Bridge between Google Stitch's AI design canvas and your real codebase — Claude reads the design and writes React/Vue/SwiftUI for it.

Stitch is Google's AI UI design tool. Stitch MCP lets Claude pull the active Stitch design (layout tree, tokens, generated assets) and translate it into your project's component conventions, instead of you copy-pasting screenshots.

為什麼要用

核心特性

即時演示

實際使用效果

就緒

安裝

選擇你的客戶端

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

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

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

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

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

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

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

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

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

Continue 使用伺服器物件陣列,而非映射。

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

加入 context_servers。Zed 儲存後熱重載。

claude mcp add stitch-mcp -- npx -y stitch-mcp

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: Stitch MCP

Turn a Stitch screen into production React

👤 Developers ⏱ ~15 min intermediate

何時使用: You finished a screen in Stitch and want a PR-ready component.

步驟
  1. Pull design
    stitch_get_active_design; inspect tree.✓ 已複製
    → Tree loaded
  2. Map tokens
    Map Stitch tokens to your tailwind config.✓ 已複製
    → Token map ready
  3. Generate
    Generate React component using your project's conventions.✓ 已複製
    → Component file ready

結果: Component lives in your repo with your tokens, not pasted Stitch CSS.

組合

與其他 MCP 搭配,撬動十倍槓桿

stitch-mcp + shadcn-ui-mcp

Map Stitch components onto your shadcn primitives

Combine stitch-mcp with shadcn-ui-mcp: Map Stitch components onto your shadcn primitives✓ 已複製

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
get_active_design (see docs) Fetch current Stitch design tree 1 call
export_assets (see docs) Export image assets with names 1 call
map_tokens (see docs) Map Stitch tokens to a target token system 1 call

成本與限制

運行它的成本

API 配額
Stitch API quota applies
每次呼叫 Token 數
Design trees are mid-size
費用
Free MCP; Stitch usage applies
提示
Strip out hidden layers before generating code — keeps token count down

安全

權限、密鑰、影響範圍

最小權限: stitch:read
憑證儲存: Stitch API token in env
資料出站: stitch.google.com

故障排查

常見錯誤與修復

Design returns empty

Confirm the right Stitch project is active in your account

Generated code uses Stitch tokens

Provide a token-mapping config first

替代方案

Stitch MCP 對比其他方案

替代方案何時用它替代權衡
figma MCPSource is FigmaDifferent design tool

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills