Stitch MCP Server
Exports a Stitch project's designs as Angular components into a specified output directory via the export command and the stitch_export_framework MCP tool.
Talks to the Google Stitch API (stitch.withgoogle.com) to list projects, generate screens from prompts, sync designs to HTML and export design systems, authenticating with a Stitch API key.
Exports Stitch designs as Next.js pages/components into the app directory via the export command and the stitch_export_framework MCP tool.
Exports Stitch designs as Nuxt pages into the pages directory via the export command and the stitch_export_framework MCP tool.
Exports Stitch designs as React components into a components directory, supporting custom EJS templates and their generated HTML/CSS.
Exports Stitch designs as SolidJS components into a components directory via the export command and the stitch_export_framework MCP tool.
Exports Stitch designs as Svelte components into a lib directory via the export command and the stitch_export_framework MCP tool.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Stitch MCP Server generate a mobile login screen in project abc123 and export it to React"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
stitch-mcp-cli
CLI + MCP Server para Google Stitch con scaffolding multi-framework
Características
⚡ Setup en 30 segundos - Solo necesitas una API key
🔐 Seguridad - API key encriptada con AES-256-GCM
🎨 Scaffolding universal - Exporta a React, Vue, Svelte, Next.js, y más
👀 Watch mode - Sincronización continua cuando cambia el diseño
💾 Offline cache - Trabaja sin conexión con proyectos cacheados
🔧 Multi-IDE - Configura automáticamente Cursor, Claude Code, VS Code, OpenCode, Antigravity, Codex CLI
🧪 Evaluaciones MCP - Benchmark tools para LLMs
📡 HTTP + stdio - Dos transportes MCP disponibles
🚦 Rate limiting - 60 req/min para evitar bloqueos
📝 Logging estructurado - Pino logger con niveles configurables
✅ TypeScript strict - Tipado completo y verificado
Related MCP server: Stitch MCP Server
Quickstart
# 1. Instalar (recomendado con pnpm)
pnpm add -g stitch-mcp-cli
# O con npm
npm install -g stitch-mcp-cli
# O con npx (sin instalar)
npx stitch-mcp-cli auth --api-key TU_API_KEY
# 2. Configurar API key (encriptada automáticamente)
stitch-mcp-cli auth --api-key TU_API_KEY
# 3. Configurar IDEs
stitch-mcp-cli setup
# 4. Listar proyectos
stitch-mcp-cli projectsObtén tu API key en: https://stitch.withgoogle.com/settings
MCP Server
El CLI también funciona como MCP Server para integrar con AI coding agents:
# Modo stdio (local) - Para IDEs
stitch-mcp-cli mcp
# Modo HTTP (remoto) - Puerto 3100 por defecto
stitch-mcp-cli mcp:http
# Puerto personalizado
MCP_PORT=8080 stitch-mcp-cli mcp:http
# Host personalizado
MCP_HOST=0.0.0.0 MCP_PORT=8080 stitch-mcp-cli mcp:httpTools disponibles en MCP:
Tool | Parámetros | Descripción |
|
| Lista proyectos (con búsqueda) |
|
| Genera pantalla desde prompt |
|
| Sync a HTML |
|
| Exporta a framework |
| - | Estado de caché |
| - | Limpia caché |
|
| Sincroniza proyecto a caché |
Ejemplo de uso con MCP Inspector
# Inspeccionar servidor MCP
npx @modelcontextprotocol/inspector node dist/index.js
# O conpnpm
pnpm run inspectorComandos
Comando | Descripción |
| Configurar API key (encriptada) |
| Auto-configurar IDEs |
| Listar proyectos |
| Generar pantalla |
| Sync a archivos |
| Exportar a framework |
| Watch mode |
| Gestionar caché |
| Ejecutar evaluaciones MCP |
| Extraer design system a DESIGN.md |
Auth
# Configurar API key (se encripta automáticamente)
stitch-mcp-cli auth --api-key <key>
# Verificar configuración
stitch-mcp-cli auth --checkProjects
# Listar todos los proyectos
stitch-mcp-cli projects
# Listar con formato JSON
stitch-mcp-cli projects --json
# Filtrar por nombre
stitch-mcp-cli projects --search "dashboard"
# Modo offline
stitch-mcp-cli projects --offlineGenerate
# Generar pantalla desde prompt
stitch-mcp-cli generate "Login form with email and password" --project-id <id>
# Generar con tipo de dispositivo
stitch-mcp-cli generate "Mobile navigation" --project-id <id> --device mobileSync
# Sync pantalla específica
stitch-mcp-cli sync <project-id> <screen-id> --output ./src/stitch
# Sync todos los diseños de un proyecto
stitch-mcp-cli sync --project-id <id> --output ./designsExport
# Exportar a React
stitch-mcp-cli export <project-id> --framework react --output ./src/components
# Exportar a Vue
stitch-mcp-cli export <project-id> --framework vue --output ./src/views
# Exportar a Next.js
stitch-mcp-cli export <project-id> --framework nextjs --output ./app
# Exportar a Svelte
stitch-mcp-cli export <project-id> --framework svelte --output ./src/lib
# Exportar a Nuxt
stitch-mcp-cli export <project-id> --framework nuxt --output ./pages
# Exportar a SolidJS
stitch-mcp-cli export <project-id> --framework solid --output ./src/components
# Exportar a Angular
stitch-mcp-cli export <project-id> --framework angular --output ./src/app/components
# Exportar a HTML vanilla
stitch-mcp-cli export <project-id> --framework vanilla --output ./designsFrameworks soportados: react, vue, svelte, nextjs, nuxt, solid, angular, vanilla
Eval
Ejecuta evaluaciones MCP para benchmarking de LLMs:
# Ejecutar evaluaciones con archivo por defecto
stitch-mcp-cli eval
# Ejecutar con archivo personalizado
stitch-mcp-cli eval --file ./custom-eval.xml
# Guardar resultados en JSON
stitch-mcp-cli eval --resultsEl archivo de evaluación debe estar en evaluations/stitch-mcp-eval.xml con formato:
<qa_pair>
<question>Lista todos los proyectos</question>
<answer>Lista de proyectos</answer>
<tool_used>list_projects</tool_used>
</qa_pair>Design-MD
Extrae el design system del proyecto a un archivo DESIGN.md:
# Generar DESIGN.md con projectId desde caché
stitch-mcp-cli design-md
# Especificar proyecto
stitch-mcp-cli design-md --project-id <id>
# Personalizar output
stitch-mcp-cli design-md --output ./docs/DESIGN.md
# Sincronizar pantallas también
stitch-mcp-cli design-md --syncEl archivo generado incluye:
Tema visual y atmósfera
Paleta de colores con roles
Reglas de tipografía
Estilos de componentes
Principios de layout
Tokens para generación Stitch
Cache
# Ver estado de caché
stitch-mcp-cli cache --status
# Limpiar caché
stitch-mcp-cli cache --clear
# Sync proyecto a caché
stitch-mcp-cli cache --sync <project-id>Templates Personalizados
Puedes crear templates custom para frameworks sobrescribiendo los defaults:
~/.stitch-mcp-cli/templates/
├── react/
│ └── component.ejs
├── vue/
│ └── component.ejs
├── svelte/
│ └── component.ejs
└── custom-framework/
└── component.ejsVariables disponibles en templates EJS:
Variable | Tipo | Descripción |
| string | Nombre del componente en PascalCase |
| string | HTML generado por Stitch |
| string|undefined | CSS extraído del diseño |
Ejemplo de template React custom:
import React from 'react';
import styles from './<%= componentName %>.module.css';
interface <%= componentName %>Props {
className?: string;
}
export const <%= componentName %>: React.FC<<%= componentName %>Props> = ({ className }) => {
return (
<div className={`${styles.container} ${className || ''}`}>
<style>{`<%= css || '' %>`}</style>
<%= html %>
</div>
);
};Configurar directorio de templates
# En ~/.stitch-mcp-cli/config.json
{
"templateDir": "/path/to/custom/templates"
}
# O con variable de entorno
STITCH_TEMPLATE_DIR=./templates stitch-mcp-cli export <project-id> --framework reactConfiguración de IDEs
Cursor
Archivo: ~/.cursor/mcp.json
{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["stitch-mcp-cli"],
"env": {
"STITCH_API_KEY": "${STITCH_API_KEY}"
}
}
}
}Claude Code
claude mcp add stitch -- npx stitch-mcp-cliO manualmente en ~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["stitch-mcp-cli"],
"env": {
"STITCH_API_KEY": "${STITCH_API_KEY}"
}
}
}
}VS Code
Archivo: .vscode/mcp.json o configuración de workspace
{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["stitch-mcp-cli"],
"env": {
"STITCH_API_KEY": "${STITCH_API_KEY}"
}
}
}
}OpenCode
Archivo: ~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"stitch": {
"type": "local",
"command": ["npx", "stitch-mcp-cli"],
"enabled": true,
"environment": {
"STITCH_API_KEY": "${STITCH_API_KEY}"
}
}
}
}Kilo Code
Archivo: ~/.config/kilo/opencode.json
{
"$schema": "https://app.kilo.ai/config.json",
"mcp": {
"stitch": {
"type": "local",
"command": ["npx", "stitch-mcp-cli"],
"enabled": true,
"environment": {
"STITCH_API_KEY": "${STITCH_API_KEY}"
}
}
}
}Codex CLI
Archivo: ~/.codex/config.toml
[mcp_servers.stitch]
command = "npx"
args = ["stitch-mcp-cli"]
env_vars = { STITCH_API_KEY = "${STITCH_API_KEY}" }O usando el CLI de Codex:
codex mcp add stitch --env STITCH_API_KEY=$STITCH_API_KEY -- npx stitch-mcp-cliAntigravity
Archivo: ~/.antigravity/mcp_config.json
{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["stitch-mcp-cli"],
"env": {
"STITCH_API_KEY": "${STITCH_API_KEY}"
}
}
}
}Configuración automática
El comando setup detecta y configura automáticamente todos los IDEs instalados:
stitch-mcp-cli setupAl ejecutar setup se te preguntará:
? Qué quieres instalar?
1) Solo MCP server
2) MCP server + Skill de diseño (stitch-design-taste)Solo MCP server: Configura el servidor MCP en tus IDEs
MCP server + Skill: Además instala la skill
stitch-design-tasteen~/.agents/skills/, que guía a los agentes con criterios de diseño premium para Stitch (anti-slop, calibración de colores, tipografía, componentes, layout y motion)
Skill de Diseño (stitch-design-taste)
La skill se instala en ~/.agents/skills/stitch-design-taste/ y es leída automáticamente por OpenCode, Antigravity, Claude Code, Kilo Code, Codex CLI y otros agentes compatibles.
Qué hace:
Criterios anti-slop para evitar interfaces genéricas de IA
Cómo calibrar paletas de colores (no colores fijos — metodología)
Pairing de tipografía y jerarquía
Specs de componentes: botones, cards, inputs, loaders, empty states
Patrones de layout y motion philosophy
Integración con
stitch-mcp-cli design-mdy los MCP tools
Los valores reales salen del DESIGN.md de cada proyecto. La skill le enseña al agente a tomar buenas decisiones con esos valores.
Desarrollo
# Clonar repositorio
git clone https://github.com/berriosb/stitch-mcp-cli.git
cd stitch-mcp-cli
# Instalar dependencias
pnpm install
# Desarrollo (watch mode)
pnpm dev
# Build
pnpm run build
# Tests
pnpm test
# Typecheck
pnpm run typecheck
# Inspect MCP server
pnpm run inspectorSeguridad
La API key se encripta con AES-256-GCM y se guarda en
~/.stitch-mcp-cli/config.jsonLa clave de encriptación se guarda en
~/.stitch-mcp-cli/.keycon permisos0600El SDK usa header
X-Goog-Api-Key, no query paramsAñade restricciones a tu API key en Google Cloud Console
Rate limiting: 60 requests por minuto
Logging
El servidor usa Pino para logging estructurado:
# Nivel de log (default: info)
LOG_LEVEL=debug stitch-mcp-cli mcp
# Ver logs en desarrollo
NODE_ENV=development stitch-mcp-cli mcpEnvironment Variables
Variable | Default | Descripción |
| - | API key de Stitch |
|
| Nivel de log |
|
| Entorno (development/production) |
|
| Puerto HTTP (solo mcp:http) |
|
| Host HTTP (solo mcp:http) |
Changelog
Ver CHANGELOG.md para historial de cambios.
Para generar changelog con conventional commits:
pnpm run changelogRoadmap
v1.0.0 - Production Ready ✅
MCP Server propio con 7 tools
CLI completa con 10 comandos
API key encriptada (AES-256-GCM)
Rate limiting (60 req/min)
Logging estructurado (Pino)
Graceful shutdown
HTTP + stdio transports
TypeScript strict mode
Zod validation
58 tests (unit + integration)
CI/CD con GitHub Actions
v1.1.0 - Enhanced Features
Template engine mejorado
Más frameworks (Angular, Solid)
Watch mode avanzado
v1.2.0 - Cloud
MCP sobre HTTP con autenticación
Deploy a cloud functions
Multi-user support
Troubleshooting
Error: Cannot find module '@google/stitch-sdk'
# Reinstalar dependencias
pnpm install
# O limpiar caché y reinstalar
rm -rf node_modules pnpm-lock.yaml
pnpm installError: better-sqlite3 compila lentamente
better-sqlite3 es una dependencia opcional para caché offline SQLite. Si no compila, el CLI usa automáticamente JSON como fallback.
# Opción 1: Usar pnpm (más rápido)
pnpm install -g stitch-mcp-cli
# Opción 2: Ignorar scripts de compilación
npm install -g stitch-mcp-cli --ignore-scriptsError: API key inválida
# Verificar configuración
stitch-mcp-cli auth --check
# Reconfigurar API key
stitch-mcp-cli auth --api-key <nueva-key>Error: EACCES permission denied
# Permisos del directorio de configuración
chmod 700 ~/.stitch-mcp-cli
chmod 600 ~/.stitch-mcp-cli/config.json
chmod 600 ~/.stitch-mcp-cli/.keyMCP Server no aparece en mi IDE
Verifica que el binario esté instalado:
which stitch-mcp-cli
# Debe retornar: /usr/local/bin/stitch-mcp-cli o similarSi usas pnpm global, agrega el path:
# Agregar a ~/.bashrc o ~/.zshrc
export PATH="$(pnpm global bin):$PATH"Reinicia el IDE después de configurar
Rate limiting (429 Too Many Requests)
El CLI tiene rate limiting interno de 60 req/min. Si ves este error:
Espera 1 minuto antes de continuar
Usa modo offline:
stitch-mcp-cli projects --offlineAumenta el límite:
STITCH_RATE_LIMIT=120 stitch-mcp-cli mcp
Logs de depuración
# Activar logs detallados
LOG_LEVEL=debug stitch-mcp-cli mcp
# Guardar logs en archivo
LOG_LEVEL=debug stitch-mcp-cli mcp 2>&1 | tee stitch.logLicencia
MIT
Available Tools
14 toolsstitch_apply_design_systemApply Design System to ScreensB
Apply a design system to one or more screens, updating their visual style to match the design system's theme and tokens.
Inputs: projectId (required), screenIds (required), designSystemId (required).
stitch_cache_clearClear CacheADestructiveIdempotent
Clear all cached projects and screens from the local SQLite database.
Inputs: no named parameters.
stitch_cache_statusCache StatusARead-onlyIdempotent
Get the current status of the local SQLite cache including project count, screen count, and cache size.
Inputs: no named parameters.
stitch_cache_syncSync Project to CacheAIdempotent
Download and cache all screens from a Stitch project for offline access.
Inputs: projectId (required).
stitch_create_design_systemCreate Design SystemB
Create a new design system for a Stitch project. Defines visual theme, style guidelines, and design tokens for consistent branding.
Inputs: projectId (required), theme, displayName, designTokens, +1 more.
stitch_create_projectCreate Stitch ProjectB
Create a new Google Stitch project. A project is a container for UI designs and frontend code.
Inputs: title.
stitch_export_frameworkExport to FrameworkB
Export a Stitch project to a specific UI framework (React, Vue, Svelte, Next.js, Nuxt, Solid, Angular, or Vanilla HTML). Transforms HTML into framework-specific components.
Inputs: projectId (required), output, routes, framework.
stitch_generate_screenGenerate ScreenA
Generate a new UI screen in Google Stitch from a text prompt. Uses the specified project or falls back to the first available project. Supports model selection (GEMINI_3_PRO, GEMINI_3_FLASH, GEMINI_3_1_PRO).
Inputs: prompt (required), name, device, modelId, +1 more.
stitch_list_design_systemsList Design SystemsBRead-onlyIdempotent
List all design systems for a given Stitch project.
Inputs: projectId (required).
stitch_list_projectsList Stitch ProjectsBRead-onlyIdempotent
List all Google Stitch projects accessible with the configured credentials. Supports filtering by search term and offline mode.
Inputs: json, search.
stitch_sync_screenSync Screen to HTMLAIdempotent
Synchronize a screen from Google Stitch to local HTML files. If no screenId is provided, syncs all screens from the project.
Inputs: projectId (required), output, screenId.
stitch_to_storybookExport to StorybookBIdempotent
Export a Stitch project to Storybook stories for a given framework (react, nextjs, vue, nuxt, svelte, sveltekit). Writes one component file + one story file per screen, plus a minimal .storybook/ configuration.
Inputs: projectId (required), output, framework.
stitch_update_design_systemUpdate Design SystemC
Update an existing design system's theme, tokens, or style guidelines.
Inputs: projectId (required), designSystemId (required), theme, displayName, +2 more.
stitch_upload_imageUpload Image/File to ProjectA
Upload a design file (PNG, JPG, WEBP, HTML) to a Stitch project. Creates new screen canvases from the file contents.
Inputs: filePath (required), projectId (required), title, createScreenInstances.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools target clearly distinct resources and actions (list/create project, generate/sync screen, create/update/apply design system). The main overlaps are between stitch_sync_screen (pull screens into local HTML), stitch_cache_sync (cache screens in SQLite), and the two exporters stitch_export_framework vs stitch_to_storybook, though the descriptions do clarify the differences.
Every tool follows a strict stitch_<verb>_<noun> snake_case pattern (stitch_list_projects, stitch_create_design_system, stitch_cache_clear), with no mixed conventions or stray prefixes.
Fourteen tools is well inside the ideal range for a design-to-code pipeline server, and each tool maps to a concrete workflow step (project, screen, design system, cache, export) rather than padding the surface.
Project lifecycle is only partly covered (list/create but no update or delete), design systems lack a delete, and there is no direct screen listing or per-screen delete/update, only generate/upload/sync. Agents can accomplish main flows (generate -> design system -> export) but will hit dead ends for cleanup and individual screen inspection.
Maintenance
Related MCP Connectors
Serves your design system and coding standards to coding agents, so they stop guessing.
UI design from prompts, screenshots, and URLs for AI coding agents and theme tokens.
Generate, inspect, and manage Flowstep UI designs directly from your AI assistant.
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn intelligent MCP server for Google Stitch that generates production-ready UI from text prompts, with auto-orchestration of design systems, WCAG accessibility, responsive breakpoints, and framework conversion (React, Vue, Svelte).1718 npm9MIT
- AlicenseAqualityDmaintenanceEnables AI coding assistants to generate, edit, and scaffold HTML UIs from natural language using Google Stitch API.9348 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered UI/UX design generation and management via Google Stitch, handling OAuth authentication automatically for MCP clients like Claude Code and Cursor.8 npm2MIT
- AlicenseNot gradedqualityDmaintenanceEnables managing Stitch design projects via natural language, including listing projects, viewing details, retrieving screens, downloading assets, and generating new screens from text prompts.Apache 2.0