The core: what the web standard defines
The formal WebMCP spec currently centers onregisterTool() and unregisterTool() as the stable write surface on navigator.modelContext.
| Method | What it does |
|---|---|
registerTool(tool) | Add a single tool to the registry |
unregisterTool(name) | Remove a tool by name |
provideContext() and clearContext() for batch registration and full reset, matching the ModelContextCore interface. These methods appear in the Chromium prototype but are not yet anchored in the formal W3C spec text the way registerTool and unregisterTool are.
For read and test operations, Chromium currently exposes a separate navigator.modelContextTesting interface. For the ongoing spec questions around that split, see Spec Status and Limitations.
The extensions: what MCP-B adds
The Model Context Protocol includes more than tools. It also includes prompts, resources, sampling, and elicitation. These are useful capabilities for browser-based agent workflows, but they are not part of the WebMCP standard. When@mcp-b/global initializes, it installs a BrowserMcpServer that keeps the core behavior and adds a separate extension layer:
| Extension method | MCP concept | In WebMCP core? |
|---|---|---|
listTools() | tools/list | No |
callTool(params) | tools/call | No |
registerPrompt(prompt) | prompts | No |
registerResource(resource) | resources | No |
createMessage(params) | sampling | No |
elicitInput(params) | elicitation | No |
Why the separation exists
The separation is not accidental.- Stability. Code written against the strict core surface tracks the browser standard more closely.
- Portability. Libraries that depend only on the core can work with native implementations, the polyfill, MCP-B, or future runtimes.
- Layering clarity. Prompts, resources, and transports are useful, but they are not the same thing as the web platform surface.
How the type system enforces it
The@mcp-b/webmcp-types package defines two important interfaces:
ModelContextCorecontains the strict core methods.ModelContextExtensionscontains MCP-B additions.
ModelContext is the core type. ModelContextWithExtensions is the intersection of core plus extensions. This means a library can type against the core and remain compatible with a fuller runtime later.
When the boundary matters
For most application developers, the boundary is practical only when making runtime choices. If you are building a library or adapter, stay on the core side. Use@mcp-b/webmcp-types and @mcp-b/webmcp-polyfill.
If you are building an application, start by asking whether you need only site-exposed tools. If yes, stay on the strict path with @mcp-b/webmcp-polyfill. If you also need prompts, resources, transport, or desktop-agent connectivity, move up to @mcp-b/global and the @mcp-b/webmcp-ts-sdk reference.
For the package-level rationale behind that split, see the MCP-B Package Philosophy. For how the runtime layers stack at initialization time, see Runtime Layering.