cocos_screenshot_preview
Capture PNG screenshots of running Cocos Creator previews to visually verify UI rendering and iterate on game development with actual browser feedback.
Instructions
Capture a PNG screenshot of a running preview URL via Playwright.
Closes the visual-feedback loop for AI clients — after
cocos_build + cocos_start_preview call this to see what
the browser actually rendered and iterate on UI with sight,
not guesswork.
wait_ms gives the page time to run scripts after
networkidle fires — Cocos's web build finishes asset
loading before the first frame draws, so the default 500ms
covers most scenes. Bump for heavy 3D scenes.
OPTIONAL DEPENDENCY: needs playwright + the chromium
browser binary. Install with::
uv pip install playwright
playwright install chromiumReturns the PNG as an MCP Image, shown inline in the chat.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | http://localhost:8080/ | |
| viewport_width | No | ||
| viewport_height | No | ||
| wait_ms | No | ||
| full_page | No | ||
| timeout_ms | No |