Skip to main content
usewebmcp is the strict-core 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 while staying on the standard-owned browser surface.
  • You want to pair React components with @mcp-b/webmcp-polyfill or native support.

When not to use this package

  • You need prompt, resource, sampling, elicitation, 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 strict-core runtime and types. It does not depend on BrowserMcpServer, prompts, or transport helpers.

First step

Ensure navigator.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.