stitch-mcp
БесплатноБез исполняемых скриптовНе проверенConnects a coding agent to Google Stitch through the stitch-mcp CLI and MCP proxy, so the agent can read a screen's HTML and screenshot and rebuild it in the…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
Stitch MCP
Overview
Google Stitch generates UI screens from prompts and stores each one as an HTML document plus a
screenshot. stitch-mcp (npm package @_davideast/stitch-mcp, an independent open-source
project) is the bridge to a codebase. It does three jobs: it registers Stitch as an MCP server in
a coding agent, it adds helper tools that hand the agent a screen's markup in a single call, and
it can preview screens or export them as an Astro project. Facts below were checked against
version 0.9.0; run any command with --help if a flag is rejected.
The agent's real work starts after the fetch: Stitch output is one static HTML page per screen, and the job is to translate it into components that fit the repository it lands in.
Instructions
1. Establish the starting point
Ask or look up, in this order:
- Which MCP client is in use (Claude Code, Cursor, VS Code, Codex, OpenCode, Gemini CLI,
Antigravity) and whether a
stitchserver is already registered. - Whether the user has a Stitch API key. Without one the setup goes through Google Cloud OAuth, which needs a browser and a billing-enabled project.
- The Stitch project and the screens to implement. A project ID is a long number such as
7302915846120394175; a screen ID is 32 hex characters. Display names are not accepted. - The target stack, read from the repository: framework, styling system, existing components and design tokens. Never assume React and Tailwind.
2. Choose authentication
| Mode | How it is supplied | Choose it when |
|---|---|---|
| API key | STITCH_API_KEY in the environment, a .env file, or the MCP server's env block |
Default. Works headless, in CI and over SSH; nothing to refresh |
| OAuth via the wizard | init downloads its own gcloud SDK into ~/.stitch-mcp/ and signs in |
The user has no key but owns a Google Cloud project |
| OAuth via existing gcloud | STITCH_USE_SYSTEM_GCLOUD=1 plus the three commands below |
gcloud is already installed and signed in |
Existing-gcloud route, to be run by the user because it opens a browser:
gcloud auth application-default login
gcloud config set project orchard-design-prod
gcloud beta services mcp enable stitch.googleapis.com --project=orchard-design-prod
With no key present the CLI assumes OAuth. In a check run, doctor on a clean machine fetched
roughly 500 MB of gcloud SDK into ~/.stitch-mcp/ before reporting anything, so export the key
first when the key route is intended.
3. Choose the connection
| Proxy over stdio | Direct HTTP | |
|---|---|---|
| What the client starts | npx @_davideast/stitch-mcp proxy as a child process |
Nothing; it calls https://stitch.googleapis.com/mcp |
| Tools the agent sees | Stitch's own tools plus the four helpers in step 6 | Stitch's own tools only |
| OAuth token lifetime | Renewed for you by the proxy | One hour, then replaced by hand |
| Fits | Interactive design-to-code sessions | Pipelines and sandboxes that cannot spawn processes |
Pick the proxy unless there is a concrete reason not to: without get_screen_code the agent must
call get_screen, find the download URL and fetch the markup itself.
4. Register the server
Claude Code, proxy with an API key taken from the shell environment:
claude mcp add stitch -e STITCH_API_KEY="$STITCH_API_KEY" -- npx @_davideast/stitch-mcp proxy
Claude Code, direct HTTP (-s user writes to ~/.claude.json, -s project to ./.mcp.json):
claude mcp add stitch --transport http https://stitch.googleapis.com/mcp \
--header "X-Goog-Api-Key: $STITCH_API_KEY" -s user
Cursor (.cursor/mcp.json) and Antigravity share one shape. This variant uses OAuth, so the file
carries no secret and is safe to commit:
{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["@_davideast/stitch-mcp", "proxy"],
"env": { "STITCH_PROJECT_ID": "orchard-design-prod" }
}
}
}
For the API-key route the env block holds STITCH_API_KEY instead; keep that file out of
version control or use the client's own environment interpolation.
Differences in other clients:
- VS Code (
.vscode/mcp.json): the top-level key isservers, and each entry needs"type": "stdio"(or"type": "http"withurlandheaders). - Codex (
~/.codex/config.toml): a[mcp_servers.stitch]table withcommand = "npx"andargs = ["@_davideast/stitch-mcp", "proxy"]; variables go under[mcp_servers.stitch.env]. - OpenCode (
opencode.json):"mcp": { "stitch": { "type": "local", "command": ["npx", "@_davideast/stitch-mcp", "proxy"], "environment": { } } }. - Antigravity, direct mode only: the field is
serverUrl, noturl. - Gemini CLI:
gemini extensions install https://github.com/gemini-cli-extensions/stitch.
npx @_davideast/stitch-mcp init writes the same configuration through prompts. It accepts
-c, --client (claude-code, cursor, vscode, codex, `openco
Установить stitch-mcp в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл stitch-mcp?
Connects a coding agent to Google Stitch through the stitch-mcp CLI and MCP proxy, so the agent can read a screen's HTML and screenshot and rebuild it in the project's own framework. Use when a user says "implement this Stitch screen", "hook Stitch up to Claude Code / Cursor / Codex", "add the Stitch MCP server", "turn my Stitch project into a site", "preview my Stitch screens locally", or when Stitch tools fail with authentication or permission errors. Covers choosing API key or OAuth, proxy or direct HTTP, per-client configuration, the non-interactive flags an agent can run, the tool inputs and outputs, and how to diagnose a broken setup.
Как установить скилл stitch-mcp?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл stitch-mcp запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic