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.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "cocos_screenshot_preview"
}
}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 |