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
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)
```javascript theme={null} await document.modelContext.registerTool({ name: "get_docs_info", description: "Returns info about the current docs page", inputSchema: { type: "object", properties: { include_headings: { type: "boolean" }, include_links: { type: "boolean" }, }, }, execute: (args) => { const info = { title: document.title, url: location.href, headingCount: document.querySelectorAll("h1,h2,h3").length, linkCount: document.querySelectorAll("a[href]").length, }; return { content: [{ type: "text", text: JSON.stringify(info) }] }; } }); ```Resource registration (MCP-B)
```javascript resource.js theme={null} import '@mcp-b/global'; const modelContext = document.modelContext; if (typeof modelContext?.registerResource !== 'function') { throw new Error('MCP-B extensions are unavailable'); } modelContext.registerResource({ uri: 'app://config', name: 'App Configuration', mimeType: 'application/json', read: async () => ({ contents: [{ uri: 'app://config', text: JSON.stringify(config) }] }) }); ```Continue with the [first tool tutorial](/tutorials/first-tool), the [`@mcp-b/webmcp-polyfill` reference](/packages/webmcp-polyfill/reference), or the [`@mcp-b/webmcp-ts-sdk` reference](/packages/webmcp-ts-sdk/reference).
Packages
These are the main packages in the workspace, grouped by the standard boundary.
Core WebMCP
| Package | Description |
|---|---|
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
| Package | Description |
|---|---|
| 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
| Package | Description |
|---|---|
| Bridges browser tools to desktop MCP clients via WebSocket + stdio |
Source of truth
This site documents libraries, polyfills, extensions, and tooling for WebMCP, with quick-look pages for the proposal draft. For proposal details and browser behavior, use: Community Group draft, Chrome WebMCP documentation, Chrome DevTools WebMCP panel , Model Context Protocol, and Model Context Tool Inspector .