> ## 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/webmcp-ts-sdk overview

> When to use the thin BrowserMcpServer adapter over MCP TypeScript SDK v2 and which browser responsibilities it retains.

`@mcp-b/webmcp-ts-sdk` exposes `BrowserMcpServer`, a thin WebMCP adapter that composes the official MCP TypeScript SDK v2 server. It does not subclass or fork `McpServer`.

## When to use this package

* You need direct control over the browser server instead of the automatic [`@mcp-b/global`](/packages/global/overview) setup.
* You need to mirror MCP tools to an existing `document.modelContext`.
* You need to backfill tools from a compatible native context or expose MCP-B prompts and resources.

## When not to use this package

* You are building a typical web application. Use [`@mcp-b/global`](/packages/global/overview).
* You only need browser tool registration and discovery. Use [`@mcp-b/webmcp-polyfill`](/packages/webmcp-polyfill/overview).
* You only need an MCP server. Use the official [`@modelcontextprotocol/server`](https://ts.sdk.modelcontextprotocol.io/v2/api/%40modelcontextprotocol/server/).

## What changed in v2

Dynamic registration is no longer a reason to maintain a modified MCP server. SDK v2 owns dynamic tool, prompt, and resource registrations, plus MCP protocol and transport behavior.

SDK v2 also owns schema conversion and validation. It accepts Standard Schema implementations such as Zod 4.2 or newer and wraps raw JSON Schema with `fromJsonSchema`. Zod 3 is unsupported.

`BrowserMcpServer` retains only the WebMCP boundary:

| Official MCP SDK v2 | `BrowserMcpServer` |
| - | - |
| MCP registration handles and list-change notifications | WebMCP `registerTool(tool, options?)` |
| Standard Schema, Zod 4.2+, and `fromJsonSchema` | `document.modelContext` events and tool discovery |
| MCP transport, validation, and protocol behavior | Native-context mirroring and backfill |
| MCP prompts, resources, and client requests | MCP-B descriptor helpers and `mcpServer` access |

<Note>
  `BrowserMcpServer.connect(customTransport)` remains on SDK v2's legacy 2025-era route. Installing
  v2 does not make tab, iframe, or other custom transports speak MCP 2026-07-28. Instance-level
  sampling and elicitation requests live on `browserServer.mcpServer.server`. These SDK APIs are
  legacy-only and throw on modern-era v2 instances. See [Supporting protocol revision
  2026-07-28](https://ts.sdk.modelcontextprotocol.io/v2/migration/support-2026-07-28).
</Note>

<Note>
  WebMCP can register an array-root input schema because arrays are JavaScript objects. MCP requires
  tool input schemas to have an object root. The adapter keeps those tools on WebMCP, omits them
  from the MCP tool list, and logs a warning.
</Note>

## Where it sits

`@mcp-b/global` creates the adapter with the current `document.modelContext` as its `native` target. The adapter mirrors browser-facing registrations down to that target and delegates MCP work to its composed v2 `McpServer`.

The [reference page](/packages/webmcp-ts-sdk/reference) describes the adapter methods and native-context behavior. Use [Chrome's built-in WebMCP panel](https://developer.chrome.com/docs/devtools/application/webmcp) to inspect mirrored tools. The [MCP TypeScript SDK v2 documentation](https://ts.sdk.modelcontextprotocol.io/v2/) owns the upstream server API.

## Related pages

<CardGroup cols={2}>
  <Card title="Reference" icon="book-open" href="/packages/webmcp-ts-sdk/reference">
    BrowserMcpServer APIs, native mirroring, and backfill helpers.
  </Card>

  <Card title="Runtime layering" icon="bars-staggered" href="/explanation/architecture/runtime-layering">
    See how this layer fits between the polyfill and @mcp-b/global.
  </Card>

  <Card title="WebMCP and MCP-B extensions" icon="arrows-left-right" href="/explanation/strict-core-vs-mcp-b-extensions">
    Separate the evolving browser proposal from MCP-B helpers.
  </Card>

  <Card title="WebMCP API sources" icon="globe" href="/reference/webmcp/standard-api">
    Consult the browser surface and its upstream specification.
  </Card>
</CardGroup>


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