Repository navigation
Description
The goal is to integrate WebMCP as an experiment in the AI plugin.
Initially explored by @Jameswlepage in:
This is where WebMCP actually stands as of early April, as documented in #224 (comment):
Spec: It's a Draft Community Group Report under the W3C Web Machine Learning CG — explicitly not a W3C Standard and not on the Standards Track. Three editors from Microsoft and Google (Brandon Walderman, Khushal Sagar, Dominic Farolino). ~2.2k stars on https://github.com/webmachinelearning/webmcp, latest draft dated March 27.
Things are moving fast and breaking. provideContext()/clearContext() got removed March 5. Standalone unregisterTool() got removed March 27 — now it's registerTool(tool, { signal }) with AbortSignal-based lifetime instead. So if you're reading older blog posts or tutorials, assume half the API surface has changed.
There are two APIs described publicly. The imperative one (navigator.modelContext.registerTool()) takes name, description, optional JSON Schema input, and an async execute(input, client) callback where the client gives you requestUserInteraction() (though its algorithm is still a TODO in the spec). The declarative one proposes HTML form attributes (toolname/tooldescription) plus JS/CSS additions like SubmitEvent.agentInvoked, SubmitEvent.respondWith(), and :tool-form-active/:tool-submit-active pseudo-classes — but the entire declarative section is marked as TODO right now.
Worth emphasizing: WebMCP is MCP-inspired but not MCP. Chrome's guidance says it's "not an extension or a replacement of MCP." The browser mediates everything between the site and its built-in agent — no JSON-RPC.
Some notable open questions: discovery is explicitly a non-goal in the repo README (tools are tab-bound, registered during the user's visit, ephemeral). Multi-agent negotiation (in-page vs. extension vs. in-browser agents) is tracked but unresolved. requestUserInteraction is in the IDL but has no normative algorithm yet. Headless is also a non-goal.
Browsers: Chrome published an early preview announcement Feb 10. There's an early DevTrial targeting desktop milestone 146 — the flag needs Chrome 146.0.7672.0+, reachable via Beta or Canary depending on timing. Important: this is explicitly framed as an early prototype for developer testing, not an intent to ship.
Edge — Microsoft co-authors the spec and Patrick Brosset said "stay tuned for more news from the Edge team," but there's no public ship timeline.
Firefox/Safari — blink-dev lists "Gecko: No signal" and "WebKit: No signal." No webmcp issues in either Mozilla's or WebKit's standards-positions repos.
Polyfill situation: You can experiment across browsers today, but a JS-only polyfill matches the API shape without native browser-agent mediation (trust model, permission UIs, CSS pseudo-classes, SubmitEvent.agentInvoked). The @mcp-b/webmcp-polyfill package gives you registerTool (and recently removed unregisterTool) on navigator.modelContext and keeps provideContext/clearContext as deprecated compat shims — it does not add callTool or listing APIs. @mcp-b/react-webmcp has React hooks with Zod validation. @mcp-b/transports covers postMessage tab/iframe and Chrome extension messaging for MCP connectivity in browser contexts.
So what does this mean for us? If your tool abstraction is name + description + JSON Schema + implementation, it maps cleanly to both WebMCP's ModelContextTool and MCP's tool definitions. The Abilities API fits this shape — it can feed both transports.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
swissspidy commentedon Apr 20, 2026
APIs and standards aside, I highly recommend checking out some demos at https://github.com/GoogleChromeLabs/webmcp-tools/ or videos such as https://www.youtube.com/watch?v=xQAYZBDV5jg to get a better understanding of WebMCP and its goals.
Also worth noting that in WordPress there would be 2 target audiences for this:
justlevine commentedon Apr 20, 2026
My concern about polyfiling is that both MCP and WebMCP beyond their own unstableness are explorative and moving quickly in different directions.
I think outsourcing the overhead of maintaining the polyfill to a 3rd party is a great idea, and something I think we can feel comfortable doing as a canonical plugin Experiment. the Experiment status would allow us to retire it more easily if contributors are unable to keep up with (the speed of) maintenance or if the spec itself turns out to be bunk.
(At the same time, I would caution us from diverting team resources away from more immediately practical and Experiments or Features to focus on this at their cost.)
fellyph commentedon Aug 27, 2026
OpenAI has included support to WebMCP https://openai.com/webmcp-challenge/
webmyc commentedon Aug 28, 2026
Following up on @fellyph's note: ChatGPT's browser shipping WebMCP support (Aug 25) changed the ground truth this issue was parked on in April. i've now run a WordPress WebMCP integration in production against it, built exactly the way the issue body hypothesized: Abilities API as the single tool registry, feeding both MCP and WebMCP. It works, and it surfaced concrete findings that i think are directly useful for designing the experiment.
The current dialect (as implemented by ChatGPT's in-app browser, tested Aug 26-28):
modelContextis exposed ondocument(notnavigator) and is a frozen object implementing onlyregisterTool. BatchprovideContextthrows, and in non-strict code the polyfill assignment fails silently, so tools just never register. Register one tool at a time.WordPress-specific integration traps any implementation here will hit:
wp_restnonce inX-WP-Nonce, and core hard-rejects any other nonce riding in that header. If the bridge uses its own CSRF token, it must travel in a separate header (we use two nonces:X-WP-Noncefor core, a second header for the bridge). Getting this wrong makes logged-in tool discovery run as an anonymous visitor: 401, zero tools, on every default-configured site./, and an URL-encoded slash is rejected by stock Apache before WordPress runs (AllowEncodedSlashes Off). Execution 404s on every Apache host. We map/to__in the execute route; the experiment will need some separator convention too.These were all found and fixed against the GPL bridge this ecosystem already has (code-atlantic/webmcp-abilities); the fixes are reported at code-atlantic/webmcp-abilities#3 with a standing PR offer, and our patched fork is public at https://github.com/respira-press/webmcp-for-wordpress (GPL-2.0). Live reference site if anyone wants to test in ChatGPT's browser: https://chatgpt-respira.instawp.site
Happy to bring any of this into the AI plugin experiment directly. The nonce handling, the Apache-safe naming, and the tool-curation layer are all small, self-contained pieces.
jeffpaul commentedon Sep 17, 2026
I'm leaving #224 open (in draft) as a decent "prior art" example, but expecting that the net result of the conversation here will likely be a new PR for an experiment in the AI plugin (ideally before WP 7.2 releases in early December).
webmyc commentedon Sep 18, 2026
Thanks @jeffpaul. i'll write that PR if nobody else has started.
Scoping it against trunk first: #224 predates the current framework (
Abstract_Experiment/Experiment_Loaderare gone, features now come fromAbstract_Feature+Features/Registry+Features/Loader), so this needs a fresh cut either way. @Jameswlepage, happy to send my pieces as patches into #224 instead if you want to carry it.Proposed shape: one experiment,
experimentalstability, disabled by default.includes/Experiments/WebMCP/registers a curated subset of abilities ondocument.modelContextviaregisterTool, one call per tool, plus a doc page and integration tests. The Abilities API stays the single registry, as the issue body proposed.Three requirements from running this in production since August, each self-contained:
wp_restnonce inX-WP-Nonce, and core hard-rejects any other nonce in that header, so an experiment-specific token has to travel in a second header. Getting this wrong makes a logged-in page register zero tools, silently, on every default-configured site./, and stock Apache rejects the encoded slash before WordPress runs (AllowEncodedSlashes Off). The experiment needs a separator convention on the wire. i map/to__and reverse it in the route, which is reversible and needs no host config.Two decisions i'd like from maintainers before i write it, because they're taste calls, not implementation ones:
Reference implementation, GPL-2.0, if it's useful while reviewing: https://github.com/respira-press/webmcp-for-wordpress and a live site to test in an agent browser: https://chatgpt-respira.instawp.site - i can provide a user account if needed - site is currently part of DevPost OpenAI WebMCP Challenge ending on September 23rd
If that scope sounds right, i'll open a draft PR in early October, which leaves room for review before 7.2.
Add WebMCP experiment
1 remaining item
webmyc commentedon Sep 30, 2026
Draft PR is up: #1081. It follows the shape from my comment above, against current trunk.
The two decisions are implemented the way i leaned, and each is a one-line change if you prefer otherwise: nothing is exposed unless an ability opts in through its meta, a filter allows it, or the site owner lists it in the experiment's settings; and tool names carry
__for/, as a constant rather than a filter so plugins can rely on one convention. @jeffpaul @gziolo, a yes or a no on either would let me finish it before the 1.5.0 window closes.swissspidy commentedon Sep 30, 2026
If you look at the spec and some of the documentation regarding WebMCP best practices you'll see that the intention is really for WebMCP to allow agents to programmatically interact with the UI on the current page.
https://developer.chrome.com/docs/ai/webmcp
https://developer.chrome.com/docs/ai/webmcp/build-tools (don't forget the evals!)
https://developer.chrome.com/docs/ai/webmcp/best-practices
On an e-commerce listing page, that could mean searching for products, managing the cart, and proceeding the check out. Each time, you would see the UI update (form being filled, cart being updated, navigation to checkout page, etc.), so as a user you know exactly what the agent is doing. See for example the awesome demos at https://github.com/GoogleChromeLabs/webmcp-tools/tree/main/demos
Blindly mapping Abilities API to WebMCP tools misses the mark on this.
webmyc commentedon Sep 30, 2026
@swissspidy @gziolo agreed on both counts, and thank you for saying it before i built further in the wrong direction. A WebMCP tool that fills the form, updates the cart and navigates, where the person watches it happen, is the WebMCP the demos show. And if the same site is already connected over MCP, registering the same server-side abilities again in the browser adds nothing.
So i would like to change what the experiment is, not defend it. What stays from the PR is the part that is the same either way: registration on
document.modelContextone tool at a time, the per-page budget, the per-screen curation, and the token handling for anything that does reach the server. What changes is the tool source:wpai.webmcp.registerTool, plus a hook so a screen or plugin can add tools) and tools whoseexecuteacts on the page;post.php, tools that dispatch intocore/block-editorandcore/editor(insert a block, set the title, replace a paragraph's text, save, publish), so the editor visibly updates while the agent works and the person can stop it;execute, not through a second exposure of the ability catalogue;Unless one of you says otherwise, i will rework #1081 on that shape this week and change its description to match. If you would rather see it as a new PR so the diff is clean, that works too.
WebMCP: drive the block editor on the page, not the Abilities API
jorgefilipecosta commentedon Oct 1, 2026
Good point, @swissspidy. I think we should have a set of client-side abilities that interact with the page, e.g., in the block editor, have abilities to insert blocks and change blocks similar to what a user does and where the user would see the action. On DataViews-based pages, have abilities to expose the data, execute actions on the data like a user would, etc. On all DataForms, provide abilities to read and fill them like a user would. I think the work on DataViews/DataForm already has a declarative structure for the data and makes it simple to implement abilities there. That said, I think the work to map the abilities to WebMCP tools should still happen and is useful. The very important work that should also happen is to provide the client-side abilities that interact with the page. Both are complementary. The server abilities may still be useful, for example, on Playground for site building, where it may be more efficient to just insert a set of posts and then call an ability to reload the preview in Playground.
webmyc commentedon Oct 2, 2026
@jorgefilipecosta thank you, that matches where #1081 landed: 14 tools that act in the block editor, with the canvas changing while the agent works. DataViews and DataForms sound like the right next screens. The registry in the PR lets a screen add its own tools, so I can take those as a follow-up once this one is in.
On mapping abilities to WebMCP: I dropped it from #1081 to keep the PR about one thing, but the code is still in its history (b575074), with the opt-in, the per-page cap and the tests. I am happy to bring it back as its own PR once there is an exposure rule for this channel, like
McpAbilityExposurefor MCP that @gziolo mentioned in #354. Playground site building looks like a good first case for it.Add WebMCP experiment
WebMCP: drive the block editor on the page, not the Abilities API
Add WebMCP experiment
WebMCP: drive the block editor on the page, not the Abilities API
Add WebMCP experiment
WebMCP: drive the block editor on the page, not the Abilities API