WebMCP runtime and MCP bridge packages for websites
open sourceMITfree
MCP-B is a set of open source TypeScript packages for WebMCP, the proposed browser API (document.modelContext) that lets a web page register tools an AI agent in the browser can call. @mcp-b/global adds document.modelContext where the browser has no native support and bridges the page's tools to the full Model Context Protocol, with prompts, resources, listTools and browser transports, so MCP clients can reach them. Other packages add React hooks (@mcp-b/react-webmcp, usewebmcp), MCP over iframes, transports, a local relay and a DOM reader for agents. Its docs point to the W3C Community Group's own polyfill for the standard API alone, and to MCP-B's packages for the MCP features. MCP-B, the company behind them, says it helped inspire the WebMCP spec; the packages aren't an official W3C or MCP project.
Problems it solves
- add WebMCP tools to my website today with a polyfill so browser AI agents can call them
- let AI agents call functions in my single-page app instead of clicking the UI
- expose my web app's actions as MCP tools from the browser
Features
- document.modelContext where the browser lacks it
- bridge from WebMCP tools to a full MCP server with prompts and resources
- React hooks for registering tools
- MCP over iframes and browser transports
- local relay to desktop MCP clients
- DOM reader for agents
Alternatives
The same job
These do what MCP-B does.
- WebMCP polyfill The W3C Community Group's polyfill for document.modelContext
- n8n Build the agent. Understand its workflow.
- Arcade.dev The actions runtime for enterprise AI agents
