@mcp-b/react-webmcp is the full React surface for MCP-B. It covers tool registration, prompt and resource hooks, sampling and elicitation helpers, and client/provider APIs for consuming MCP servers from a React tree.
When to use this package
- You want the full MCP-B feature set from React.
- You want Zod v3 object-map support in hook configuration.
- You need client/provider hooks in addition to browser-exposed tools.
When not to use this package
- You only need strict-core
registerToolbehavior. Useusewebmcp. - You are not using a BrowserMcpServer-based runtime such as
@mcp-b/global.
Where it sits in the package graph
This package sits above the full runtime stack. It expectsnavigator.modelContext to come from a browser-native implementation or from the MCP-B runtime that wraps the strict core with BrowserMcpServer.
First step
Initialize the runtime with@mcp-b/global, then add the hook or provider that matches your React use case. The reference page covers tool hooks, prompt/resource hooks, and client/provider APIs.
Related pages
Reference
Hook APIs, provider APIs, Zod support, and return types.
Your first React tool
Guided tutorial for registering a React tool.
Register prompts and resources
Apply the full MCP-B React surface.
Strict core vs MCP-B extensions
Decide whether the full React surface is necessary.
