WebMCP: AI Agents are your new web visitors

This weekend, I decided to play with something that seems to have a lot of potential. As you probably know, I've been experimenting a lot with MCP lately (I even created mcpclick.app), and this discovery feels like a game-changer.
The web is changing. Until now, we built websites only for humans. But today, a new user is visiting our pages: AI Agents.
Have you ever tried to make an AI enroll in university courses or search for a specific class schedule on a student portal? It is slow and often fails. Why? Because the agent has to "read" the website like a human. It looks at the HTML and guesses which fields to fill. If you change your CSS even a little bit, the agent gets lost.
What problem does this solve for us as developers? It gives us a simple, fast way to tell the AI: "Don't guess. Use these tools instead."
This is WebMCP (Web Model Context Protocol).
What is WebMCP?
WebMCP is a new standard proposed by Microsoft and Google. Its goal is to make your website ready for agents.
Think of this as a Sitemap for actions. A sitemap.xml helps Google find your pages. WebMCP involves telling AI models (like Gemini, GPT, or Claude) what they can do on your site.
Two ways to use it:
- The HTML Way (Declarative): Great for forms. You add two simple attributes, and the browser handles the rest.
- The JavaScript Way (Imperative): For complex tasks, like calculations or real-time searching.
Setting Up Your Lab
This is new technology and has not yet arrived in standard browsers. To interact with it, you will need a special version of Chrome that includes the latest experimental features.
Don't worry, you can install it alongside your normal Chrome.
- Download Chrome Canary or Chrome Dev.
- Note: You need version 146 or higher.
- Open Chrome Canary and go to
chrome://flags. - Search for
#web-mcp(Web Model Context Protocol) and fully enable it. - Restart the browser.
Important: This is experimental software. Features may change or break without notice. It is designed for developers, so expect some rough edges!
The HTML Way
Imagine you have a blog. You want a user to say to their browser: "Search Dany’s blog for React articles."
Computers are bad at guessing. With WebMCP, we tell them exactly what to do using HTML:
<form
action="/search"
toolname="search_articles"
tooldescription="Search for tech articles by topic in the blog.">
<input type="text" name="query" placeholder="What to learn?" required />
<select name="category">
<option value="react">React</option>
<option value="typescript">TypeScript</option>
<option value="ai">AI</option>
</select>
<button type="submit">Search Now</button>
</form>What did we just do?
We added toolname and tooldescription. Now, the browser reads this form and creates a manual for the IA. The agent knows exactly how to use your search bar. It does not need to guess.
The JavaScript Way
Sometimes a form is not enough. Maybe you need to verify if a course has open seats without reloading the page. For this, we use JavaScript.
// Check if the browser supports this
if ('modelContext' in navigator) {
navigator.modelContext.registerTool({
name: "check_course_availability",
description: "Checks if a university course has open seats.",
inputSchema: {
type: "object",
properties: {
courseId: { type: "string", description: "The course code (e.g., CS101)" },
semester: { type: "string", description: "Target semester (e.g., Fall 2026)" }
},
required: ["courseId", "semester"]
},
execute: async (args) => {
// Fetch real-time data from your API
const response = await fetch(`/api/courses/${args.courseId}/status?sem=${args.semester}`);
const data = await response.json();
return {
available: data.seats > 0,
remainingSeats: data.seats,
professor: data.professorName
};
}
});
}Why is this cool?
Now, an AI (like a browser Copilot) can call check_course_availability directly. It doesn't need to navigate complex tables. It just asks your code for the answer.
Is it Safe?
Yes. Security is built-in:
- You know who called: You can check if a human or an AI sent the form (the proposal adds an
agentInvokedproperty toSubmitEvent). - Private: The agent only sees the tools you list.
- Consent: The browser usually asks the user before the AI takes action (like buying something).
Go Explore!
This is just the beginning. We are moving to a web where sites are APIs for AI.
I encourage you to try it out. It is fun to be an early adopter.
Don't just read about it. Experiment. Try to make your own "Agent-Ready" website.
Photo by Urban Vintage on Unsplash
Frequently Asked Questions
What is WebMCP and how does it make a website accessible to AI agents?
WebMCP, the Web Model Context Protocol, is an experimental standard proposed by Microsoft and Google that lets developers describe the actions available on their website in a machine-readable way. Instead of an AI agent trying to interpret HTML visually and guessing how to interact with a form, WebMCP provides explicit tool definitions that tell the agent exactly what inputs to provide and what the site can do, making agent interactions fast and reliable.
What is the difference between the declarative HTML approach and the imperative JavaScript approach in WebMCP?
The declarative HTML approach uses special attributes added directly to existing form elements to expose simple actions like search or submit to AI agents without writing any JavaScript. The imperative JavaScript approach uses the browser API to register custom tools programmatically, which is better suited for complex interactions such as calculations, real-time data lookups, or multi-step workflows that cannot be expressed through static HTML markup alone.
What browser and version do I need to experiment with WebMCP today and why is it not available in stable browsers yet?
You need Chrome Canary or Chrome Dev at version 146 or higher with the web-mcp flag manually enabled in chrome://flags. WebMCP is not available in stable browsers because it is still an early-stage experimental proposal and the specification is actively evolving. Shipping experimental features in stable browsers before the standard is finalized would risk breaking real websites if the API changes, so it is intentionally limited to developer preview builds.
Related Articles
Dockerizing Next.js: The Hidden Challenges
Vercel hides the complexity of environment variables. When you move to Docker, these hidden challenges surface. Learn the architecture to scale your app correctly.
Building a Local AI Chatbot with Gemini Nano, Chrome Canary, Angular, and Kendo AI Prompt
The race for AI continues. Alternatives like Ollama help us interact with AI models on our machines. However, the Chrome and Google teams are moving one step forward by enabling Chrome with Gemini Nano running in our browsers. Note this API is exper...
What I Learned: From AI Chat Demos to Real AI Products
In 2025, I built quite a few demos using Gemini and Kendo UI, building small chat experiences using chatbots combined with Conversational UI for quick prototypes, taking a piece of text (sometimes an image) and sending back a nice-looking answer. The...
Real Software. Real Lessons.
I share the lessons I learned the hard way, so you can either avoid them or be ready when they happen.
Join 13,800+ developers and readers.
No spam ever. Unsubscribe at any time.