Native document discovery
Child: registers and executes the tool. Parent: discovers its descriptor through the
browser.Execution remains in the child document.
MCP-B iframe bridge
Parent: MCP client. Child: MCP server and tool handler.A transport carries MCP messages across the frame boundary; execution remains in the child.
Native cross-document discovery
Native WebMCP stays within the browser’s document model:- A parent delegates the
toolsPermissions Policy feature to a child withallow="tools". - The child registers a tool with
exposedTowhen another origin should be able to discover it. - The parent includes that origin in
getTools({ fromOrigins }).
RegisteredTool values with their owning window and
origin. This path needs no MCP client, server, or transport. It does not add
MCP-B name prefixes or carry MCP prompts and resources.
MCP-B iframe bridging
@mcp-b/mcp-iframe connects an MCP client in the parent to an MCP server in the
child. The child server must be connected through IframeChildTransport;
@mcp-b/global creates that server and selects the child transport
automatically when loaded in an iframe.
The parent element creates IframeParentTransport, lists the child server’s
items, and republishes them on the parent context. Tools and prompts receive an
element-specific prefix. Resources receive mcp-iframe: wrapper URIs. A strict
parent context can accept tools; prompts and resources require MCP-B extension
methods.
These controls are complementary, not interchangeable.
allow="tools" does
not create an MCP server, and allowedOrigins does not grant the native browser
feature. On the bridge the two exposure controls stack: allowedOrigins decides
which parents may connect, and exposedTo narrows one tool to a subset of them.
A tool cannot reach an origin allowedOrigins already excludes.
The browser enforces exposedTo on the native path. The bridge enforces it in
the child’s own JavaScript, so only the native path holds against a compromised
child.
Other MCP-B bridges
@mcp-b/transports also provides:
TabServerTransportandTabClientTransportfor an MCP client and server in the sameWindow- extension transports for Chrome
runtime.Portconnections accepted by extension code
@mcp-b/webmcp-local-relay connects browser tools to desktop clients through
localhost and stdio. Upstream chrome-devtools-mcp instead uses the Chrome
DevTools Protocol for coding-agent workflows.
Security boundary
Each bridge establishes a security boundary. Origin validation, connection identity, extension permissions, and relay exposure must be configured in the corresponding package. For an iframe bridge, the parent validatestarget-origin and the child validates allowedOrigins. Tool execution remains
in the child page even after the parent republishes its descriptor.
Related pages
- Bridge tools across iframes for the MCP-B setup
- mcp-iframe reference for element behavior and namespacing
- Transports reference for low-level class contracts
- WebMCP API sources for
exposedToandfromOrigins - Connect desktop agents with local relay for the localhost bridge
