Stitch MCP – Generate images for docs
Use the Stitch MCP (server:user-stitch) to generate logo and section images with the Pro model for best quality.
Image generation flow
-
Project
- Use an existing project from
list_projects, or create one withcreate_project. - For image-only outputs, a TEXT_TO_UI or TEXT_TO_UI_PRO project works (e.g. projectId
3286376044318738792).
- Use an existing project from
-
Generate screen (image)
- Tool:
generate_screen_from_text - Required:
projectId(string, noprojects/prefix),prompt(string). - Recommended for quality:
modelId:"GEMINI_3_PRO"(Pro model). - Optional:
deviceType(DESKTOP|MOBILE|TABLET|AGNOSTIC).
- Tool:
-
Download image to local
- Response includes
outputComponents[].design.screens[]withscreenshot.downloadUrl. - Luôn tải về và lưu local — không dùng HTTPS URL trực tiếp trong docs.
- Ví dụ:
curl -sL -o logo/ammh-logo.png "<downloadUrl>"hoặc lưu vàoimages/(vd:images/section-hedge.png).
- Response includes
-
Dùng trong docs
- Chỉ dùng đường dẫn local:
/logo/xxx.png,/images/xxx.png. - Logo site: cấu hình
docs.json→logo.light/logo.darktrỏ tới/logo/.... - Ảnh trong trang:
<img src="/images/xxx.png" alt="..." />hoặc.
- Chỉ dùng đường dẫn local:
Model IDs (Stitch)
There is no “banana” model in the schema; use GEMINI_3_PRO for the Pro model.
Notes
- Generation can take 1–2 minutes. Do not retry on connection errors; check with
list_screensorget_screenlater. - Screens with
screenType:"IMAGE"are image-only outputs.
