@mcp-b/webmcp-polyfill installs the package-supported WebMCP surface on document.modelContext when the browser does not ship it yet. It provides browser-facing tool registration and discovery without MCP-B prompt, resource, server, or transport extensions.
When to use this package
- You want
registerToolandgetTools, plus the package’s feature-detectable serialized-JSONexecuteToolcompatibility method, 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
@mcp-b/webmcp-typesfor type inference.
When not to use this package
- You need prompts, resources, browser transport, or direct access to an MCP server. Use
@mcp-b/global. - You only need types at build time. Use
@mcp-b/webmcp-types.
Where it sits in the package graph
This package sits directly above@mcp-b/webmcp-types. The full runtime in @mcp-b/global wraps the polyfill when it initializes.
First step
Initialize the polyfill before your app registers tools. The reference page documents initialization, declarative forms, testing shim behavior, and registration lifecycle.Related pages
Reference
Initialization options, testing shim details, and runtime behavior.
First tool tutorial
Build your first browser tool.
Choose a runtime
Compare the three runtime strategies.
Test native and polyfill
Validate your code against both native and polyfilled paths.
