stitch-mcp
Go MCP server for Google Stitch with resilient screen generation and automatic gcloud authentication
Install / Use
claude mcp add obinnaokechukwu -- npx -y github:obinnaokechukwu/stitch-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AutomationSupported Platforms
Skill content
View source on GitHubstitch-mcp
A Go MCP server that proxies Google Stitch API calls with resilient screen generation. It handles authentication, token refresh, and automatic recovery from connection drops during long-running screen generation requests.
Features
- Dynamic tool discovery — Fetches available tools from the Stitch API at startup
- Resilient screen generation — Automatically recovers from TCP connection drops (common during 2-10 min generation requests) by polling for new screens
- Automatic authentication — Uses gcloud Application Default Credentials with background token refresh and 401 retry
- Generation tracking — Virtual tools (
generation_status,list_generations) provide visibility into in-flight work - STDIO transport — Works with any MCP client (Claude Code, Claude Desktop, etc.)
How It Works
Screen generation (generate_screen_from_text) takes 2-10 minutes and the Stitch API frequently drops the TCP connection after ~60 seconds. The proxy handles this transparently:
- Snapshot existing screens via
list_screens - Fire the generation request (may succeed directly or connection may drop)
- Poll
list_screenson connection drop until a new screen appears - Return the new screen details to the client as if nothing happened
Prerequisites
- Go 1.23+
- gcloud CLI authenticated:
gcloud auth application-default login
Installation
go install github.com/obinnaokechukwu/stitch-mcp@latest
Or build from source:
git clone https://github.com/obinnaokechukwu/stitch-mcp.git
cd stitch-mcp
go build -o stitch-mcp .
Configuration
| Environment Variable | Description | Default |
|---|---|---|
| STITCH_API_KEY | API key (skips OAuth if set) | — |
| STITCH_HOST | Stitch API endpoint | https://stitch.googleapis.com/mcp |
| STITCH_PROJECT_ID | GCP project for billing | Auto-detected from gcloud |
| STITCH_DEBUG | Enable debug logging (1) | 0 |
Usage with Claude Code
Add to your MCP settings (~/.claude/settings.json):
{
"mcpServers": {
"stitch": {
"command": "stitch-mcp",
"env": {
"STITCH_DEBUG": "1"
}
}
}
}
Available Tools
From Stitch API (discovered dynamically):
create_project— Create a new Stitch projectlist_projects— List accessible projectsget_project— Get project detailslist_screens— List screens in a projectget_screen— Get screen detailsgenerate_screen_from_text— Generate a UI screen from a text prompt (resilient)
Virtual tools (proxy-only):
generation_status— Check status of a screen generation by IDlist_generations— List all in-flight and recent generations
License
Apache 2.0 — see LICENSE
Related Skills
momen-cursurrules-prompt-file
40.6kCursor rules for building custom frontends with Momen.app as headless BaaS with GraphQL API, actionflows, AI agents, and Stripe integration.
pyspark-etl-best-practices-cursorrules-prompt-file
40.6kCursor rules for PySpark ETL development with code style, joins, window functions, map operations, and Iceberg patterns.
semiotic-react-dataviz-cursorrules-prompt-file
40.6kCursor rules for Semiotic data visualization library with 30+ chart types, MCP server, and AI-assisted chart generation.
Agent-Reach
71.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
