view.csp.
server.ts
Call an External API
connectDomains lists the origins the view may reach with fetch or XHR. Without it, a direct request from the view is blocked.
server.ts
api.myshop.com, so that origin is listed.
Your server’s origin is already in
connectDomains, so same-origin requests need no entry. In development, the dev server’s WebSocket origin is added too, for hot reload.Load External Assets
resourceDomains covers the static assets the browser loads from another origin: images, fonts, scripts, and stylesheets, whether from a CDN, a fonts provider, or any other host.
server.ts
cdn.myshop.com, so that origin has to be listed or they won’t render.
Your server’s origin is already in
resourceDomains, so assets served from it need no entry.Embed an Iframe
frameDomains lists the origins the view may embed in a nested iframe, like a map or a video player. Third-party iframes opt your app into stricter review when you submit it to a directory.
server.ts
www.youtube.com, so that origin is listed.
Redirect Off-App
redirectDomains lists the origins useOpenExternal can send the user to without the host’s safe-link confirmation modal.
server.ts
checkout.myshop.com to take payment; listing it skips the interstitial on the way out.
Verify Your CSP
To check your CSP, run your app in a real host through the tunnel, or let the Audit verify it before you submit.DevTools runs a loose policy, so CSP violations don’t surface locally: a view that loads in the emulator can still have its requests blocked in production.
Go Further
Create Views
Craft interactive UIs rendered in conversation
UX Design
Account for what makes an MCP App different
Audit
Validate before submission