Cloud agents cannot access CDNs - even if host allowed or firewall completely disabled. #178826
-
|
or : How can I use Cloud Agent + MCP Playwright + a CDN to serve ESMs ? Setup:
Expected :page to load including modules from CDN ActualWorking:
Not Working:
This results in No editor functionality Reported by agent:CDN Errors Detected
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
|
Hello, @Josverl 👋 This problem most likely arises because MCP Playwright environments and other GitHub Cloud Agents operate in sandboxed, restricted environments that prevent external network requests, including CDNs—even if: permit the configuration of hosts or URLs, or The firewall for the project is turned off. Why does this occur? Cloud Agents cannot freely retrieve external JavaScript from CDNs because they are built for secure, deterministic builds and tests. Currently, CDNs are not even able to access the outbound internet through "allowed hosts" settings. All ESM services (such as esm.sh, unpkg, jsDelivr, etc.) are subject to this restriction. Solutions: Bundle the dependencies locally: Rather than depending on esm.sh, download and serve the modules locally using a build tool (such as Vite, Webpack, or Rollup). Utilise local ESM mirrors: Update the import paths and host a local copy of the necessary ESM modules in your repository. Playwright and Cloud Agent tests must load from the same origin, so stay away from CDN dependencies. In conclusion, cloud agents are unable to retrieve code from public CDNs due to security and isolation concerns. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Cross-linking — same root cause thread continues at #179594. GitHub's official docs confirm the custom allowlist is Bash-tool-only and does not govern MCP servers (quoted in my comment there). The |
Beta Was this translation helpful? Give feedback.


For anyone landing here via search, quick consolidation of where this landed and a cleaner variant of LukeSavefrogs's fix.
Three separate things are at play and they don't overlap the way you'd expect:
PLAYWRIGHT_MCP_ALLOWED_ORIGINS/PLAYWRIGHT_MCP_ALLOWED_HOSTSenv vars are ignored by the default Playwright MCP that Copilot spawns on hosted agent. That's the trap, setting them looks right but has no effect.--allowed-hostsCLI flag is the one that actually controls what the MCP visits.Since the first two don't work on hosted Cloud Agent, the fix is to…