Skip to main content
This page is a quick lookup. For the authoritative API shape, read the W3C WebMCP spec and the WebMCP proposal.
The strict imperative WebMCP surface. Owned by the WebMCP specification, not by @mcp-b/* packages.

Methods

The formal spec centers on registerTool() and unregisterTool(). See the W3C spec for the full ToolDescriptor shape, ContentBlock types, InputSchema constraints, and execution semantics.

Example

From the @mcp-b/webmcp-polyfill README, using only the strict core API:
The testing and inspection companion to navigator.modelContext. Chromium exposes it in the native preview. The MCP-B polyfill can install a compatible shim.
This surface is not the stable consumer API. Chromium preview behavior may change while the standard discussion continues. See Spec Status and Limitations for current design status.

Methods

Key behaviors:
  • listTools() returns metadata only, not execute functions.
  • inputSchema on returned tool info is a serialized JSON string, not a parsed object.
  • executeTool() takes a JSON string for ordinary (non-streamed) calls.

Example

Native preview vs polyfill shim

For shim configuration, see @mcp-b/webmcp-polyfill. For end-to-end testing patterns, see Test native and polyfill.

Feature detection

Check for both APIs before use:
For native preview availability, flags, and current browser support, see Browser support and flags.

Where MCP-B begins

The browser standard owns the surface above. MCP-B adds a separate layer on top. For why the core surface is kept separate from MCP-B additions, see Strict core vs MCP-B extensions.