WebMCP Declarative API: How to Turn an HTML Form Into an AI Agent Tool
With four HTML attributes, an ordinary form can become a tool AI agents understand. This step-by-step tutorial shows how, and where the approach…
WebMCP is a proposed web standard that lets a website tell AI agents exactly which actions it supports. Instead of an agent guessing which buttons to click, the page exposes clear tools, such as “search flights” or “book a table”, that the agent can call directly.
The proposal is being developed in the open by the W3C Web Machine Learning Community Group, and you can follow the official explainer on GitHub. It builds on ideas from the Model Context Protocol, which connects AI apps to outside tools and data.
New to the topic? Read our plain-English overview first. Then compare the two approaches in our side-by-side comparison with MCP. If you build websites, our declarative API tutorial shows how to turn a normal HTML form into an agent-ready tool.
Agents that rely on screenshots and clicks often break when a layout changes. By contrast, structured tools are faster and far more reliable. Therefore, sites that adopt WebMCP early could be easier for AI assistants to use and recommend.
With four HTML attributes, an ordinary form can become a tool AI agents understand. This step-by-step tutorial shows how, and where the approach…
The JavaScript side of WebMCP gives developers full control over the tools agents can call. Here's how registerTool() works, with simple examples…