@mcp-b/webmcp-polyfill installs the strict WebMCP core on navigator.modelContext when the browser does not ship it yet. It is the runtime choice for teams that want the browser-facing standard surface without MCP-B-only extensions.
When to use this package
- You want
registerToolandunregisterToolin browsers today. - You are building a site or reusable library that wants to stay close to the W3C surface.
- You want to pair runtime behavior with
@mcp-b/webmcp-typesfor type inference.
When not to use this package
- You need prompts, resources, transport, sampling, or elicitation. 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 the initialization options, testing shim behavior, and the strict-core lifecycle.Related pages
Reference
Initialization options, testing shim details, and runtime behavior.
First tool tutorial
Build your first strict-core tool.
Native vs polyfill vs global
Compare the three runtime strategies.
Test native and polyfill
Validate your code against both native and polyfilled paths.
