usewebmcp is the tool-only React package. It gives React components a hook-based way to register WebMCP tools without taking a dependency on the broader MCP-B runtime surface.
When to use this package
- You are building a React app that only needs
registerTool. - You want React ergonomics without MCP-B prompt, resource, server, or transport extensions.
- You want to pair React components with
@mcp-b/webmcp-polyfillor native support.
When not to use this package
- You need prompt, resource, or client-provider hooks. Use
@mcp-b/react-webmcp. - You are not using React.
Where it sits in the package graph
usewebmcp sits on top of the polyfill and type packages. It does not depend on BrowserMcpServer, prompts, or transport helpers.
First step
Ensuredocument.modelContext exists through native support, @mcp-b/webmcp-polyfill, or @mcp-b/global, then register a hook in a client component. The reference page covers the hook signature, state model, and inference behavior.
Related pages
Reference
Hook signature, config fields, re-registration rules, and types.
Your first React tool
Guided React tutorial using WebMCP hooks.
Framework guide
Runtime setup patterns across React and other frameworks.
@mcp-b/react-webmcp overview
Compare the full React package to the tool-only hook.
