MCP Shipyard
← Rules catalog

MCP app widget loads external origins but declares no CSP (_meta.ui.csp)

A widget whose HTML loads external scripts, images or APIs needs _meta.ui.csp with connectDomains and resourceDomains, or the host blocks them.

majorapps.csp-missingChatGPT, Claude

Declare _meta.ui.csp on the widget resource, with connectDomains for API calls and resourceDomains for scripts, styles, images and fonts. The rule apps.csp-missing is a major finding for ChatGPT and Claude.

What you see

  • A scan reports apps.csp-missing with the template URI and the origins found: "HTML uses https://cdn.acme.example but no CSP is declared."
  • In the host, the external request is likely blocked and the widget renders partly or blank. The exact visible symptom per client is not verified here.

Why it happens

The scan reads each ui:// template, finds absolute URLs in script, link, img, source, video, audio and iframe tags, CSS url() and @import, plus fetch, XMLHttpRequest-style, WebSocket, EventSource and sendBeacon calls with absolute URLs. If any exist and no CSP is declared (neither _meta.ui.csp nor the older openai/widgetCSP), it reports this rule.

The MCP Apps specification says that when csp is omitted, the host must use a restrictive policy starting with default-src 'none'; and including connect-src 'none';. Network requests and external origins for scripts, styles, images and media are blocked; only same-origin resources, inline scripts and styles, and data: images and media are allowed. OpenAI's UI guide says to "Declare the exact domains the component connects to or loads resources from."

Check it yourself

curl -s -X POST https://mcp.acme.example/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"jsonrpc":"2.0","id":1,"method":"resources/read","params":{"uri":"ui://widget/orders.html"}}' > r.json
jq -r '.result.contents[0].text' r.json | grep -o -E 'https?://[^"'"'"' )]+' | sort -u
jq '.result.contents[0]._meta.ui.csp' r.json

Origins in the first list with null in the second is this finding.

Fix

{
  "_meta": {
    "ui": {
      "csp": {
        "connectDomains": ["https://api.acme.example"],
        "resourceDomains": ["https://cdn.acme.example"]
      }
    }
  }
}

Or bundle the assets into the template and call your API through tools, leaving nothing external. Keep each list as narrow as possible; wildcards are covered by apps.csp-wildcard.

Verify

Re-run the commands, re-scan, then check that every origin is listed. apps.csp-undeclared-domain reports ones you missed.

Which clients care

ChatGPT and Claude, per the rule.

Source

OpenAI UI guide: https://developers.openai.com/plugins/build/chatgpt-ui

MCP Apps specification: https://github.com/modelcontextprotocol/ext-apps/blob/main/specification/2026-01-26/apps.mdx

Run a free scan at https://mcpshipyard.com/scan to check every rule at once.

Check every rule at once

A free scan runs this check and the other 152 against your live URL.

Scan a server