Skip to content

Experimental · Unofficial

Built by Tim Benniks. This is not an official Contentstack product and is not supported by Contentstack.

Browser support

WebMCP is progressive enhancement. Unsupported browsers no-op silently with zero runtime impact.

Spec status

WebMCP is a Draft Community Group Report from the W3C Web Machine Learning Community Group (latest draft 26 August 2026). It is not a W3C Standard and is not on the W3C Standards Track. The API surface has already been renamed once and may change again — always feature-detect.

Feature detection

typescript
import {
  isWebMcpSupported,
  isWebMcpEnabled,
  getModelContext,
} from "@timbenniks/contentstack-webmcp";

isWebMcpEnabled(); // env kill switch
isWebMcpSupported(); // enabled + document.modelContext.registerTool exists
getModelContext(); // ModelContext instance or null

Chrome timeline

ChromeStatusNotes
146Shipped navigator.modelContextStable 10 March 2026; early preview behind #enable-webmcp-testing
149+Origin trialRegister tools on production traffic
150navigator.modelContext deprecatedSuperseded by document.modelContext

This package targets document.modelContext, the surface in the current draft. It does not fall back to the deprecated navigator.modelContext, so Chrome 146–149 without the origin trial will no-op.

On-by-default Chrome is projected for late 2026. Firefox and Safari have no shipping implementation.

Unsupported (graceful no-op)

BrowserBehavior
SafariNo registration, no errors
FirefoxNo registration, no errors
Chrome without document.modelContextNo registration, no errors

Defensive behavior

  • try/catch on every registerTool call — one rejected tool does not stop the rest
  • AbortSignal cleanup on teardown
  • Warnings only when the build positively reports development (NODE_ENV=development or import.meta.env.DEV)
  • Silent in production, on every browser

Testing locally

Join the origin trial (Chrome 149+) and serve the token, or use the preview flag on older builds:

  1. Navigate to chrome://flags/#enable-webmcp-testing
  2. Enable and restart Chrome
  3. Open your site
  4. DevTools → ApplicationWebMCP
  5. Verify registered tools and run manual executions

Permissions-Policy

Required for browser agents to invoke tools:

Permissions-Policy: tools=(self)

To expose tools to specific cross-origin embedders in the same document tree, pass exposedTo to register():

typescript
await webmcp.register({
  signal: controller.signal,
  exposedTo: ["https://agent.example.com"],
});

See Security for platform-specific setup.

Kill switch

Disable everywhere:

bash
CONTENTSTACK_WEBMCP_ENABLED=false

Released under the MIT License.