Skip to content

Browser Support & Polyfill

WebMCP (document.modelContext.registerTool) is Chrome-only today — Canary / origin trial, document.modelContext (not navigator.modelContext). Other browsers report status:'unsupported' (mutually exclusive with registered).

BrowserStatusWhat to use
Chrome / Edge (Canary, origin trial)Native document.modelContextNothing — works out of the box
FirefoxNo native WebMCPProduction: @mcp-b/webmcp-polyfill
SafariNo native WebMCPProduction: @mcp-b/webmcp-polyfill
Other / SSRisWebMCPSupported() guards; dev shim for tests

Spec: Chrome WebMCP imperative API · Model Context Protocol.

For production cross-browser — use the real polyfill

bash
npm i @mcp-b/webmcp-polyfill && import '@mcp-b/webmcp-polyfill'

@mcp-b/webmcp-polyfill has 50k+ weekly downloads and full transport (53k+ as of August 2026). simple-webmcp is complementary — it authors capabilities, the polyfill is the runtime.

Dev / testing shim

ts
import 'simple-webmcp/dev-polyfill'; // or 'simple-webmcp/testing' or legacy 'simple-webmcp/polyfill'
import { installPolyfill, isPolyfilled } from 'simple-webmcp/polyfill';
installPolyfill(); // in-memory registerTool/listTools/invokeTool only
  • simple-webmcp/polyfill is a dev/testing shim, not an interoperability polyfill. Prefer dev-polyfill / testing aliases for clarity.
  • isWebMCPSupported() / getModelContext() shield spec churn; core detects existing modelContext and no-ops.
  • Separate entry 1.74KB raw so non-Chrome dev pays nothing in prod Chrome.

Feature detection

ts
import { isWebMCPSupported } from 'simple-webmcp';
if (!isWebMCPSupported()) {
  // hide Inspector, show "Chrome Canary required" message
}

WebMCPTool.status is 'unsupported' when not supported — never 'registered' at the same time.

Permissions Policy

Some deployments restrict WebMCP via the tools Permissions Policy — e.g. Permissions-Policy: tools=(self) or <iframe allow="tools">. Without delegation, registerTool in a cross-origin iframe throws NotAllowedError (code: 'NOT_ALLOWED'). See Reference — Errors & Registry.

See also

Released under the MIT License.