/ 目录 / 演练场 / 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