WhoBuilt

Why MCP and ChatGPT Apps Use Double Iframes

Jun 15, 2026· 20 min· 8.4K views·Watch on YouTube

Speaker

Frédéric Barthelet, CTO and co-founder of MCP hosting company Alpic, explains how ChatGPT and MCP Apps use nested iframes, speaking at AI Engineer.

Apps add interactive views to conversations

Barthelet describes MCP Apps as a way for businesses to reach users through app stores and relevant chat conversations. Their views are small HTML interfaces tied to tool calls, with resources that hosts can discover in advance or fetch when needed.

Why a single iframe creates security tradeoffs

A view embedded with `srcdoc` inherits the host page’s origin and content security policy, which can block app scripts. Relaxing that policy could let scripts access the host’s storage and cookies. Sandboxing creates an opaque origin, but also removes origin-based features such as local storage.

How the double iframe isolates app views

Serving every app directly from its own domain would require the host to allow an ever-growing list of domains in its `frame-src` policy. Barthelet describes a shared loader hosted on a separate domain: it fetches the app content and places it in a `srcdoc` iframe inside that isolated context. Per-app subdomains keep origin-based storage separate, while a policy in the loader can restrict the app’s scripts and frames.

Declare domains and check CSP during development

App developers should list the domains their views use in MCP metadata so the host can apply the right policies. Barthelet’s Skybridge framework includes a CSP Inspector that compares declared domains with domains the view accesses. In his demo, an API request revealed a missing domain, which he added to the metadata.

Takeaways

  • Treat a view’s content security policy domains as part of its app metadata.
  • Test every API, script, image, and frame dependency in the host environment.
  • Use isolated per-app origins when views need storage or cookies.
  • Check domain access during development to catch policy gaps before submission.
  • Remember that iframe sandboxing can block origin-based browser features.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • built
    “At Alpic, we build an open-source framework called Skybridge.”
    YouTube
    Verified2 sources· Talk, Web· archived
  • founded
    Co-founder (CTO)
    “I'm the CTO and co-founder of Alpic”
    YouTube
    Verified4 sources· Talk, Web· archived
  • feature
    MCP app: Interactive UI views are rendered in an iframe following a tool call
    “Views are always rendered as the result of a tool call.”
    YouTube
    Unverified1 source· Talk
  • feature
    MCP app: View resource requirements are advertised in tool-list calls
    “all views are described in the tool-list calls that happen at the beginning of the conversation”
    YouTube
    Unverified1 source· Talk
  • uses
    nested iframes to render third-party UI
    “I was a bit surprised to find a double iframe, with one iframe nested inside another.”
    YouTube
    Unverified1 source· Talk
  • feature
    Skybridge: End-to-end type safety between the MCP server and app views
    “It brings ... end-to-end type safety between your MCP server and your app widgets and views.”
    YouTube
    Unverified1 source· Talk
  • integrates with
    “Skybridge is a superset of features on top of the official Apps SDK.”
    YouTube
    Unverified1 source· Talk
  • feature
    Skybridge: CSP Inspector compares domains declared in metadata with domains accessed by app views
    “It looks at all the domains listed in your metadata and all the domains accessed by calls made by your view, then compares them.”
    YouTube
    Unverified1 source· Talk

Related talks