What is the Webmcp Gen skill?
Webmcp Gen is a coding skill by browserbase for Claude Code, Cursor, Codex and other AI coding agents. 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.
Author website-specific WebMCP tools by writing a manifest, compiling it to an init script, and validating that Chrome registers and invokes the tools.
When to use it
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.
What the SKILL.md covers
- Setup check
- Workflow
- Manifest contract
- Authoring rules
- Output layout
- Author
- browserbase
- Pack
- browserbase/skills (19 skills)
- Category
- Coding, #648 of 1826
- Alyn Score
- 70 / 99
- Files
- 9, includes scripts
- License
- Not stated
- Last updated
- 9 days ago
- Works with
- Claude Code, Claude, Cursor, Codex, Gemini CLI, Copilot
Webmcp Gen compared to similar skills
| Skill | Alyn Score | GitHub stars | Updated |
|---|---|---|---|
| Webmcp Gen · browserbase | 70 | 3.8k | 9 days ago |
| Cfe Validate · Nikolay-Shirokov | 58 | 823 | 10 days ago |
| QA · Garry Tan | 84 | 143k | 27 h ago |
| Short Drama Produce · zenstory-ai | 71 | 4.9k | 29 h ago |
Install Webmcp Gen
Pick your agent. Every command is ready to paste.
npx alyn-cli add webmcp-gen-by-browserbaseDetects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.
npx skills add browserbase/skills --skill webmcp-genOr use the open skills CLI directly.
01
Install it
Run the command above, or upload the folder in Claude.
02
Ask naturally
Describe the task. Your agent loads webmcp-gen when the request matches its description.
03
Name it if needed
If it does not trigger, say “use the webmcp-gen skill”. In Codex, type $webmcp-gen.
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.
Manifest contract
{
"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": {}
}
]
}
Authoring rules
implementation.sourceis inserted insideasync (input) => { ... }; write JavaScript statements, not a full function wrapper.- Return a JSON-serializable object.
- WebMCP code runs inside the browser page. Use browser-native APIs:
document,location,navigator, and same-originfetch. - Do not use Playwright, Puppeteer, Stagehand, XPath helpers, or agent/browser commands inside
implementation.source. document.querySelectorandquerySelectorAllmust receive valid browser CSS selectors only.- To find visible text, use
Array.from(document.querySelectorAll(...)).find((el) => (el.textContent || "").includes("...")). - Do not include API keys, bearer tokens, cookies, localStorage secrets, or user credentials.
- Do not use
evalornew Function. - Avoid destructive actions unless the user explicitly asked for them.
- Make implementations defensive: check for missing elements and return structured
{ success: false, error: "..." }responses. - Generated init scripts register WebMCP tools only in the top frame.
Output layout
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" })).
Tips for Webmcp Gen
- • Start a fresh session after installing so your agent picks up the new skill.
- • This skill ships scripts. Read them before the first run, and run it in a project without secrets first.
- • It is part of a pack with 19 skills. Install only the ones you need with --skill to keep triggers precise.
- • If two skills overlap, mention the one you want by name.
Questions about Webmcp Gen
What does the Webmcp Gen skill do?
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.
How do I install Webmcp Gen?
Run "npx alyn-cli add webmcp-gen-by-browserbase" in your project. The Alyn CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.
Does Webmcp Gen work in Cursor and Codex?
Yes. Webmcp Gen uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.
When should I use the Webmcp Gen skill?
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.
What is inside the Webmcp Gen skill?
The SKILL.md covers Setup check, Workflow, Manifest contract, Authoring rules, Output layout, and the skill folder has 9 files including scripts.
What is a good alternative to Webmcp Gen?
Cfe Validate by Nikolay-Shirokov is the highest-ranked similar skill from another creator, with an Alyn Score of 58 compared to 70 for Webmcp Gen.
Is Webmcp Gen free?
Webmcp Gen is open source on GitHub. It is free to install; check the license before commercial use.
Who made Webmcp Gen?
Webmcp Gen is published by browserbase in the browserbase/skills repository, together with 18 other skills.



