Skip to main content
ZICQ

Skills ZICQ category:Agent Workflows webmcp-gen

Webmcp Gen

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.

465 installs

Official URL:skills.sh

What this skill does

Intro in this page language first. The official description stays in its original wording; we do not rewrite SKILL.md.

What it does

Create, compile, and validate site-specific WebMCP init scripts from a target URL and desired tool capability

When to use it

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 agents load it

Per Agent Skills progressive disclosure: name and description load at startup (~100 tokens); the full SKILL.md body loads when the skill activates; scripts/, references/, and assets/ load only as needed. This file's sections: WebMCP Gen; Setup check; Workflow; Manifest contract; Authoring rules; Output layout. It includes spec-recommended sections: step-by-step instructions.

File analysis

File analysis: besides SKILL.md, the body references scripts/scaffold.mjs, scripts/compile.mjs, scripts/generate-stagehand-example.mjs, scripts/validate.mjs. Those resources load on demand.

WebMCP GenSetup checkWorkflowManifest contractAuthoring rulesOutput layout

Compatibility:Requires Node 18+ and Chrome/Chromium with WebMCP testing flags. Run `pnpm install` in the skill directory to install the Stagehand dependency. Page exploration uses the browse CLI (`npm install -g browse`). · License:MIT · allowed-tools:Bash Read Grep Edit Write

Source category:skills.sh agent-skill

SKILL.md & Agent activation

Official spec ↗
name
webmcp-gen
description
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.
compatibility
Requires Node 18+ and Chrome/Chromium with WebMCP testing flags. Run `pnpm install` in the skill directory to install the Stagehand dependency. Page exploration uses the browse CLI (`npm install -g browse`).
allowed-tools
Bash Read Grep Edit WriteExperimental field; support depends on the client and does not grant permissions by itself.
License
MIT
  1. DiscoverThe client exposes names and descriptions to the agent.
  2. ActivateYour request or the task context selects the skill and loads its instructions.
  3. Load resourcesReferenced scripts, documentation and assets are used when needed.
Files referenced by the instructions · 4
  • scripts/scaffold.mjs
  • scripts/compile.mjs
  • scripts/generate-stagehand-example.mjs
  • scripts/validate.mjs

These paths are extracted from the text. Check the upstream package to verify the files exist.

Invocation syntax and available tools depend on your Agent client. Client integration guide ↗

Install this skill

Skills CLI ↗

Choose the target agent and installation scope, keep referenced package files, then verify the skill appears in the client's catalog.

This skill references supporting files. Retrieve the complete directory from the source; copying SKILL.md alone may leave missing dependencies.

Ask your Agent to install

Copy these instructions to a compatible agent and confirm the target directory matches your client.

Install the agent skill "webmcp-gen" into my project. The full SKILL.md and official description are at https://zicq.com/en/skills/skl-cc437c04b025545a-Webmcp-Gen.html
Save it as .cursor/skills/webmcp-gen/SKILL.md or .claude/skills/webmcp-gen/SKILL.md and keep the frontmatter name and description exactly as-is.
This skill also ships scripts/, references/, or assets/ — fetch the whole folder from https://github.com/browserbase/skills instead of creating only a SKILL.md.

Full package on GitHub ↗

Install from the terminal · Skills CLI

Requires Node.js and npx. First inspect the repository's skill list to confirm the name.

npx skills add 'https://github.com/browserbase/skills' --list

npx skills add 'https://github.com/browserbase/skills' --skill 'webmcp-gen'

The CLI lets you choose the agent interactively. The default scope is the project; use -g for user scope. Confirm package availability with the discovery command, then use npx skills list to inspect installed skills.

Readable layout
--- name: webmcp-gen description: 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. compatibility: "Requires Node 18+ and Chrome/Chromium with WebMCP testing flags. Run `pnpm install` in the skill directory to install the Stagehand dependency. Page exploration uses the browse CLI (`npm install -g browse`)." license: MIT allowed-tools: Bash Read Grep Edit Write --- # 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: ```bash 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 1. Pick an artifact slug with exactly one slash: ```text / ``` Example: ```text example.com/page-context ``` 2. Scaffold the artifact: ```bash node scripts/scaffold.mjs example.com/page-context --url https://example.com ``` 3. Explore the target page with the `browse` CLI: ```bash 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. 4. Edit `artifacts///manifest.json`. The manifest is the source of truth. 5. Compile: ```bash node scripts/compile.mjs artifacts/example.com/page-context ``` 6. Generate a runnable Stagehand example (`stagehand-example.ts`) and run it with `tsx`: ```bash node scripts/generate-stagehand-example.mjs artifacts/example.com/page-context npx tsx artifacts/example.com/page-context/stagehand-example.ts ``` 7. Validate: ```bash node scripts/validate.mjs artifacts/example.com/page-context ``` 8. If validation fails, inspect `eval.json` and `eval-report.md`, patch `manifest.json`, then compile and validate again. ## Manifest contract ```json { "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.source` is inserted inside `async (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-origin `fetch`. - Do not use Playwright, Puppeteer, Stagehand, XPath helpers, or agent/browser commands inside `implementation.source`. - `document.querySelector` and `querySelectorAll` must 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 `eval` or `new 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 ```text artifacts/// 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" })`).

Related skills

Agent Workflows

Skill Creator

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that exte…

Agent Workflows

Clawdhub

Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fl…

Agent Workflows

Agent Team Orchestration

Orchestrate multi-agent teams with defined roles, task lifecycles, handoff protocols, and review workflows. Use when: (1) Setting up a team …

Agent Workflows

Superpowers

Spec-first, TDD, subagent-driven software development workflow. Use when: (1) building any new feature or app — triggers brainstorm → plan →…