How Do You Try WebMCP on WordPress? A Step-by-Step Guide for Forms and Themes
WebMCP is a draft web standard that lets a web page offer its own functions to AI agents in the browser as structured tools. To try it on a WordPress site you do not need to wait for a ready-made plugin; a few HTML attributes and a small script are enough to get started. 🧪
This article walks through trying WebMCP step by step in a WordPress theme and its forms. The guide is based on Chrome’s documentation and the W3C draft; we will update the page once the log of our trial on the AINEO theme is complete. WebMCP is still a draft and in trial.
What should you know before trying it?
BU BÖLÜMÜN ÖZETİ
- Draft and trial status
- The API’s new home
- The secure context requirement
WebMCP’s current status decides how the trial is set up. As of 12 November 2026, three points matter.

Draft and trial status
WebMCP is a draft developed in the W3C Web Machine Learning Community Group; it is not a finished standard. Chrome has been trialling it as an origin trial since version 149, and Edge runs a trial too. Because the scope and length of the trial can change, Chrome’s current documentation is read before every trial. What WebMCP is and why it matters is covered in what is WebMCP. 📄
The API’s new home
Since the July 2026 draft, tools are registered through document.modelContext instead of navigator.modelContext, and Chrome 150 deprecated the old name. Many examples online still show the old name. When writing code, document.modelContext is preferred, and the script first checks whether the feature exists in the browser; if it does not, the page simply keeps working as before.
The secure context requirement
According to the draft, modelContext exists only in a secure context, which means pages served over HTTPS. WebMCP does not work on a site without a valid SSL certificate. In local development, localhost counts as a secure context; on the live site, check that the certificate is valid and that the page shows no mixed-content warnings before the trial begins. 🔒
How do you run a local test and register for the trial?
BU BÖLÜMÜN ÖZETİ
- Local testing with a Chrome flag
- Origin trial registration
- Adding the token to WordPress
You test in your own browser first, then on the live site.
Local testing with a Chrome flag
To test on your own computer, enable the chrome://flags/#enable-webmcp-testing flag in Chrome and restart the browser. The flag affects only your own browser; nothing changes for visitors. This stage is ideal for testing tool definitions safely before they go live, and for seeing errors in the console without any risk to real users. 🧭
Origin trial registration
To switch the trial on in visitors’ browsers on the live site, you obtain a trial token for your domain in the Chrome Origin Trials console. The token is added to the page with a meta tag or with an Origin-Trial HTTP header. Trial tokens have an expiry date; the date goes into the calendar and the token is renewed before it lapses.
Adding the token to WordPress
In WordPress, the trial token can be added with a one-line meta tag hooked into wp_head in the theme’s functions.php file, or with a header in the server configuration. Using a child theme stops the addition from being lost when the theme updates. The change is tested on a staging site first, then moved to the live site. 🧩
How do you open forms to agents?
BU BÖLÜMÜN ÖZETİ
- toolname and tooldescription
- Field descriptions and auto-submit
- Working with form plugins
The declarative route opens existing HTML forms to agents without writing JavaScript.

toolname and tooldescription
According to Chrome’s documentation, a form becomes a tool when you add the toolname and tooldescription attributes; the name states the tool’s purpose and the description says what it does. If either attribute is removed, the tool is unregistered. For example, a contact form could be given the name “request_quote” and a one-sentence description. ✍️
Field descriptions and auto-submit
Individual fields can be given descriptions with toolparamdescription, while the toolautosubmit attribute lets the form submit itself once the agent has filled it in. By default, submission waits for the user’s confirmation; on forms such as quotes, bookings or orders, that confirmation must be kept in place at all times.
Working with form plugins
If a form is generated by a plugin, adding the attributes depends on the plugin’s support for custom HTML or filters; in forms written by hand in the theme, the attributes go straight into the HTML. Whether a plugin update strips the attributes is checked after every update. The principles of designing forms for agents are covered in designing forms for agents. 🔧
How do you define a tool with a script?
BU BÖLÜMÜN ÖZETİ
- The registerTool call
- Adding the script to WordPress
- Tracking with events
The imperative route opens functions that have no form to agents too, such as on-site search or a product lookup.
The registerTool call
A tool is defined with a document.modelContext.registerTool() call: you give it a name, a description, a JSON schema for its inputs and an execute function that does the work. The script first checks ‘modelContext’ in document; if there is no support, it stops quietly and the page keeps working normally for every visitor. 💻
Adding the script to WordPress
The script is written as a separate JavaScript file and added to the theme with wp_enqueue_script, so it works in step with WordPress’s script ordering and caching. The tool loads only on the pages that need it, for example a product lookup tool on shop pages. For on-site search, the WordPress REST API can serve as the data source.
Tracking with events
According to Chrome’s documentation, a toolactivated event fires on document.modelContext when an agent fills in a form, and a toolcancel event fires when the user cancels the operation. Sending these events to your analytics tool shows how often each tool is used. Measurement takes the trial’s result out of the realm of guesswork. 📈
How do you keep it safe and maintained?
BU BÖLÜMÜN ÖZETİ
- Start with read-only tools
- Origin limits
- A maintenance calendar
Every tool opened to agents is a new door from the site to the outside. Three rules form the base.

Start with read-only tools
The first trial uses tools that only read data: search, product information, opening hours. Actions that change data or spend money are not left to agents without the user’s confirmation. A tool with lasting effects is added only after the records of the read-only tools have been reviewed and the results are understood. ✅
Origin limits
According to the draft, tools are visible by default only to same-origin documents and to the browser’s built-in agent; exposing them to a cross-origin frame requires explicit opt-in on both sides. Widening the default needs a strong reason. Tool descriptions avoid wording that could mislead the agent or overstate what the tool does.
A maintenance calendar
As the draft changes, attribute and function names can change too, and the trial token expires. A monthly check confirms that each tool still works and matches the documentation. The general WordPress-side preparation is covered in preparing a WordPress site for agents, which pairs well with this guide. 📅
What does Adapte Digital do in a WebMCP trial?
BU BÖLÜMÜN ÖZETİ
- A single delivery package
- What is delivered
- Where to start
We plan the WebMCP trial on your WordPress site: which form and which function are opened to agents, the confirmation rules and the measurement are written down in advance, and the trial is tested on a staging site.
A single delivery package
Adapte Digital does not charge a monthly management fee. Work starts with a single delivery package whose scope is written down in advance: 36,000 TRY + VAT. If the work grows, the new need is defined as a separate add-on package, priced by what will be delivered rather than by the hours spent. 📦
What is delivered
The output is a tool list, a form attribute plan, a script draft and a measurement note. Which agents may reach the site at all is a separate decision, covered in agent access policy.
Where to start
Our current packages and capacity are listed on our campaign pages; scope and price are written there before any work starts. 🧭
If you see a business opportunity here, we wrote a separate article on WebMCP implementation services.
Quick Summary
- WebMCP is a draft web standard that offers a page’s functions to agents as tools.
- Chrome has trialled it since version 149; tools are registered through document.modelContext.
- Forms open to agents through the toolname and tooldescription attributes; submission waits for confirmation by default.
- A scripted tool is defined with registerTool and added to WordPress with wp_enqueue_script.
- The trial starts with read-only tools; the trial token and the draft are checked monthly.
Short Glossary
- Origin trial
- A programme in which a browser switches on a new feature for registered sites for a limited time.
- Declarative API
- A way to define tools with HTML attributes, without writing JavaScript.
- Secure context
- A page environment served over HTTPS or localhost, in which sensitive features are allowed.
Frequently Asked Questions
Next Step
List the forms and frequently used functions on your site; pick the first two read-only tools and test them with the local flag. Our campaign pages list the delivery packages that cover this work.
Sources: Chrome for Developers — WebMCP Declarative API · W3C Web Machine Learning Community Group — WebMCP (taslak) · WordPress Developer Resources — wp_enqueue_script()
Updated: November 2026
Sık Sorulan Sorular
No. Adding attributes to forms and attaching a small script to the theme is enough; the trial token is added with a meta tag.
As of 12 November 2026 it works in Chrome through the origin trial and the local testing flag, and in Edge as a trial; other browsers have made no commitment.
Unless toolautosubmit is added, submission waits for the user’s confirmation. That confirmation should be kept on quote and order forms.
