HolyStitch
HolyStitch compiles a Google Stitch project into a working Next.js codebase by fetching screens via the Stitch API and generating React + Tailwind files.
What is HolyStitch?
HolyStitch is an MCP (Model Context Protocol) tool that compiles a Google Stitch project into a working Next.js codebase. Instead of asking a model to “guess” a conversion, it reads your Stitch project via the Stitch API and generates complete JSX/Next.js output files.
Its core purpose is to turn Stitch screens into a React/Next.js project on disk in a deterministic way, including component structure, styling setup, and preserved source HTML for reference—so you can review the result and complete any remaining checklist items.
Key Features
- Stitch API ingestion (by project ID): Fetches every screen from your Stitch project using the Stitch API, using a Stitch project ID you provide.
- Structured React compilation (not prompting): Parses components based on Stitch-embedded HTML markers (e.g.,
<!-- ComponentName -->) and writes valid React JSX. - Deterministic Next.js project output: Produces a Next.js project directory containing
app/,components/, and supporting files, ready to install and run. - Shared component extraction and deduplication: Detects components shared across multiple screens and writes them once in
components/instead of duplicating them per page. - Tailwind theme extraction: Extracts the exact Tailwind theme configuration, including colors, fonts, and dark mode settings, and writes it to
tailwind.config.js. - JSX/HTML edge-case handling: Performs common JSX-safe conversions and normalization, including
class→className,for→htmlFor, conversion of inline style strings into style objects (includingurl(),calc(),var(), andfont-variation-settings), correct icon font rendering (e.g., Material Symbols/Icons), escaped code blocks inside<pre><code>, and duplicate attribute handling.
How to Use HolyStitch
- Build the tool locally
- Clone and build:
git clone https://github.com/BaselAshraf81/holystitchcd holystitchnpm installnpm run build
- Note the full path to the built folder (e.g.,
/Users/alice/holystitch).
- Clone and build:
- Get a Stitch API key
- Copy your API key from your Stitch project settings.
- Configure your MCP host (Claude Desktop / Cursor / Windsurf / other MCP hosts)
- Point the MCP host to the built package (using the built
dist/index.jspath) and setSTITCH_API_KEY. - Example for Claude Desktop:
- Add an entry to
claude_desktop_config.jsonwithcommand: "node",args: ["<full path>/dist/index.js"], andenv: { "STITCH_API_KEY": "your-api-key-here" }.
- Add an entry to
- Point the MCP host to the built package (using the built
- Provide your Stitch project ID
- Use the project ID from the Stitch URL (the repo documentation shows it as part of
https://stitch.withgoogle.com/project/<projectId>).
- Use the project ID from the Stitch URL (the repo documentation shows it as part of
- Run the conversion
- Ask your AI assistant (connected to the MCP server) to convert the Stitch project ID into a Next.js app at the destination folder.
- The tool writes the project files to disk; the AI can then help with follow-up checklist items (like routing, fonts, or any remaining edge-case JSX) that require human review.
Use Cases
- Convert existing Stitch landing pages into a Next.js app: Compile Stitch screens into React components and
app/routes so the design becomes runnable code. - Handle large multi-screen Stitch projects with shared UI: Use component deduplication to extract repeated sections (e.g., nav bars, footers, hero sections) into shared components.
- Preserve styling configuration exactly: Extract the same Tailwind theme (colors, fonts, and dark mode config) into
tailwind.config.jsrather than recreating styles manually. - Reduce LLM guesswork in HTML-to-JSX conversion: Rely on the compiler’s specific JSX safety rules (attribute renames, inline style parsing, escaped code blocks) to avoid common conversion failures.
- Generate a reviewed codebase for iterative development: Start from a generated Next.js project (with
stitch-source/preserved for reference) and then adjust functionality and routing with your own development workflow.
FAQ
-
Does HolyStitch use AI tokens to convert my Stitch project? The repository description states it is “compiled, not prompted” and claims “zero tokens” for the conversion itself.
-
What do I need to provide to run a conversion? You provide a Stitch project ID and set
STITCH_API_KEYin your MCP host configuration. -
What framework does it generate? The documented default output is a Next.js project. The tool also mentions an option to use
viteas a framework, though Next.js is the primary focus in the output examples. -
What ends up in the generated folder? The example output includes
components/,app/,stitch-source/(original HTML kept for reference),tailwind.config.js, and project configuration files likepackage.jsonandtsconfig.json. -
Can it convert only certain screens? The documented options include a
screenIdssetting that can be used to pass specific screen IDs to convert a subset; the default is “all screens.”
Alternatives
- Manual Stitch-to-React conversion: Rebuild components and Tailwind styles by hand. This can work for small projects but typically takes longer and is more error-prone for JSX attribute edge cases.
- Prompt-based HTML-to-React/Next.js conversion with an AI assistant: Send the exported HTML/markup to an LLM for transformation. Unlike a compiler approach, it may require more iteration to correct className/attribute issues and duplicated structures.
- Generic template generators for design-to-code: Use tools that scaffold React/Next.js code from design assets. These may not preserve Stitch-specific component structure, Tailwind theme details, or embedded markers the way a Stitch-aware compiler does.
- Component-first UI reimplementation: Treat each screen as a separate implementation task in React and build shared components yourself. This gives maximum control but shifts the conversion work entirely to development rather than generation.
Alternatives
Pixso
Pixso is a next-generation AI-native UI design tool that allows users to generate design drafts and code with a single click, serving as a domestic alternative to Figma.
Cosmic CLI
Cosmic CLI is an AI-powered command-line tool to build apps, manage Cosmic content, deploy to Vercel, and orchestrate AI agents from your terminal.
Devin
Devin is an AI coding agent that helps software teams complete code migrations and large refactoring by running subtasks in parallel.
imgcook
imgcook is an intelligent tool that converts design mockups into high-quality, production-ready code with a single click.
Rork
Rork creates complete, production-ready mobile apps from your description with AI and Expo (React Native)—from idea to working app fast.
Claude Opus 4.5
Introducing the best model in the world for coding, agents, computer use, and enterprise workflows.