webmcp-gen

द्वारा browserbase

लक्ष्य URL और वांछित उपकरण क्षमता से साइट-विशिष्ट WebMCP init स्क्रिप्ट बनाएं, संकलित करें और मान्य करें। उपयोग तब करें जब उपयोगकर्ता WebMCP उपकरण लिखना चाहता है…

npx skills add https://github.com/browserbase/skills --skill 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

  1. Pick an artifact slug with exactly one slash:
<domain>/<task>

Example:

example.com/page-context
  1. Scaffold the artifact:
node scripts/scaffold.mjs example.com/page-context --url https://example.com
  1. Explore the target page with the 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.

  1. Edit artifacts/<domain>/<task>/manifest.json. The manifest is the source of truth.

  2. Compile:

node scripts/compile.mjs artifacts/example.com/page-context
  1. Generate a runnable Stagehand example (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
  1. Validate:
node scripts/validate.mjs artifacts/example.com/page-context
  1. If validation fails, inspect eval.json and eval-report.md, patch manifest.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.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

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" })).

browserbase की और Skills

browse
browserbase
Use the browse CLI for Browserbase browser automation, Browserbase cloud APIs, Browserbase Functions, templates, web fetch/search, diagnostics, and Browse.sh…
official
browser-automation
browserbase
Automate web browser interactions using MCP tools. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots,…
official
functions
browserbase
Guide deployment of serverless browser automation using the official Browserbase Functions CLI. Use when the user wants to deploy automation to run on a…
official
agent-experience
browserbase
किसी उत्पाद, SDK, दस्तावेज़ साइट, या SKILL.md के डेवलपर अनुभव का ऑडिट करें, इसमें केवल एक छोटे कार्य संकेत और वास्तविक… के साथ कई Claude उप-एजेंट लगाकर।
official
autobrowse
browserbase
स्व-सुधारात्मक ब्राउज़र स्वचालन ऑटो-रिसर्च लूप के माध्यम से। ब्राउज़िंग कार्य को पुनरावृत्त रूप से चलाता है, ट्रेस पढ़ता है, और नेविगेशन कौशल में सुधार करता है…
official
browse
browserbase
browse CLI का उपयोग करके ब्राउज़र ऑटोमेशन फ़ंक्शन बनाने और तैनात करने के लिए पूर्ण गाइड
official
browser
browserbase
स्थानीय Chrome या दूरस्थ Browserbase के साथ ब्राउज़र ऑटोमेशन, सुरक्षित साइटों, बॉट डिटेक्शन और CAPTCHAs के लिए। दो मोड: स्थानीय Chrome (डिफ़ॉल्ट, कोई सेटअप नहीं) या दूरस्थ Browserbase (एंटी-बॉट स्टील्थ, स्वचालित CAPTCHA समाधान, रेज़िडेंशियल प्रॉक्सी, सत्र स्थिरता)। मुख्य कमांड में नेविगेशन, पेज निरीक्षण, इंटरैक्शन (क्लिक, टाइप, भरें, चुनें, ड्रैग) और CLI के माध्यम से सत्र प्रबंधन श
official
Browser Automation
browserbase
वेब ब्राउज़र इंटरैक्शन को CLI कमांड के माध्यम से प्राकृतिक भाषा का उपयोग करके स्वचालित करें। उपयोग करें जब उपयोगकर्ता वेबसाइटें ब्राउज़ करने, वेब पेजों पर नेविगेट करने, डेटा निकालने के लिए कहे...
official