Skip to content

Host-controlled WebMCP access between iframes #317

Description

@sparkinson

Consider a host application that composes several cross-origin applications in iframes, with one iframe containing an agent:

Host
├── Agent iframe
├── App A iframe
├── App B iframe
└── App C iframe

Apps A–C may expose WebMCP tools. The host wants the agent to use those tools, but does not necessarily want the apps to discover or invoke tools exposed by other frames.

The host therefore wants to define a topology like:

Frame Expose tools Use tools
Agent no yes
App A yes no
App B yes no
App C yes no

The current model seems awkward for this use case because cross-origin access relies on providers and consumers knowing each other's origins through exposedTo and fromOrigins.

In a composed application, the embedded apps may not know or care which agent implementation the host uses. The host is the component that knows the intended relationship between the frames.

Would it make sense to separate the current tools permission into two independently delegatable capabilities, conceptually:

<iframe src="https://app.example"
        allow="tools-provide">

<iframe src="https://agent.example"
        allow="tools-consume">

This would let the embedding host decide which frames may expose WebMCP capabilities and which frames may consume them.

There would probably also need to be a way for a provider to opt into host-authorised exposure, rather than having to enumerate every possible consuming agent origin.

This seems particularly useful for host applications that compose independent first- and third-party web applications alongside an embedded agent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions