use-webmcp-toolSAFE
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
A hook that registers a WebMCP tool with the browser and ties its lifecycle to a React component.
This is maintained by Chrome, and will be updated with any spec changes. The spec is 🧪 experimental, so the hook feature-detects and degrades to a no-op everywhere the API is absent.Status / accuracy note (2026-06-05): Built against the current WebMCP spec, which exposes the imperative API on `document.modelContext` (registerTool + an AbortSignal for unregistration).
Install
npm install use-webmcp-tool
Requires React 18+ as a peer dependency. Ships as ESM with TypeScript types included — no runtime dependencies.
What it does
WebMCP lets a page expose JavaScript functions as "tools" that an AI agent (browser-built-in, iframe-hosted, or extension) can discover and call. The site author can expose functionality, and the agent uses this instead of scraping the DOM, a11y tree, or using screenshots.
The raw imperative API looks like this:
const controller = new AbortController();
document.modelContext.registerTool({
name: "add-todo",
description: "Add a new item to the user's active todo list",
inputSchema: {
type: "object",
properties: {
text: { type: "string", description: "The text content of the todo item" },
},
required: ["text"],
},
async execute({ text }) {
await addTodoItemToCollection(text);
return { content: [{ type: "text", text: `Added todo item: "${text}" successfully.` }] };
},
}, { signal: controller.signal });
// Unregister later:
controller.abort();useWebMCP wraps that imperative, lifecycle-bound API in the declarative, lifecycle-managed model React developers already use for everything else:
import { useWebMCP } from "use-webmcp-tool";
function TodoTools({ addTodo }) {
const { supported, registered } = useWebMCP({
name: "add-todo",
description: "Add a new item to 1aa66c3323a3OBSERVED · 2026-10-12Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add use-webmcp-tool -- npx -y [email protected]
{
"mcpServers": {
"use-webmcp-tool": {
"command": "npx",
"args": [
"-y",
"[email protected]"
]
}
}
}Exposed tools (1)
0 read · 1 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
add-todo | write | Add a todo |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (1)
webmcp-types, @testing-library/react, jsdom, react, react-dom, vitest
Gates applied: no_behavioural_pass.
1aa66c3323a3full audit observations/trust-audit/mcp-server/googlechromelabs__use-webmcp-tool.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-12 | 1aa66c3323a3 | SAFE | B | 89 | first audit |
Questions
What tools does use-webmcp-tool expose?
1 in total: 0 read-only, 1 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is use-webmcp-tool safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does use-webmcp-tool need?
No credential environment variables were found in its source, so it appears to need none.
How current is this page?
The grade is for one exact copy of the source (1aa66c3323a3), read on 2026-10-12. The repository is watched and re-audited when it changes.