Uses Google authentication to manage access to Stitch projects and facilitate automated setup for design-focused AI workflows.
Provides tools for interacting with the Google Cloud Stitch API, enabling automated UI design generation, project and screen management, and the extraction of frontend code and design systems.
Click on "Install 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 AutoGenerate a responsive mobile login screen and run an accessibility audit"
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 Auto π¨
One command. Instant UI. The most automated MCP server for Google Stitch.
π‘ Just share this link with your AI: https://github.com/GreenSheep01201/stitch-mcp-auto
Why stitch-mcp-auto?
Feature | stitch-mcp | stitch-mcp-auto |
Setup time | ~30 min (manual) | ~2 min (wizard) |
gcloud config | Manual | Automatic |
MCP registration | Manual | Automatic |
Multi-CLI support | β | β Claude/Gemini/Codex |
AI image generation | β | β Gemini 3 Pro |
Custom commands | β | β 7 workflows |
Features:
Auto Setup - One command installs everything (gcloud auth, API enable, MCP config)
Multi-CLI Support - Works with Claude Code, Gemini CLI, Codex CLI
19 Custom Tools + Stitch Core - Design generation, accessibility checks, tokens, responsive variants, and design system export
7 Workflow Commands -
/design,/design-system,/design-flow,/design-qa,/design-export,/generate-asset,/design-fullπ¨ AI Image Generation - Generate logos, icons, hero images via Gemini 3 Pro (uses Antigravity - Google's experimental image generation API)
π Orchestration Mode - One prompt to generate assets + complete UI design
π i18n Support - Auto-detects system language (English/Korean) for setup wizard and console messages
Table of Contents
Prerequisites (Install These First)
1. Install Node.js (v18 or higher)
Windows
macOS
Linux / WSL
Verify Node.js installation:
2. Install Google Cloud CLI (gcloud)
Windows
Option A: Installer (Recommended)
Download from Google Cloud SDK
Run the installer (check "Run gcloud init" option)
Restart your terminal
Option B: PowerShell
macOS
Linux / WSL
Verify gcloud installation:
Quick Start
After installing Node.js and gcloud CLI:
The setup wizard will:
Open a web-based setup page at
http://localhost:51121Guide you through Google login
Help you select or create a project
Enable the Stitch API
Save your configuration
Note: When starting the MCP server directly (
npx stitch-mcp-autoor via your editor), the setup wizard runs onhttp://localhost:8086.
π€ AI Agent Note (WSL Environment): If running in WSL, the browser cannot open automatically. Open the URL shown in the terminal (usually
http://localhost:51121forsetup.js, orhttp://localhost:8086when the MCP server starts) in your Windows browser:# Run this in PowerShell (not WSL terminal) Start-Process "http://localhost:51121" # If you see 8086 instead: Start-Process "http://localhost:8086"Or instruct the user to manually open the shown URL in their Windows browser.
AI Agent Quick Start (Semi-Automated)
This repo supports semi-automated setup with a few unavoidable manual steps (OAuth login).
Checklist (agent-friendly):
Run setup:
npm run setup(ornpx -p stitch-mcp-auto stitch-mcp-auto-setup)Open the URL shown in terminal (usually
http://localhost:51121)Complete Google login in the browser (gcloud + Stitch API enable)
β οΈ CRITICAL: Verify MCP registration (see below)
Start server:
npm startor let the editor launch it
Manual-only steps:
Browser OAuth consent (Google login)
WSL browser opening (must open URL manually)
Environment-specific commands:
Windows (PowerShell):
Open setup URL:
Start-Process "http://localhost:51121"(orhttp://localhost:8086)
macOS:
Open setup URL:
open "http://localhost:51121"(orhttp://localhost:8086)
Linux:
Open setup URL:
xdg-open "http://localhost:51121"(orhttp://localhost:8086)
WSL (Windows host):
Run in Windows PowerShell:
Start-Process "http://localhost:51121"
β οΈ Post-Installation MCP Verification (REQUIRED)
After setup completes, always verify that the MCP server is registered:
If , manually register:
CLI | Manual Registration Command |
Claude Code |
|
Gemini CLI |
|
Codex CLI |
|
Why verification is needed: The setup wizard writes directly to config files (
~/.claude.json,~/.gemini/settings.json,~/.codex/config.toml), but verification ensures the configuration is correct. Always verify to avoid "MCP server not found" errors.
Other Verification (optional):
node auth.js --status(shows token + project status)npm start(server boots and prints "Ready")
Manual Installation (Alternative)
Step 1: Run Auto Setup
Or if you cloned the repository:
Setup Process
Welcome Page - Click "Login with Google" button
Google Login - A new browser window opens for authentication
After login, you may see "Connection refused" page - just close it
The setup page will automatically detect your login
Project Selection - Choose an existing project or create a new one
API Activation - Click the button to enable Stitch API
Wait for activation (may take a few seconds)
Complete - Copy the MCP configuration to your editor
β οΈ WSL Users - IMPORTANT: WSL cannot open browsers directly. When the setup wizard starts:
Copy the URL
http://localhost:51121Open it manually in your Windows browser (Chrome, Edge, etc.)
Or run in PowerShell:
Start-Process "http://localhost:51121"The authentication will work because WSL shares localhost with Windows.
Step 3: Configure MCP Client
After setup completes, add the configuration to your MCP client.
Claude Desktop
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Claude Code
π Method 1: CLI Command (Recommended)
The setup wizard automatically writes to ~/.claude.json.
To add manually via CLI:
Or edit ~/.claude.json directly:
π Method 2: Per-project Settings
Create .mcp.json in your project root:
Gemini CLI
π Method 1: CLI Command (Recommended)
Or edit ~/.gemini/settings.json directly:
Codex CLI
π Method 1: CLI Command (Recommended)
Or edit ~/.codex/config.toml directly:
Cursor
Go to Settings > MCP > Add New Server and add:
Command:
npxArgs:
-y stitch-mcp-autoEnvironment:
GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID
Optional: GOOGLE_CLOUD_PROJECT is only used for Stitch image fallback and auth.js --status. The setup wizard stores the active project in ~/.stitch-mcp-auto/config.json, and workspace tools save .stitch-project.json in your current folder.
Available Tools
π Automatic Project Management (NEW)
No more manual projectId passing! The server automatically manages project context:
Auto-detection: When you call tools like
generate_screen_from_textwithoutprojectId, it automatically uses the workspace projectAuto-save: When you
create_project, it's automatically saved to.stitch-project.jsonin your current folderSession continuity: Return to the same folder later, and your project is automatically loaded
How it works:
Manual workspace tools (optional):
Tool | Description |
| π Check current workspace project status |
| πΎ Manually associate a project with the workspace |
| ποΈ Clear workspace project association |
Core Stitch Tools (API + convenience wrappers)
Tool | Description |
| Creates a new Stitch project. A project is a container for UI designs and frontend code. |
| Retrieves the details of a specific Stitch project using its project name. |
| Lists all Stitch projects accessible to the user. By default, it lists projects owned by the user. |
| Lists all screens within a given Stitch project. |
| Retrieves the details of a specific screen within a project. |
| Generates a new screen within a project from a text prompt. |
| Retrieves the actual HTML/Code content of a screen. |
| Retrieves the screenshot/preview image of a screen. |
π¨ Professional Web Design Tools
Design Consistency Tools
Tool | Description |
| Extracts design DNA (colors, typography, spacing, components) from an existing screen for visual consistency across multiple screens. |
| Generates a new screen using a previously extracted design context to maintain visual consistency. |
| Compares two screens to identify design differences, inconsistencies, and suggest harmonization. |
Productivity Tools
Tool | Description |
| Generates design tokens (CSS variables, Tailwind config, SCSS, JSON) from a screen's design. |
| Creates responsive variants of an existing screen for different device types. |
| Generates multiple related screens in a single operation with consistent design. |
Quality & Analysis Tools
Tool | Description |
| Analyzes a screen for WCAG 2.1 accessibility compliance with actionable recommendations. |
| Extracts reusable UI component patterns (buttons, cards, forms) with their styles. |
Design Enhancement Tools
Tool | Description |
| Applies 2024-2025 UI trends (glassmorphism, bento-grid, gradient-mesh, etc.) to screen generation. |
| Generates a comprehensive style guide/design documentation from an existing design. |
| Exports a complete design system package (tokens, components, docs) for developer handoff. |
π¨ AI Image Generation Tools (v1.1.0)
These tools have different authentication requirements:
Tool | Auth Required | Description |
| Antigravity | Generate design assets (logo, icon, illustration, hero, wireframe, background, pattern) using Gemini models. Requires Antigravity authentication. Supports model selection (gemini-3-pro, gemini-2.5-pro) and forced auth. |
| Stitch + Antigravity | Full orchestration: auto-generates assets (logo, icons, hero) then creates complete UI. Stitch-only users can generate UI pages without custom assets. |
| None | Check Antigravity OAuth authentication status for image generation features. |
Supported Models for Image Generation
Model | Status | Image Generation | Description |
| β Available | β Supported | Default. Latest Gemini 3 Pro model with image generation |
| β Available | β Supported | Gemini 2.5 Pro model with image generation |
See also:
ANTIGRAVITY-MODELS.md(EN) /ANTIGRAVITY-MODELS.ko.md(KO) for the full model list, thinking variants, and endpoint details.
π‘ Model Selection: You can specify a model when calling
generate_design_asset:{ "assetType": "logo", "prompt": "Modern tech company logo", "model": "gemini-3-pro" }
Key parameters (
assetType: logo, icon, illustration, hero, wireframe, background, patternaspectRatio: 1:1, 16:9, 9:16, 4:3, 3:4saveToFile:trueby default (saves to current directory)forceAntigravityAuth:trueto trigger browser login
π Role Separation:
Stitch API (gcloud auth): UI page/screen generation - available to all users
Antigravity OAuth: Image asset generation (logo, icon, hero) - requires separate authentication
Stitch-only users can still create complete UI pages using
generate_screen_from_text. Antigravity extends this with custom AI-generated assets.
π² Background Removal (NEW)
generate_design_asset supports automatic background removal for transparent assets:
Parameter | Type | Default | Description |
| boolean |
| Enable automatic background removal |
|
|
|
|
| number |
| Threshold for detection (0-255). Higher = more aggressive. |
Example:
This produces a transparent PNG, ideal for:
Logos - No white border when placed on colored backgrounds
Icons - Clean integration into UI designs
Illustrations - Seamless overlay on any background
MCP Prompts (Auto-Discovered)
MCP Prompts are automatically available when the server is connected - no installation required. These appear in your MCP client's prompt list.
Prompt | Description |
| Smart UI design generation with automatic style detection |
| Create new screens while maintaining design consistency |
| Generate multiple screens for complete user flows |
| Accessibility (WCAG 2.1) and design quality checks |
| Export design system packages for developer handoff |
Usage in Claude Code:
Note: MCP Prompts include detailed workflow instructions that guide the AI through complex design tasks automatically.
Custom Commands (Multi-CLI Support)
When you run npx -p stitch-mcp-auto stitch-mcp-auto-setup, the setup wizard automatically installs custom commands for all major AI CLI tools - Claude Code, Gemini CLI, and Codex CLI.
Supported CLIs
CLI | Command Format | Installation Path |
Claude Code |
|
|
Gemini CLI |
|
|
Codex CLI |
|
|
Available Commands
Command | Claude Code | Gemini CLI | Codex CLI | Description |
design |
|
|
| Smart UI design generation |
design-system |
|
|
| Maintain design consistency |
design-flow |
|
|
| Generate user flows |
design-qa |
|
|
| Accessibility & quality checks |
design-export |
|
|
| Export design system |
generate-asset |
|
|
| AI image generation (v1.1.0) |
design-full |
|
|
| Full orchestration mode (v1.1.0) |
CLI Usage Examples
Claude Code:
Gemini CLI:
Codex CLI:
Commands Installation Location
Commands are automatically installed to all CLI directories:
Usage Examples
Create a New Project
Generate a Screen
Generate with Specific Style
Multi-language Support
The "Designer Flow"
For consistent UI across multiple screens:
Extract context from existing screen:
Get the design context from the Home Screen in project XGenerate new screen with same style:
Using that design context, generate a Settings screen with the same visual style
Using Design Tokens
Export design tokens for your development workflow:
Trending Design Generation
Apply modern UI/UX trends automatically:
Batch Screen Generation
Create multiple screens at once with consistent styling:
Accessibility Check
Ensure your designs are accessible:
Design System Export
Export for developer handoff:
AI Image Generation (NEW in v1.1.0)
Generate design assets with AI:
Full Design Orchestration (NEW in v1.1.0)
One prompt to complete design - automatically generates assets and creates UI:
Note: The orchestration mode automatically:
Analyzes required assets (logo, hero, icons)
Generates each asset using Gemini 3 Pro (requires Antigravity auth)
Creates complete UI screen with Stitch API
Returns all assets + final UI in one response
Without Antigravity auth: UI screen is still generated, but without custom image assets.
Troubleshooting
"gcloud: command not found"
Linux/macOS/WSL:
Windows: Restart your terminal after installing gcloud.
"Stitch API has not been used in project" Error
Enable the API manually:
Or visit: https://console.cloud.google.com/apis/library/stitch.googleapis.com?project=YOUR_PROJECT_ID
Token Expired / Authentication Error
Refresh your authentication:
Or re-run the setup:
"Connection Refused" After Google Login
This is normal behavior. After Google authentication completes, the browser redirects to localhost:8085 which is a temporary callback server that gcloud uses. Once authentication is complete, this server closes.
Solution: Simply close this tab and return to the setup page. It will automatically detect your login.
Browser Doesn't Open Automatically (WSL)
If the browser doesn't open automatically in WSL:
Copy the URL shown in the terminal
Paste it in your Windows browser manually
Complete the login
Return to the setup page
Full Reset
If something goes wrong, reset everything:
Architecture
π Role Separation:
Stitch API (gcloud): Handles all UI page/screen generation
Antigravity OAuth: Handles image asset generation (logo, icon, hero images)
Without Antigravity authentication,
generate_design_assetwill return an error. Use Stitch'sgenerate_screen_from_textfor UI pages.
File Structure
Configuration Files
File/Directory | Location | Purpose |
|
| OAuth access tokens (gcloud) |
|
| Antigravity OAuth tokens (optional) |
|
| Project settings |
| Workspace root (where you run the AI CLI) | Auto-saved project mapping for this workspace |
MCP Settings | ||
|
| Claude Code MCP servers (user scope) |
|
| Gemini CLI MCP servers |
|
| Codex CLI MCP servers (TOML format) |
Commands | ||
|
| Claude Code Commands (auto-installed) |
|
| Gemini CLI Commands (auto-installed) |
|
| Codex CLI Skills (auto-installed) |
Scripts
Command | Description | ||||
| Start MCP server ( | ||||
| Run setup wizard ( | ||||
`npm run auth -- --status | --login | --logout | --setup | --project ` | OAuth helper commands |
| Run interactive setup wizard | ||||
| Start MCP server (used by editors) | ||||
| Check authentication status | ||||
| Manual login | ||||
| Clear saved tokens | ||||
| Show OAuth setup guide | ||||
| Save project ID (optional) |
Requirements
Node.js: 18.0.0 or higher
Google Cloud CLI: Latest version
Google Account: With access to Google Cloud Console
MCP Client: Claude Desktop, Claude Code, Cursor, or compatible editor
Security Note
This project uses Google's public OAuth client for authentication. Client IDs visible in the source code are intentionally public (Desktop App type per OAuth 2.0 spec). Your tokens are stored locally in ~/.stitch-mcp-auto/ and never transmitted to third parties.
License
Apache 2.0 - Open source and free to use.
Credits
Author: GreenSheep01201 (Wongil Seo)
Based on: stitch-mcp by Kargatharaakash
Concept: Automated implementation of the MCP (Model Context Protocol) file stitching system.
Support
Issues: GitHub Issues
Documentation: Google Stitch API
Built with love for the AI community