Skip to content

feat(webmcp): add page.webmcp API - #42979

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:webmcp-api
Sep 29, 2026
Merged

Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:webmcp-api

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Adds page.webmcp with enable(), disable(), tools(), callTool() and the toolschanged event for the tools a page registers through WebMCP.
  • Chromium uses the CDP WebMCP domain, Firefox is instrumented through an init script and a binding.
  • The MCP backend builds its WebMCP tools on top of the SDK API.

Exposes the tools that a page registers through the WebMCP browser API
on the SDK level: page.webmcp.enable(), tools(), callTool() and the
toolschanged event. Chromium uses the CDP WebMCP domain, other browsers
are instrumented through an init script and a binding.

The MCP backend now builds its WebMCP tools on top of the SDK API.
- `readOnly` ?<[boolean]> The tool does not modify any state.
- `untrustedContent` ?<[boolean]> The tool output may contain third-party content.
- `consequential` ?<[boolean]> The tool takes a consequential action, such as placing an order.
- `frame` <[Frame]> Frame that registered the tool.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a new way to specify a frame!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather old and more importantly the only!

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

5 flaky ⚠️ [chromium-library] › library/video.spec.ts:521 › screencast › should capture static page in persistent context Radoslav Kirilov (@smoke) `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:725 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node24`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`

52500 passed, 1270 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

8829 passed, 1480 skipped


Merge workflow run.

@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit c2c87a2 into microsoft:main Sep 29, 2026
46 checks passed
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.

2 participants