Repository navigation
feat(webmcp): call the tools a page registers through WebMCP - #30
Merged
Merged
Conversation
Add browser_webmcp_list and browser_webmcp_call. Pages that adopt WebMCP register tools with document.modelContext.registerTool() or <form toolname>; agents can now list those tools and call them by name with an input object, instead of driving the page's UI. - Runner (extension/lib/webmcp-page.js) is stringified and evaluated in the page over CDP as an awaited expression (replMode does not unwrap a returned promise), and returns a JSON string. - Safety gates: consequentialHint tools and toolautosubmit forms need confirm:true; forms that wait for a user submit return DECLARATIVE_NEEDS_USER. Declarative forms are found in the light DOM, open and closed shadow roots and same-origin frames (DOM.performSearch); if that scan fails, calls fail closed (FORM_SCAN_FAILED). - Page-authored content is flagged untrustedContent by the handler, which also validates everything the page returns. - Timeouts abort the tool page-side; navigation during a call is a non-error status:"unknown". browser_shortcuts refuses a saved confirm:true. - npm run smoke:webmcp drives the real handlers against an isolated headless Chrome (15 checks); 629 unit tests pass. Built through specs/webmcp-support (spec, plan, independent review, tasks, implementation report, independent audit: PASS). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
A "Sites with their own tools (WebMCP)" section under "Using it": how to turn WebMCP on, the list → call → confirm workflow, the safety-gate and result-code tables, and limits. Also a comparison row, the smoke:webmcp command in Development, and an FAQ entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
compnew2006
pushed a commit
that referenced
this pull request
Oct 15, 2026
…vements Conflicts were only in the docs: the tool count is now 34 (31 + the two WebMCP tools + browser_emulate), and the WebMCP lines sit next to the updated console/network lines in AGENTS.md and llms.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
This PR adds two tools,
browser_webmcp_listandbrowser_webmcp_call. Some sites expose their own actions to agents through WebMCP, usingdocument.modelContext.registerTool(...)or a<form toolname>. On those sites, an agent can now list the tools and call one by name with an input object, instead of clicking through the UI. Pages without WebMCP behave exactly as before.How
extension/lib/webmcp-page.js) is evaluated in the page's main world over CDP.extension/handlers/webmcp.js) validates every field of it.consequentialHinttools andtoolautosubmitforms needconfirm: true.DECLARATIVE_NEEDS_USER; the agent shield would otherwise block that submit.DOM.performSearch. If that scan fails, calls fail closed withFORM_SCAN_FAILED.browser_shortcutsrefuses to saveconfirm: true.untrustedContent: trueon them; the flag is never taken from the page.status: "unknown".frame/frameUrl.The design and its review history are in
specs/webmcp-support/:Verification
npm run build/typecheck/lintnpm testnpm run test:coveragegit diff --checknpm run smoke:webmcpnpm run smoke:webmcpruns the real handlers against an isolated headless Chrome 155 (temporary profile,--enable-features=WebMCP). It needs a local Chrome 149 or newer, so it is not part ofnpm testor CI.Not done here
chrome://flags/#enable-webmcp-testing, an extension reload, andnpm run daemon:restart.DOM.performSearch, an experimental CDP command. Re-runnpm run smoke:webmcpafter Chrome upgrades.🤖 Generated with Claude Code