/webmcp-browser-agents:webmcp-polyfillfrom webmcp-browser-agents
Sets up MCP-B polyfill to provide navigator.modelContext for browsers without native WebMCP support. Includes vanilla JS and React hooks.
Ships in webmcp-browser-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
site:github.com mcp-b README for the polyfill repository, packages, and API documentationsite:npmjs.com mcp-b for the latest package names and versionsmcp-b polyfill react hooks useMcpServer for React integration patternsmcp-b vanilla javascript navigator.modelContext for vanilla JS usageMCP-B (Model Context Protocol for Browser) is an open-source polyfill that implements the navigator.modelContext API for browsers without native WebMCP support. It allows developers to build and test WebMCP tools today, regardless of native browser support.
MCP-B provides multiple packages (fetch the README for exact names, as they may change):
navigator.modelContext polyfilluseMcpServer and related) for declarative tool registrationCheck for native WebMCP support and fall back to the polyfill:
if (!navigator.modelContext) {
// Load MCP-B polyfill
await import("mcp-b"); // or whatever the current package name is
}
// Now navigator.modelContext is available (native or polyfill)
navigator.modelContext.registerTool({ /* ... */ });
// 1. Import polyfill (if needed)
import "mcp-b";
// 2. Register tools using the standard API
navigator.modelContext.registerTool({
name: "searchProducts",
description: "Search the catalog",
inputSchema: { /* ... */ },
async execute(input) { /* ... */ }
});
import { useMcpServer } from "mcp-b/react"; // verify package name
function ProductPage() {
useMcpServer({
tools: [
{
name: "viewProduct",
description: "View product details",
inputSchema: { /* ... */ },
execute: async (input) => { /* ... */ }
}
]
});
return <div>Product Page</div>;
}
MCP-B can also translate between client-side WebMCP tools and backend MCP servers:
| Aspect | Native WebMCP | MCP-B Polyfill |
|---|---|---|
| Browser support | Chrome 146+ Canary (flagged) | Any modern browser |
| Performance | Native speed | Slight JS overhead |
| Permission prompts | Browser-native UI | Custom/simulated |
| API surface | Full spec | May lag behind spec updates |
| Production readiness | Not yet (still in preview) | Usable today |
Fetch the MCP-B README for exact installation commands, import paths, hook names, and API patterns before implementing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin webmcp-browser-agents14 skills in this plugin
/webmcp-authenticationImplement WebMCP authentication patterns — browser session inheritance, cookie-based auth, role-gated tool registration, and conditional tool exposure. Use when managing which tools are available based on user authentication state./webmcp-commerce-toolsImplement commerce-specific WebMCP tools — product search, cart management, checkout, returns, subscriptions, and support. Use when building agentic shopping experiences on e-commerce websites./webmcp-context-providerImplement the WebMCP provideContext API — bulk tool registration, contextual metadata, page state sharing, and dynamic context updates. Use when providing rich context and multiple tools to agents simultaneously.Other plugins' skills for the same job