From safe-browser
Creates, compiles, and validates WebMCP init scripts for websites by writing a manifest, exploring pages with browse CLI, and testing registration via Stagehand.
How this skill is triggered — by the user, by Claude, or both
Slash command
/safe-browser:webmcp-genThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Author website-specific WebMCP tools by writing a manifest, compiling it to an init script, and validating that Chrome registers and invokes the tools.
Author website-specific WebMCP tools by writing a manifest, compiling it to an init script, and validating that Chrome registers and invokes the tools.
This skill does not call a nested agent. You are responsible for exploring the page, writing manifest.json, and iterating based on validation output.
From the skill directory, install dependencies if they are not already installed:
cd skills/webmcp-gen
pnpm install
This installs the pinned Stagehand package plus the TypeScript toolchain (tsx,
typescript, @types/node) used to run the generated stagehand-example.ts.
<domain>/<task>
Example:
example.com/page-context
node scripts/scaffold.mjs example.com/page-context --url https://example.com
browse CLI:browse open https://example.com --local
browse snapshot
browse get title
browse get url
browse get text body
browse get html body
Prefer browse snapshot, page text, and DOM inspection over screenshots unless visual layout matters. Use browse stop when exploration is complete.
Edit artifacts/<domain>/<task>/manifest.json. The manifest is the source of truth.
Compile:
node scripts/compile.mjs artifacts/example.com/page-context
stagehand-example.ts) and run it with tsx:node scripts/generate-stagehand-example.mjs artifacts/example.com/page-context
npx tsx artifacts/example.com/page-context/stagehand-example.ts
node scripts/validate.mjs artifacts/example.com/page-context
eval.json and eval-report.md, patch manifest.json, then compile and validate again.{
"domain": "example.com",
"task": "page-context",
"url": "https://example.com",
"generatedAt": "2026-06-04T00:00:00.000Z",
"tools": [
{
"name": "example_com_page_context",
"description": "Returns page context.",
"inputSchema": {
"type": "object",
"properties": {},
"required": []
},
"implementation": {
"kind": "dom",
"source": "return { success: true, title: document.title, url: location.href };"
},
"fixtureInput": {}
}
]
}
implementation.source is inserted inside async (input) => { ... }; write JavaScript statements, not a full function wrapper.document, location, navigator, and same-origin fetch.implementation.source.document.querySelector and querySelectorAll must receive valid browser CSS selectors only.Array.from(document.querySelectorAll(...)).find((el) => (el.textContent || "").includes("...")).eval or new Function.{ success: false, error: "..." } responses.artifacts/<domain>/<task>/
manifest.json
webmcp.init.js
stagehand-example.ts
eval.json
eval-report.md
To turn the example into a standalone project, scaffold a Stagehand app with
npx create-browser-app and drop the generated webmcp.init.js into it (load it
with page.addInitScript({ path: "webmcp.init.js" })).
npx claudepluginhub browserbase/skills --plugin browseDevelops MCP tools for websites and web apps via JS/TS injection and Chrome DevTools testing. For React/Vue/Next.js apps, userscripts (Notion/GitHub), Rails/Django/Laravel testing, vanilla JS/HTML.
Sets up WebMCP projects: enables Chrome flags or MCP-B polyfill, scaffolds tool registration via navigator.modelContext, configures dev environment for AI agent tools on new websites.
Implements and debugs browser WebMCP integrations in JavaScript/TypeScript web apps for exposing imperative or declarative tools via modelContext.