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 · Dec 6, 2026

@mcp-b/react-webmcp has 17,896 recorded weekly downloads on npm, a decrease of 12.7% over the past 30 days, ranking #1069 of 3,247 tracked listings.

Weekly downloads
17,896
Official API · Dec 5, 2026
7-day growth
-16.3%
-3.5K weekly downloads
30-day growth
-12.7%
-2.6K weekly downloads
90-day growth
+223%
+12.3K weekly downloads
Rank
#1069
▼ 64 in 7 days

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 or _meta 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: 17,896 weekly downloads as of Dec 5, 2026, +223% over 90 days.@mcp-b/react-webmcpWeekly downloads on npm · Last 90 days17,896downloads / week+223% over 90 days05K10K15K20K25K30KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
@mcp-b/react-webmcp weekly downloads on npm, last 90 days: 17,896 weekly downloads as of Dec 5, 2026, +223% over 90 days.

7/30/90-day growth

@mcp-b/react-webmcp weekly downloads growth on npm: -16.3% over 7 days, -12.7% over 30 days, +223% over 90 days.@mcp-b/react-webmcpWeekly downloads growth on npm17,896downloads / week now7-day growth-3,481 weekly downloads-16.3%30-day growth-2,601 weekly downloads-12.7%90-day growth+12,348 weekly downloads+223%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
@mcp-b/react-webmcp weekly downloads growth on npm: -16.3% over 7 days, -12.7% over 30 days, +223% over 90 days.

Ranking history

@mcp-b/react-webmcp npm ranking history: currently #1069 (by weekly downloads).@mcp-b/react-webmcpnpm ranking · by weekly downloads · Last 90 days#1069current rank#850#900#950#1000#1050#1100#1150#1200#1250Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 20, 2026 – Dec 6, 2026 · 31 observations · Updated Dec 5, 2026pluginstats.com
@mcp-b/react-webmcp npm ranking history: currently #1069 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 54, #9 (overall #1,069)
All npm: every listing in weekly downloads order

Listing placement

MCP servers468 listings · 24 pages · page 11, #8 (overall #208)
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 (157)
Recent weekly downloads observations for @mcp-b/react-webmcp
Date (UTC)Weekly downloadsChange vs. previous
17,896-1.1K
18,991+689
18,302+597
17,705-528
18,233-2.2K
20,395-196
20,591-786
21,377-287
21,664-331
21,995+403
21,592+1.1K
20,511+1.6K
18,883+485
18,398—

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 Dec 6, 2026. See the methodology.