Skip to main content
Glama
stitch-bridge
by jlhernando

stitch-bridge

MCP server that gives AI coding agents the ability to design UIs through Google Stitch.

Your agent describes what it wants. Stitch generates production-ready HTML. stitch-bridge handles everything in between.

How it works

Your AI Agent  <-->  stitch-bridge (MCP)  <-->  Google Stitch SDK  -->  HTML / Screenshots

stitch-bridge runs as a local Model Context Protocol server over stdio. Any MCP-compatible client (Claude Code, Cursor, Windsurf, etc.) can connect to it and use 9 tools to create, edit, and manage UI designs, all through natural language prompts.

The Stitch SDK handles the actual generation using Gemini models. stitch-bridge fetches the results (HTML source, base64 screenshots) and returns them directly to the agent, so it can inspect, iterate, or save the output without leaving its workflow.

Related MCP server: Stitch-MCP

Quick start

1. Get a Stitch API key

Sign up at stitch.google.com and grab your API key.

2. Add to your MCP client

Add to your MCP config (e.g. .mcp.json, claude_desktop_config.json, or your editor's MCP settings):

{
  "mcpServers": {
    "stitch-bridge": {
      "command": "npx",
      "args": ["-y", "stitch-bridge"],
      "env": {
        "STITCH_API_KEY": "your-api-key"
      }
    }
  }
}

Or install globally:

npm install -g stitch-bridge

Then configure with command: "stitch-bridge" instead of using npx.

3. Use it

Ask your agent to design something:

"Create a project and generate a mobile login screen with email and Google sign-in"

The agent will call create_project, then generate_screen, and return the full HTML.

Tools

Tool

Description

Required params

list_projects

List all accessible projects

-

create_project

Create a new project

-

generate_screen

Generate UI from a text prompt

projectId, prompt

edit_screen

Edit an existing screen

projectId, screenId, prompt

generate_variants

Create 1-5 design alternatives

projectId, screenId, prompt

list_screens

List screens in a project

projectId

get_screen_html

Get full HTML of a screen

projectId, screenId

get_screen_image

Get base64 screenshot

projectId, screenId

build_site

Assemble multi-page site from screens

projectId, routes

Options

Device types: MOBILE, DESKTOP, TABLET, AGNOSTIC

Models: GEMINI_3_PRO, GEMINI_3_FLASH (default)

Both are optional parameters on generate_screen, edit_screen, and generate_variants.

Output

Every tool returns JSON. The key outputs:

Generated screens return the full HTML source inline:

{
  "projectId": "proj-abc",
  "screenId": "scr-123",
  "html": "<!DOCTYPE html><html>..."
}

Screenshots return base64-encoded images:

{
  "screenId": "scr-123",
  "base64": "iVBORw0KGgo...",
  "mimeType": "image/png"
}

Multi-page sites return HTML per route:

{
  "projectId": "proj-abc",
  "pages": [
    { "route": "/", "screenId": "scr-1", "html": "..." },
    { "route": "/about", "screenId": "scr-2", "html": "..." }
  ]
}

Configuration

Environment variable

Description

STITCH_API_KEY

Stitch API key (recommended)

STITCH_ACCESS_TOKEN

Alternative: OAuth access token

One of the two is required.

Development

npm install
npm run build      # Compile TypeScript
npm run dev        # Watch mode
npm test           # Run tests
npm start          # Run the MCP server

Requires Node.js >= 18.

License

MIT

Available Tools

9 tools
build_siteA

Build a multi-page site from a project by mapping screens to URL routes. Returns HTML for each page.

Inputs: routes (required), projectId (required).

create_projectB

Create a new Stitch project (container for UI designs).

Inputs: title.

edit_screenB

Edit an existing screen using a text prompt. Returns updated screen ID and HTML.

Inputs: prompt (required), screenId (required), projectId (required), modelId, +1 more.

generate_screenA

Generate a new UI screen from a text prompt. Returns the screen ID and full HTML content.

Inputs: prompt (required), projectId (required), modelId, deviceType.

generate_variantsA

Generate 1-5 design variants of an existing screen. Returns array of screen IDs and HTML.

Inputs: prompt (required), screenId (required), projectId (required), count, +2 more.

get_screen_htmlA

Get the full HTML content of a screen. Returns the actual HTML code, not just a URL.

Inputs: screenId (required), projectId (required).

get_screen_imageA

Get a screenshot of a screen as base64-encoded image.

Inputs: screenId (required), projectId (required).

list_projectsA

List all Stitch projects accessible to the user.

Inputs: no named parameters.

list_screensB

List all screens in a Stitch project.

Inputs: projectId (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct resource-action pair: projects vs screens, and create/edit/list/get/build each have clear separation. No two tools appear to do the same thing, even generate_screen and edit_screen are differentiated by new vs existing.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun snake_case pattern (list_projects, create_project, generate_screen, edit_screen, etc.). The naming is predictable and uniform across the entire set.

    Tool Count5/5

    With 9 tools, the set is well-scoped for a UI design/build server. Each tool covers a necessary operation without redundancy or bloat, fitting comfortably in the ideal 3-15 range.

    Completeness4/5

    The set covers core lifecycle operations for projects and screens, including creation, retrieval, editing, and site building. Minor gaps exist, such as no delete operations for projects or screens, but these are workaround-able and not critical for the primary workflow.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A universal MCP server for Google Stitch that enables AI-powered UI/UX design generation by extracting design context and metadata from existing screens. It allows users to fetch screen code and images to create consistent, styled UI components across multiple projects.
      703 npm
      121
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that exposes Google Stitch's AI-powered UI design capabilities as local tools. It enables project management, screen generation/editing, and design system operations by forwarding requests to Google's Stitch API.
      2
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that enables AI coding agents to read and write to a local-first HTML/CSS design canvas, bridging visual design and code generation.
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An 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).
      17
      18 npm
      9
      MIT