@mcp-b/react-webmcp is the full React surface for MCP-B. It covers tool registration, prompt and resource hooks, and client/provider APIs for consuming MCP servers from a React tree.
When to use this package
- You want WebMCP tool, prompt, and resource registration from React.
- You want JSON Schema or Standard JSON Schema input schemas in hook configuration.
- You need client/provider hooks (
McpClientProvider,useMcpClient) in addition to browser-exposed tools.
When not to use this package
- You only need tool registration. Use
usewebmcp.
Where it sits in the package graph
This package combines two layers:useWebMCP works with native or polyfilled tool registration, while prompt and resource hooks use the BrowserMcpServer from @mcp-b/global.
React peer dependency: ^18.0.0 || ^19.0.0.
First step
Choose the owner for the hooks you use:useWebMCP needs native WebMCP or an initialized polyfill; prompt and resource hooks need @mcp-b/global; client/provider hooks use their configured MCP client and transport without requiring a browser runtime. The reference page covers each surface.
Related pages
Reference
Hook APIs, provider APIs, schema 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.
WebMCP and MCP-B extensions
Decide whether the full React surface is necessary.
