webmcp-gen

Criar, compilar e validar scripts de inicialização WebMCP específicos do site a partir de uma URL alvo e da capacidade de ferramenta desejada. Use quando o usuário quiser criar ferramentas 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" })).

Mais skills de browserbase

optimize-agent-prompt
browserbase
Cria e melhora demos da API de Agentes Browserbase por meio de um loop externo estilo Autobrowse: executa uma tarefa fixa, coleta mensagens do Agente e logs de sessão, pontua o resultado, revisa uma heurística de prompt de sistema e confirma a convergência. Use ao criar uma demo ou POC de Agentes Browserbase, otimizando o prompt de sistema do Agente, diagnosticando execuções instáveis do Agente ou aplicando auto-pesquisa/autobrowse à API de Agentes Browserbase.
add-webmcp
browserbase
Analise um aplicativo web existente, identifique capacidades seguras visíveis ao usuário em rotas, formulários, ações de servidor, handlers e esquemas, e então implemente ferramentas WebMCP de primeira parte e valide a descoberta e invocação com Stagehand. Use quando o usuário pedir para tornar um codebase pronto para agentes, expor recursos do site como ferramentas WebMCP, ou adicionar WebMCP diretamente a um aplicativo em vez de gerar um script de injeção autônomo a partir de uma URL.
browse
browserbase
Use o CLI browse para automação de navegador Browserbase, APIs de nuvem Browserbase, funções Browserbase, modelos, busca/pesquisa na web, diagnósticos e Browse.sh…
browse
browserbase
Use a CLI browse para automação de navegador do Browserbase, APIs de nuvem do Browserbase, Funções do Browserbase, modelos, busca/extração web, diagnósticos e Browse.sh…
browser-automation
browserbase
Automatize interações com navegador web usando ferramentas MCP. Use quando o usuário pedir para navegar em sites, navegar por páginas web, extrair dados de sites, tirar capturas de tela,…
functions
browserbase
Orientar a implementação de automação de navegador sem servidor usando a CLI oficial do Browserbase Functions. Use quando o usuário quiser implementar automação para executar em um…
agent-experience
browserbase
Audite a experiência do desenvolvedor de um produto, SDK, site de documentação ou SKILL.md, enviando vários subagentes Claude para interagir com ele, usando apenas um pequeno prompt de tarefa e...
autobrowse
browserbase
Automação de navegador autoaprimorativa através do loop de auto-pesquisa. Executa iterativamente uma tarefa de navegação, lê o rastreamento e melhora a habilidade de navegação…