Skip to content
PluginStats

@mcp-b/react-webmcp weekly downloads statistics

By mcp-b (4 listings) · npm · MCP servers

React hooks for Model Context Protocol (MCP) - expose React components as AI tools for Claude, ChatGPT, Cursor, and Copilot

View on npm Fresh · Oct 18, 2026

@mcp-b/react-webmcp has 3,456 recorded weekly downloads on npm, ranking #1213 of 2,322 tracked listings.

Weekly downloads
3,456
Official API · Oct 18, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#1213
Among tracked npm listings

About @mcp-b/react-webmcp

@mcp-b/react-webmcp

React hooks for WebMCP tools with MCP output schemas, prompts, resources, and client connections, built on the core usewebmcp tool hook.

'use client';

import '@mcp-b/global';
import { useWebMCP } from '@mcp-b/react-webmcp';
import { z } from 'zod';

const calculatorInput = z.object({ left: z.number(), right: z.number() });

export function CalculatorTool() {
  const tool = useWebMCP({
    name: 'add_numbers',
    description: 'Add two numbers',
    inputSchema: calculatorInput,
    outputSchema: {
      type: 'object',
      properties: { total: { type: 'number' } },
      required: ['total'],
    },
    annotations: { readOnlyHint: true, idempotentHint: true },
    execute: ({ left, right }) => ({ total: left + right }),
  });

  return <output>Last total: {tool.state.lastResult?.total ?? 'Not called yet'}</output>;
}

For { left: 3, right: 4 }, React state holds { total: 7 }; the agent receives MCP text and structuredContent.

API reference · Framework setup

Install

pnpm add @mcp-b/react-webmcp @mcp-b/global zod@^4.2

Import @mcp-b/global once in your client entry. Zod is optional; compatible schema libraries and plain JSON Schema also work.

What you useRuntime needed
useWebMCP or useWebMCPContextNative WebMCP, an initialized polyfill, or @mcp-b/global
useWebMCPPrompt or useWebMCPResource@mcp-b/global or a configured BrowserMcpServer
McpClientProvider and useMcpClientYour MCP client and transport; no document.modelContext required

Native WebMCP and the standalone polyfill do not advertise MCP outputSchema metadata. Use the MCP-B runtime to expose that metadata to MCP clients.

Schemas and results

  • The hook calls your schema's converter once and runs its validator before every handler call (local, executeTool, and MCP), including async transforms. It ships no validator.
  • Plain JSON Schema supplies metadata and inference only. Reuse immutable schemas to cache conversion and serialization.
  • outputSchema types the result. The MCP server validates it on MCP calls; local and native calls bypass that validation. When that check fails, the MCP client receives an error while state records the success.
  • Local execution and React state retain your value. Agent calls receive MCP formatting; formatOutput can override it.
  • formatError defaults to an MCP response with isError: true whose text is error.message. Async formatters are awaited; local failures and cancellation always reject. A handler that returns undefined yields the text undefined.

Input example · Schema guide · Output reference

Expose context, prompts, and resources

'use client';

import '@mcp-b/global';
import { useWebMCPContext, useWebMCPPrompt, useWebMCPResource } from '@mcp-b/react-webmcp';

export function PageTools({ title }: { title: string }) {
  useWebMCPContext('page_context', 'Get the current page title', () => ({ title }));

  useWebMCPPrompt({
    name: 'summarize_page',
    get: () => ({
      messages: [{ role: 'user', content: { type: 'text', text: `Summarize: ${title}` } }],
    }),
  });

  useWebMCPResource({
    name: 'Page title',
    uri: 'page://title',
    read: async (uri) => ({
      contents: [{ uri: uri.href, mimeType: 'text/plain', text: title }],
    }),
  });

  return null;
}

These hooks use the latest committed props and clean up on unmount. Set enabled: false to unregister. Prompt and resource guide.

Consume an MCP server

Wrap your UI in McpClientProvider, supplying stable client and transport instances. useMcpClient() exposes tools, resources, connection state, and errors. Client setup and example.

State and lifecycle

The tool hook returns the core hook's state and controls and shares its enabled, cancellation, and registration behavior (lifecycle reference). Prompt and resource hooks return isRegistered. 'use client' is preserved; server rendering and StrictMode are tested on React 19, and React 18 is in the peer range.

Declarative form attributes

Development

Run pnpm build then pnpm test:hooks from the repository root. Harness details.

License

MIT

Description from the npm listing.

  • ai
  • ai-agents
  • ai-assistant
  • ai-integration
  • ai-tools
  • anthropic
  • browser
  • chatgpt
  • claude
  • copilot
  • cursor
  • gemini
  • hooks
  • llm
  • mcp
  • mcp-client
  • mcp-server
  • model-context-protocol
  • navigator-modelcontext
  • openai

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

@mcp-b/react-webmcp weekly downloads on npm, last 90 days: 3,456 weekly downloads as of Oct 18, 2026.@mcp-b/react-webmcpWeekly downloads on npm · Last 90 days3,456downloads / week3.1K3.2K3.3K3.4K3.5K3.6K3.7K3.8K3.9KJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekOct 18, 2026 – Oct 18, 2026 · 1 observations · Updated Oct 18, 2026pluginstats.com
@mcp-b/react-webmcp weekly downloads on npm, last 90 days: 3,456 weekly downloads as of Oct 18, 2026.

7/30/90-day growth

@mcp-b/react-webmcp weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.@mcp-b/react-webmcpWeekly downloads growth on npm3,456downloads / week now7-day growthinsufficient historyInsufficient history30-day growthinsufficient historyInsufficient history90-day growthinsufficient historyInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
@mcp-b/react-webmcp weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

@mcp-b/react-webmcp npm ranking history: currently #1213 (by weekly downloads).@mcp-b/react-webmcpnpm ranking · by weekly downloads · Last 90 days#1213current rank#1211#1212#1213#1214#1215Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 20, 2026 – Oct 20, 2026 · 1 observations · Updated Oct 18, 2026pluginstats.com
@mcp-b/react-webmcp npm ranking history: currently #1213 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 61, #16 (overall #1,216)
All npm: every listing in weekly downloads order

Listing placement

MCP servers277 listings · 14 pages · page 13, #5 (overall #245)
MCP servers: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (1)
Recent weekly downloads observations for @mcp-b/react-webmcp
Date (UTC)Weekly downloadsChange vs. previous
3,456—

Similar npm MCP servers plugins

All 20 @mcp-b/react-webmcp alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/@mcp-b/react-webmcp. First seen Oct 20, 2026; last successful collection Oct 20, 2026. See the methodology.