> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mcp-b.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# @mcp-b/transports overview

> When to use the transport classes directly, which browser boundaries they cover, and when to prefer higher-level packages.

`@mcp-b/transports` provides transport classes for explicit MCP client/server
connections over same-window `postMessage`, parent-child iframe messaging, and
Chrome runtime ports. Use it when you need to choose or control the message path
directly.

## When to use this package

* You are connecting an MCP server and client over `postMessage`, an iframe, or
  a Chrome runtime port.
* You need direct access to transport options such as allowed origins or connection IDs.
* You are building on top of the lower-level browser transport primitives.

## When not to use this package

* You want the runtime wired up automatically. Use [`@mcp-b/global`](/packages/global/overview).
* You want the high-level iframe custom element instead of raw iframe transports. Use [`@mcp-b/mcp-iframe`](/packages/mcp-iframe/overview).

## Where it sits in the package graph

The transport classes sit beside the SDK layer and below higher-level packages.
`@mcp-b/global` selects a server transport automatically, while
`@mcp-b/mcp-iframe` creates the parent-side iframe client transport. React MCP
clients can also accept a transport supplied by the application.

## What this package does not provide

These classes do not install `document.modelContext` or perform native
cross-document WebMCP discovery. Native iframe discovery uses `allow="tools"`,
`exposedTo`, and `getTools({ fromOrigins })` without an MCP transport.

There is no user-script transport. Extension transports require
`chrome.runtime.Port`; ordinary page scripts and user-script managers do not
gain that API from this package.

## First step

Choose the transport pair that matches your boundary, then connect it to a server or client. The [reference page](/packages/transports/reference) lists every class, option surface, and security boundary.

## Related pages

<CardGroup cols={2}>
  <Card title="Reference" icon="book-open" href="/packages/transports/reference">
    Transport classes, option tables, and connection examples.
  </Card>

  <Card title="Bridge tools across iframes" icon="bridge" href="/how-to/bridge-tools-across-iframes">
    Practical iframe transport setup.
  </Card>

  <Card title="Transports and bridges" icon="bridge" href="/explanation/architecture/transports-and-bridges">
    Conceptual background on how tools move between boundaries.
  </Card>

  <Card title="mcp-iframe overview" icon="frame" href="/packages/mcp-iframe/overview">
    The higher-level wrapper built on the iframe transports.
  </Card>

  <Card title="WebMCP API sources" icon="brackets-curly" href="/reference/webmcp/standard-api">
    Compare MCP transports with native browser discovery.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.