Skip to main content

WebMCP documentation and developer tools

Browser API guides, working tutorials, polyfills, React packages, extensions, and debugging tools.

New: The OpenAI WebMCP Challenge is live. Enter the challenge.

Read What is WebMCP?, WebMCP vs MCP, and Choose a runtime.

Live on this page

This page has a real WebMCP tool. Try calling it.

The tool below is registered right now using document.modelContext.registerTool(). Use the Rook extension or Chrome’s native WebMCP support to call it from an AI agent.

Tool registration (live)

Resource registration (MCP-B)

resource.js

Continue with the first tool tutorial, the @mcp-b/webmcp-polyfill reference, or the @mcp-b/webmcp-ts-sdk reference.

Packages

Browse the package set in one place.

These are the main packages in the workspace, grouped by the standard boundary.

Core WebMCP

PackageDescription
Polyfills document.modelContext for browsers without native support
TypeScript types for the WebMCP standard surface
React hook for tool registration with automatic lifecycle

MCP-B

PackageDescription
Entry point — sets up polyfill + MCP server in one import
WebMCP adapter over the official MCP TypeScript SDK
PostMessage and WebSocket transports for cross-context communication
Bridges tools across iframes via PostMessage
React provider and hooks for MCP-B extensions

Calling tools

PackageDescription
Bridges browser tools to desktop MCP clients via WebSocket + stdio
WebMCP runtime architectureWebMCP runtime architecture