Loading...
Loading...
CLI for moving AI-generated UI designs from Google's Stitch platform into development workflows with local preview, site generation, and agent integration.
npx skill4agent add aradotso/mcp-skills stitch-mcp-cliSkill by ara.so — MCP Skills collection.
stitch-mcpnpx @_davideast/stitch-mcp <command>npm install -g @_davideast/stitch-mcpinitnpx @_davideast/stitch-mcp initnpx @_davideast/stitch-mcp doctor--verbosenpx @_davideast/stitch-mcp doctor --verbosenpx @_davideast/stitch-mcp serve -p <project-id>npx @_davideast/stitch-mcp site -p <project-id>./stitch-sitenpx @_davideast/stitch-mcp site -p <project-id> -o ./my-sitenpx @_davideast/stitch-mcp init~/.stitch-mcp/export STITCH_API_KEY="your-api-key"gcloud auth application-default login
gcloud config set project <PROJECT_ID>
gcloud beta services mcp enable stitch.googleapis.com --project=<PROJECT_ID>STITCH_USE_SYSTEM_GCLOUD=1STITCH_USE_SYSTEM_GCLOUD=1 npx @_davideast/stitch-mcp serve -p <project-id>npx @_davideast/stitch-mcp logoutnpx @_davideast/stitch-mcp logout --force --clear-configclaude_desktop_config.json.cursor/config.json{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["@_davideast/stitch-mcp", "proxy"]
}
}
}{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["@_davideast/stitch-mcp", "proxy"],
"env": {
"STITCH_API_KEY": "${STITCH_API_KEY}"
}
}
}
}{
"mcpServers": {
"stitch": {
"command": "npx",
"args": ["@_davideast/stitch-mcp", "proxy"],
"env": {
"STITCH_USE_SYSTEM_GCLOUD": "1"
}
}
}
}build_site{
projectId: string; // Required
routes: Array<{
screenId: string; // Required
route: string; // Required, e.g. "/" or "/about"
}>;
}npx @_davideast/stitch-mcp tool build_site -d '{
"projectId": "123456",
"routes": [
{ "screenId": "abc123", "route": "/" },
{ "screenId": "def456", "route": "/about" },
{ "screenId": "ghi789", "route": "/contact" }
]
}'Use the build_site tool to create a website from my Stitch project 123456.
Map screen abc123 to the home page, def456 to /about, and ghi789 to /contact.get_screen_codenpx @_davideast/stitch-mcp tool get_screen_code -d '{
"projectId": "123456",
"screenId": "abc123"
}'get_screen_imagenpx @_davideast/stitch-mcp tool get_screen_image -d '{
"projectId": "123456",
"screenId": "abc123"
}'npx @_davideast/stitch-mcp view --projectsnpx @_davideast/stitch-mcp view --project <project-id>npx @_davideast/stitch-mcp view --project <project-id> --screen <screen-id>csoqnpx @_davideast/stitch-mcp screens -p <project-id>npx @_davideast/stitch-mcp toolnpx @_davideast/stitch-mcp tool <tool-name> -snpx @_davideast/stitch-mcp tool build_site -snpx @_davideast/stitch-mcp tool <tool-name> -d '<json-data>'npx @_davideast/stitch-mcp tool get_screen_code -d '{
"projectId": "123456",
"screenId": "abc123"
}'npx @_davideast/stitch-mcp serve -p <project-id>npx @_davideast/stitch-mcp serve -p <project-id> --port 3000npx @_davideast/stitch-mcp site -p <project-id>routes.json{
"routes": [
{ "screenId": "abc123", "route": "/" },
{ "screenId": "def456", "route": "/about" }
]
}npx @_davideast/stitch-mcp site -p <project-id> --config routes.json -o ./outputnpx @_davideast/stitch-mcp snapshot -p <project-id> -s <screen-id> -o ./snapshot.htmlnpx @_davideast/stitch-mcp proxy/tmp/stitch-proxy-debug.lognpx @_davideast/stitch-mcp proxy --debug| Variable | Description |
|---|---|
| API key for direct authentication (skips OAuth) |
| Pre-existing access token |
| Use system gcloud config instead of isolated config |
| Override project ID |
| Alternative project ID variable |
| Custom Stitch API endpoint |
# 1. Browse available screens
npx @_davideast/stitch-mcp screens -p <project-id>
# 2. Serve locally to review designs
npx @_davideast/stitch-mcp serve -p <project-id>
# 3. Build site after confirming screens
npx @_davideast/stitch-mcp site -p <project-id>I have a Stitch project with ID 123456. It has three screens:
- Home page (screen ID: abc123)
- About page (screen ID: def456)
- Contact page (screen ID: ghi789)
Use the build_site tool to generate HTML for all three pages with routes /, /about, and /contact.
Then help me integrate them into my Next.js project.build_site# View specific screen details
npx @_davideast/stitch-mcp view --project <project-id> --screen <screen-id>
# Preview in browser (press 's' in interactive view)
# Or manually:
npx @_davideast/stitch-mcp snapshot -p <project-id> -s <screen-id> -o ./preview.html
open ./preview.html
# Get the HTML code for integration
npx @_davideast/stitch-mcp tool get_screen_code -d '{
"projectId": "<project-id>",
"screenId": "<screen-id>"
}'#!/bin/bash
# ci-build-stitch.sh
export STITCH_API_KEY="${STITCH_API_KEY}"
PROJECT_ID="123456"
# Generate site with predefined routes
npx @_davideast/stitch-mcp site -p "$PROJECT_ID" \
--config ./stitch-routes.json \
-o ./dist/stitch-site \
--non-interactive
# Deploy the generated site
cd ./dist/stitch-site
npm install
npm run buildstitch-routes.json{
"routes": [
{ "screenId": "home_abc", "route": "/" },
{ "screenId": "about_def", "route": "/about" },
{ "screenId": "contact_ghi", "route": "/contact" }
]
}gcloud projects get-iam-policy <PROJECT_ID> \
--flatten="bindings[].members" \
--filter="bindings.members:user:your-email@example.com"gcloud billing projects describe <PROJECT_ID>gcloud beta services mcp enable stitch.googleapis.com --project=<PROJECT_ID>npx @_davideast/stitch-mcp doctor --verboseinithttps://accounts.google.com/tmp/stitch-proxy-debug.lognpx @_davideast/stitch-mcp init
# Copy the URL from terminal output and open in browsernpx @_davideast/stitch-mcp logout --force --clear-config
npx @_davideast/stitch-mcp initnpx @_davideast/stitch-mcp doctor --verbosenpx @_davideast/stitch-mcp logout --force
npx @_davideast/stitch-mcp initgcloud config get-value project
gcloud billing projects describe $(gcloud config get-value project)npx @_davideast/stitch-mcp proxy --debugtail -f /tmp/stitch-proxy-debug.logcat ~/.config/claude/claude_desktop_config.json | jq .toolnpx @_davideast/stitch-mcp tool <tool-name> -secho '{"projectId":"123"}' | jq .npx @_davideast/stitch-mcp tool list_projectsnpx @_davideast/stitch-mcp view --projects# Clone and install
git clone https://github.com/davideast/stitch-mcp.git
cd stitch-mcp
bun install
# Run locally
bun run dev init
# Run specific command
bun run dev serve -p <project-id>
# Run tests
bun test
# Build
bun run build
# Verify package
bun run verify-packI have a Stitch project (ID: 456789) with these screens:
- Landing page: screen_landing_001
- Features page: screen_features_002
- Pricing page: screen_pricing_003
Please use the build_site tool to generate a site with:
- Landing at /
- Features at /features
- Pricing at /pricing
Then show me how to integrate the HTML into my existing React project.Get the HTML code for screen abc123 from project 456789 using get_screen_code.
Then analyze the CSS and suggest improvements for mobile responsiveness.For project 456789, use get_screen_image to export all screen screenshots as base64.
Save them to a design-assets/ directory for our design system documentation.