Stitch-kit stitch-mcp-generate-screen-from-text
Generates a high-fidelity UI screen or wireframe from a text prompt using Stitch. This is the core text-to-UI generation tool — the heart of the Stitch workflow.
git clone https://github.com/gabelul/stitch-kit
T=$(mktemp -d) && git clone --depth=1 https://github.com/gabelul/stitch-kit "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/stitch-mcp-generate-screen-from-text" ~/.claude/skills/gabelul-stitch-kit-stitch-mcp-generate-screen-from-text && rm -rf "$T"
skills/stitch-mcp-generate-screen-from-text/SKILL.mdStitch MCP — Generate Screen from Text
Generates a UI design screen from a structured text prompt. This is the central action in any Stitch workflow — everything before it (spec generation, prompt assembly) is preparation, and everything after it (screen retrieval, code conversion) is follow-through.
Critical prerequisite
Only use this skill when the user explicitly mentions "Stitch" or when called from an upstream skill (e.g. stitch-ideate, stitch-orchestrator).
You must have a
projectId before calling this. If you don't have one:
- Create a new project via
stitch-mcp-create-project - Or find an existing project via
stitch-mcp-list-projects
When to use
- User asks to "design", "generate", "create", or "make" a screen using Stitch
- The orchestrator has assembled a prompt via
stitch-ui-prompt-architect - User provides specific visual requirements and wants a Stitch-generated result
Call the MCP tool
{ "name": "generate_screen_from_text", "arguments": { "projectId": "3780309359108792857", "prompt": "[Full structured prompt — see below]", "deviceType": "MOBILE", "modelId": "GEMINI_3_1_PRO" } }
Parameter reference
projectId
— numeric ID only, no projects/
prefix
projectIdprojects/✅ "3780309359108792857" ❌ "projects/3780309359108792857"
prompt
— use the [Context] [Layout] [Components]
structure
prompt[Context] [Layout] [Components][Context & Style] [Device] [Mode] [screen type] for [product]. [aesthetic]. [theme]. [colors]. [font]. [Layout] [Describe the structural arrangement] [Components] [Specific named UI components with details]
For best results, use the
stitch-ui-prompt-architect skill to assemble the prompt before calling this tool.
deviceType
deviceType| Value | Use when |
|---|---|
| Mobile app, phone-sized UI (default if uncertain) |
| Web dashboard, landing page, SaaS UI |
| Tablet-specific layout |
| Not tied to a specific device — responsive/fluid layout |
modelId
modelId| Value | Use when |
|---|---|
| Recommended — complex layouts, high fidelity |
| Fast iteration, wireframes, simple changes |
| Deprecated. Still works but will be removed. Use instead. |
After generating
This tool returns session info but not the actual screenshot/HTML. To retrieve the design:
- Call
withstitch-mcp-list-screens
to find the new screenprojects/[projectId] - Call
with thestitch-mcp-get-screen
andprojectId
to get the screenshot and HTMLscreenId
Prompt quality checklist
Before calling this tool, verify the prompt:
- Specifies device type consistently with
parameterdeviceType - Names specific components (not "some buttons" — "primary 'Sign In' button")
- Includes colors (hex codes or clear color names)
- Uses realistic content (not Lorem Ipsum)
- Specifies light or dark mode explicitly
Batch generation from full PRDs
When the prompt is a complete PRD document (product overview, design system, multiple screen specifications, build guide), Stitch will generate multiple screens in a single call — not just one. Stitch generates up to 10 screens per call. A PRD with 8 screen specs typically produces 5-7 screens automatically.
This is the same mechanism Stitch's web Ideate uses for "generate all screens". The PRD format acts as a comprehensive prompt that Stitch decomposes internally.
How to use batch generation:
-
Send the full PRD text as the
parameterprompt -
Stitch generates up to ~10 screens per call from a multi-screen PRD
-
Two possible outcomes depending on whether the MCP response times out:
If response returns with data:
- Check
for continuation suggestions (e.g. "Yes, make them all", "Generate remaining screens")output_components - Automatically call
again with the suggestion text as thegenerate_screen_from_text
— the user already initiated generation, no need to re-confirmprompt - Repeat until no more
suggestions appear (max 3 continuation calls to prevent infinite loops)output_components
If response returns empty (HTTP timeout):
- Generation is still running server-side — do NOT retry
- Wait 90-120 seconds, then call
to discover what was generatedlist_screens - If empty, wait another 60 seconds and retry the list call
- Generate any missing screens individually with focused prompts referencing the PRD's design system
- Check
Timing
Stitch generation takes 60–180 seconds for single screens and up to 5 minutes for multi-screen PRD generation. This is normal behavior, not a timeout.
- Do NOT retry during this window
- Do NOT assume failure if it takes > 60 seconds
- The MCP tool may return empty for long generations — check
afterwardlist_screens - If it fails: wait 90 seconds, check
, retry ONCE max if nothing appearedlist_screens - Each call creates a new generation — retries mean duplicate screens
References
— Desktop dashboard prompts (SaaS analytics, admin panel)examples/desktop.md
— Mobile app prompts (login, social feed, e-commerce)examples/mobile.md