Skip to content

chore(webmcp): remove enable/disable and toolsChanged event - #43080

Merged
Pavel Feldman (pavelfeldman) merged 1 commit into
microsoft:mainfrom
pavelfeldman:webmcp-stateless
Oct 2, 2026
Merged

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

Conversation

@pavelfeldman

@pavelfeldman Pavel Feldman (pavelfeldman) commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Remove WebMCP.enable(), WebMCP.disable(), the toolschanged event and WebMCP.waitForEvent(); tools() and callTool() query the page on demand.
  • Both browsers go through the page's modelContext (getTools() plus executeTool() / invokeTool()); Chromium no longer uses the CDP WebMCP domain, and the page-side script no longer wraps registerTool and friends.
  • callTool() input and result are serialized like evaluate arguments and results.
  • Firefox needs dom.modelcontext.testing.enabled in addition to dom.modelcontext.enabled.
  • MCP backend collects page tools with the snapshot only.

@dgozman Dmitry Gozman (dgozman) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

  • please check same-origin iframes
  • hasDomain??

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

WebMCP.tools() and WebMCP.callTool() query the page on demand instead of
tracking registrations. Both browsers go through the page's modelContext,
Chromium no longer uses the CDP WebMCP domain.
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 8885bdf into microsoft:main Oct 2, 2026
44 checks passed
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

5 flaky ⚠️ [chromium-library] › library/webmcp.spec.ts:238 › should call same-name tools in their own frame `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:762 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node22`
⚠️ [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`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:189 › should show snapshots for steps `@windows-latest-node22`

52518 passed, 1268 skipped


Merge workflow run.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Test results for "MCP"

8937 passed, 1489 skipped


Merge workflow run.

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