TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/BaselAshraf81/holystitch/llms.txt
Use this file to discover all available pages before exploring further.
convert_stitch_to_react tool is the single entry point exposed by the HolyStitch MCP server. It accepts Stitch screens either by fetching them from the Stitch API (via projectId) or by receiving raw HTML directly (via htmlScreens), then compiles and writes a full Next.js or Vite project to disk — deterministically, with no AI tokens spent on the conversion itself.
You must provide either
projectId (requires STITCH_API_KEY) or htmlScreens. Providing neither returns an error.Input parameters
The Stitch project ID, found in your Stitch project URL. When provided, HolyStitch fetches all screens (or the subset specified by Use this or
screenIds) from the Stitch API.Requires the STITCH_API_KEY environment variable to be set in your MCP config:htmlScreens — not both.An optional list of screen IDs to convert. When omitted, all screens in the project are converted. Only valid when
projectId is also provided.Pass HTML screens directly instead of fetching from the Stitch API. Each element becomes one page in the output project. Use this when you already have the HTML or when
STITCH_API_KEY is not available.Directory to write the generated project into. Defaults to the current working directory. Pass a relative name like
"my-app" to create a sub-folder, or an absolute path.The React framework to target.
"nextjs"— generates an App Router project withapp/layout,next.config.js,app/layout.tsx, andnext/font/googleoptimization."vite"— generates asrc/-based project with hash routing viasrc/App.tsx.
Output language. TypeScript generates
.tsx/.ts files with typed component interfaces; JavaScript generates .jsx/.js files.CSS approach. Currently only
"tailwind" is supported. The Tailwind theme is extracted directly from the Stitch HTML and written into tailwind.config.js.Response
The tool returns a JSON object. After it returns, readproject-context.md immediately — it contains the routing table, a fix checklist, and instructions for completing the conversion.
A human-readable one-line summary of what was converted, e.g.
"Converted 3 screens into 14 components and 3 pages".The absolute path to the directory where all project files were written.
Total number of files written to disk, including components, pages, config files, and source HTML reference files.
One entry per screen converted.
All component files written, including nested child components.
Component names that appear on two or more screens. These are written once and imported by every page that uses them. Changes to a shared component affect all pages.
true if a tailwind.config block was found in the Stitch HTML and extracted into tailwind.config.js. false means the default Tailwind theme was used — you may need to add custom colors manually.true if any custom CSS was found in <style> blocks in the Stitch HTML and written into globals.css.Paths to the original HTML files written to
stitch-source/ for AI reference, e.g. ["stitch-source/Home.html", "stitch-source/Pricing.html"]. These are the ground truth for pixel-accurate conversion.Structural warnings detected during conversion. Common warnings include:
- Unclosed tags — detected by counting open vs. close tags in a component; indicates HTML was cut at a comment boundary inside a nested element.
- Color token conflicts — the same Tailwind color token has different values on different screens; you must reconcile them in
tailwind.config.js. - Low-similarity component copies — a component with the same name appears on multiple screens but has different content; both versions are written separately (see similarity gating).
Examples
Convert a full project by projectId
Fetches all screens from a Stitch project and generates a Next.js TypeScript project in a sub-folder called my-app.
STITCH_API_KEY must be set in your MCP server environment config:
Convert specific screens by screenIds
Fetch only the Home and Pricing screens from a project, generating a Vite JavaScript project.
Pass raw HTML screens directly
Use this when you have the HTML already and do not want to set up the Stitch API key.TopNavBar appears on both screens and is detected as a shared component — it is written once to components/TopNavBar.tsx and imported by both page files.
What the tool writes
After a successful conversion, the output directory contains:Similarity gating
When the same component name appears on multiple screens, HolyStitch computes a Jaccard similarity score over word tokens in the two HTML fragments. If the similarity is below 70%, the versions are treated as distinct widgets that happen to share a label. The second version is written asComponentName + PascalCasedScreenName (e.g. FooterPricing) and a warning is added to warnings[]. If similarity is ≥ 70%, the first version is reused as a shared component.
After the tool returns
The generated project is scaffolded but not finished. Your AI assistant should:- Read
project-context.mdfrom top to bottom before touching any file. - Open every
stitch-source/*.htmlfile — these are the pixel-accurate reference. - For each component, locate the matching
<!-- ComponentName -->section in the source HTML and verify the JSX reproduces it faithfully. - Fix JSX errors (unclosed tags, style strings, fragments).
- Run
npm install && npm run buildand fix every error. - Start the dev server and compare each route visually against its source HTML.