usewebmcp weekly downloads statistics
By WebMCP-org · npm · MCP servers
Standalone React hooks for strict core WebMCP tool registration with document.modelContext
usewebmcp has 21,117 recorded weekly downloads on npm, an increase of 93.5% over the past 30 days, ranking #1023 of 3,247 tracked listings.
About usewebmcp
usewebmcp
Expose React state and actions as WebMCP tools, with automatic registration and cleanup.
'use client';
import { useState } from 'react';
import { useWebMCP } from 'usewebmcp';
export function Counter() {
const [count, setCount] = useState(0);
useWebMCP({
name: 'get_count',
description: 'Get the current counter value',
annotations: { readOnlyHint: true },
execute: () => ({ count }),
});
return (
<button type="button" onClick={() => setCount((value) => value + 1)}>
Count: {count}
</button>
);
}
Each agent call reads the latest committed count.
API reference · Framework setup
Install and provide a runtime
In a React 18 or 19 application:
pnpm add usewebmcp
The hook reads document.modelContext when it registers and does not wait for a runtime installed
later. For browsers without it, load the official W3C polyfill before rendering tools:
pnpm add @w3c/webmcp-polyfill
import '@w3c/webmcp-polyfill/auto';
Use @mcp-b/global for MCP server features. Browser types come from the Community Group's official webmcp-types.
Input schemas
usewebmcp accepts the JSON Schema object from the WebMCP API and infers TypeScript input types
from it. The schema is metadata; the hook does not validate arguments. Validate in your handler
when needed. Local calls to execute() are typed but do not run a validator.
Zod and other Standard Schema validators are rejected. Passing one is a type error, and at runtime
the hook sets registrationError without registering the tool. For Standard Schema validation,
output schemas, MCP annotations, MCP result formatting, or prompt and resource hooks, use
@mcp-b/react-webmcp.
State and lifecycle
stateexposesisExecuting,lastResult,error, andexecutionCount.execute(input, options?)calls the handler locally.reset()clears state without cancelling work.isSupportedreports API availability;registrationErrorreports setup failures separately fromstate.error.- A rejected registration, such as a duplicate tool name, also logs one
console.warnnaming the tool. enabled: falseunregisters the tool while keeping local execution available.- Local and agent failures reject. Agents receive
nullwhen the handler returnsundefined; any other result must be JSON-serializable, or the agent call fails andstate.errorrecords why. - Handlers receive
(input, { signal })for cancellation, which always rejects. - The hook commits once after mount when
isSupportedbecomes true. Later successful registrations and unrelated renders add no commits. - The package preserves
'use client'and supports React 18/19, SSR, and StrictMode.
See the reference for metadata updates,
cancellation, and raw result handling. The usewebmcp/internal entry exists for
@mcp-b/react-webmcp and can change in any release.
Upgrading from 5.x
To keep Standard Schema validation, outputSchema, MCP annotations, InferOutput, or automatic
MCP responses, import useWebMCP from @mcp-b/react-webmcp instead. The
changelog lists every breaking change.
Development
From the repository root after pnpm build:
pnpm test:hooks
CHROME_BIN=/path/to/chrome-canary pnpm --filter usewebmcp test:native
Harness details. Prior art: GoogleChromeLabs/use-webmcp-tool.
License
Description from the npm listing.
- ai
- assistant
- browser
- hooks
- mcp
- model-context-protocol
- react
- react-hooks
- tools
- usewebmcp
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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 (142)Similar npm MCP servers plugins
All 20 usewebmcp alternativesData 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/usewebmcp. First seen Nov 11, 2026; last successful collection Dec 6, 2026. See the methodology.