Skip to content

Document custom WebMCP tools - #629

Open
rgarcia wants to merge 1 commit into
mainfrom
hypeship/webmcp-custom-tools
Open

rgarcia wants to merge 1 commit into
mainfrom
hypeship/webmcp-custom-tools

Conversation

@rgarcia

@rgarcia rgarcia commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

The API now supports custom WebMCP tools (GET/POST /browsers/{id_or_name}/webmcp/custom-tools, DELETE .../custom-tools/{id}). It also returns tool metadata nested under tool (name, description, inputSchema, MCP-style annotation names) instead of the old flat fields. The generated API reference already covers both, but the hand-written guides still used the flat shape, so their examples broke against the current API and SDK 0.112.0.

New page: browsers/webmcp-custom-tools (nav: after WebMCP)

  • page vs cdp tools, the definition fields, and the context a cdp handler receives (matches, signal)
  • A worked Hacker News batch (hn-tools.js): a page tool that lists stories and a cdp tool that navigates its tab and returns comments
  • Register, discover/invoke, and update/remove examples in TypeScript, Python, Go, and curl
  • URL pattern rules, definition IDs vs tool_refs, force_overwrite_namespace, 409/400/404 behavior
  • Lifecycle: custom tools live in the browser's REPL process, so a REPL timeout, reset: true, or a crash removes all of them
  • REPL webmcp.addCustomTools/listCustomTools/removeCustomTool, limits, and security notes

Updated for the nested shape

  • browsers/webmcp: field tables, annotation names, SDK/curl examples, Go ListTools params argument, exclude_custom, and source.custom / source.target_id
  • browsers/playwright-execution and browsers/repl: tool.tool.name and tool.inputSchema in the WebMCP helper examples. The REPL page also lists the custom-tool helpers and excludeCustom
  • reference/mcp-server/tools/webmcp (+ overview card): new list_custom, add_custom, and remove_custom actions and parameters
  • reference/cli/browsers: new WebMCP section covering webmcp list/invoke and webmcp custom-tools list/add/remove (CLI v0.41.0)

Testing

  • Ran every code example on the changed pages against the production API on a live browser:
    • The new page's register → invoke → overwrite → remove flow in TypeScript (SDK 0.112.0), Python (0.112.0), Go (v0.112.0), and curl.
    • The webmcp.mdx, Playwright, and REPL examples, using a stand-in search_products custom tool.
    • TypeScript examples type-check with tsc --strict, and Go examples pass go vet.
  • Checked the stated behaviors live:
    • 93-character name limit
    • 409 on a duplicate name, 400 on an invalid batch, 204/404 on remove
    • page tools don't validate input, and cdp tools do
    • exclude_custom works
    • Playwright webmcp.listTools() includes custom tools
    • A REPL timeout or reset clears the registry
  • Ran the CLI v0.41.0 commands and the MCP add_custom example source against production.
  • mint broken-links passes. All changed pages render under mint dev.

Not verified, so the docs don't claim anything about it: whether custom tools survive browser standby/restore or browser-pool reuse. No changelog entry was added.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant