Webmcp Gen
Create, compile, and validate site-specific WebMCP init scripts from a target URL and...
Install
npx skills add browserbase/skills --skill webmcp-gen -g -a claude-code -y- Repository
- browserbase/skills3.7k
- Category
- Testing
- Updated
- 8d ago
- License
- MIT
- Context cost
- Lightabout 963 tokens
- Runs scripts
- Yes, review before use
What it does
Create, compile, and validate site-specific WebMCP init scripts from a target URL and desired tool capability. Use when the user wants to author WebMCP tools for a website, produce a webmcp.init.js artifact, or test WebMCP registration and invocation through Stagehand.
WebMCP Gen
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.
Setup check
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.
Workflow
- Pick an artifact slug with exactly one slash:
<domain>/<task>
Example:
example.com/page-context
- Scaffold the artifact:
node scripts/scaffold.mjs example.com/page-context --url https://example.com
- Explore the target page with the
browseCLI:
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
- Generate a runnable Stagehand example (
stagehand-example.ts) and run it withtsx:
node scripts/generate-stagehand-example.mjs artifacts/example.com/page-context
npx tsx artifacts/example.com/page-context/stagehand-example.ts
- Validate:
node scripts/validate.mjs artifacts/example.com/page-context
- If validation fails, inspect
eval.jsonandeval-report.md, patchmanifest.json, then compile and validate again.


