usewebmcp exposes a component’s current state and actions through WebMCP tools:
Counter.tsx
Package boundary
The hook uses Community Group types and accepts upstream JSON Schema metadata without runtime validation. Supply native WebMCP, the polyfill, or MCP-B runtime. React 18/19 and'use client' are supported. The hook rejects Standard Schema validators such as
Zod. For Standard Schema validation, MCP output metadata, prompts, resources, or formatted agent
responses, use @mcp-b/react-webmcp.
Framework setup · API reference ·
Schema guide