Three.js MCP Apps Preview
Build an interactive preview as a bounded tool UI, not as a general remote-code execution environment. Start with a compact scene contract and accessible text fallback.
Workflow
- Define the scene inputs, allowed assets, interaction model, rendering budget, target host, and a non-canvas fallback before implementation.
- Use MCP Apps
ui://resources with restrictive CSP and typed tool inputs. Keep scene code, assets, and URLs allowlisted rather than evaluating arbitrary model-generated JavaScript. - Pause animation when hidden, cap DPR/texture/model budgets, release GPU resources, and provide reduced-motion behavior.
- Validate screenshots, nonblank canvas, keyboard controls, mobile fallback, CSP behavior, and tool-result provenance before release.
Guardrails
- Treat the official Three.js MCP Apps example as a reference implementation, not a production-ready code copy.
- Do not fetch arbitrary model URLs or execute user/model supplied scene code.
- Keep MCP App UI actions separate from account, asset-publishing, or deployment permissions.