> ## 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-polyfill overview

> When to use the WebMCP polyfill, where it fits in the stack, and when to move up to the full runtime.

`@mcp-b/webmcp-polyfill` vendors the upstream WebMCP polyfill and installs its standard `document.modelContext` surface when the browser does not provide one. It provides browser-facing tool registration, discovery, and object-input execution. A temporary MCP-B layer adds declarative tools and their `SubmitEvent` extensions until upstream supports them. Existing browser contexts and native `SubmitEvent` hooks are preserved; missing hooks are filled in.

## When to use this package

* You want the upstream `registerTool`, `getTools`, and object-input `executeTool` APIs in browsers today.
* You are building a site or reusable library that wants to stay close to the Community Group draft surface.
* You want to pair runtime behavior with upstream [`webmcp-types`](https://github.com/webmachinelearning/webmcp-types) declarations.

## When not to use this package

* You need prompts, resources, browser transport, or direct access to an MCP server. Use [`@mcp-b/global`](/packages/global/overview).
* You only need types at build time. Install upstream [`webmcp-types`](https://github.com/webmachinelearning/webmcp-types) directly.

## Where it sits in the package graph

This package bundles the upstream polyfill source. [`@mcp-b/global`](/packages/global/overview) wraps it when MCP-B extensions are needed.

## First step

Initialize the polyfill before your app registers tools. The [reference page](/packages/webmcp-polyfill/reference) documents the upstream installer, core API, and temporary declarative layer. For prompts, resources, transports, or MCP `outputSchema`, use the [global runtime](/packages/global/reference).

## Related pages

<CardGroup cols={2}>
  <Card title="Reference" icon="book-open" href="/packages/webmcp-polyfill/reference">
    Upstream initialization and core runtime behavior.
  </Card>

  <Card title="First tool tutorial" icon="graduation-cap" href="/tutorials/first-tool">
    Build your first browser tool.
  </Card>

  <Card title="Choose a runtime" icon="layer-group" href="/how-to/choose-runtime">
    Compare the three runtime strategies.
  </Card>

  <Card title="Test native and polyfill" icon="flask-vial" href="/how-to/test-native-and-polyfill">
    Validate your code against both native and polyfilled paths.
  </Card>
</CardGroup>


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