Back to blog
AgentsTechnicalTechnical article

WebMCP: When Your Website Becomes an API for Artificial Intelligence

Published 19 Feb 20264 min readStéphane

Decision summary

The era of 'Scraping' is over. Google Chrome reveals how websites will natively converse with AI models.

MCPAgentsTokens
WebMCP: When Your Website Becomes an API for Artificial Intelligence

For years, we have built the web for two types of users: humans (graphical interfaces) and indexing bots (SEO). Today, a third category is knocking insistently at the door: AI agents.

Until now, the interaction between an AI (like an agent browsing in the browser) and a website was archaic. The agent had to "watch" the page (computer vision) or parse raw HTML code (scraping) to understand how to click a button or fill out a form. It's slow, resource-intensive, and breaks at the slightest CSS update.

The recent announcement from the Chrome Developers team regarding the Web Model Context Protocol (WebMCP) changes the game. Here is why every web developer needs to pay attention.

What is WebMCP?

WebMCP is not just a simple JavaScript library. It is a proposed web standard that aims to expose a website's functionalities directly to AI models, via the browser.

Imagine that your website has a "hidden interface" dedicated to AIs. Instead of guessing where the "Add to Cart" button is, the AI can query the browser and receive a clear answer: "Here is the addToCart(productId) function that you can call."

Technically, this relies on a new API primitive: navigator.modelContext.

The Two Pillars of Integration

The Chrome Developers article details two approaches to making a site "AI-Compatible":

1. The Imperative Approach (The Power of Code)

This is the most flexible method for complex web applications (SPA, React, Vue, etc.). Developers can use JavaScript to register specific "tools".

Instead of letting the AI parse your DOM, you give it an instruction manual:

  • Definition: You describe a function (e.g., "Search for a flight").
  • Schema: You define the expected parameters (e.g., origin, destination, date).
  • Execution: The AI calls this function, and your site executes the logic in the background.

This literally transforms your Frontend into a local API for the agent.

2. The Declarative Approach (HTML Semantics)

This is the "soft" method, ideal for static content or classic forms. It relies on enriching HTML semantics. If your site already respects accessibility standards and uses correct semantic tags, you are halfway there. WebMCP allows annotating these elements so that the AI understands without ambiguity: "This is the main search field".

Why is this a Strategic Revolution?

The introduction of WebMCP in Chrome (currently in preview via registration) signals the end of makeshift solutions for web agents.

The End of Costly Visual Inference

Today, an agent that navigates visually consumes a huge amount of tokens and computing power to analyze screenshots. With WebMCP, data exchange happens in lightweight JSON. It is faster, greener, and infinitely cheaper.

Robustness Against UI Changes

This is the nightmare of bot developers: you change the color of a button or the structure of a div, and the bot no longer works. With WebMCP, the AI interacts with a logical abstraction, not pixels. You can completely redesign your interface; as long as the underlying functions (the "Tools") remain the same, the agent continues to work.

"Human in the Loop"

A crucial point highlighted by the Chrome team is security. Unlike server-side autonomous agents, WebMCP is designed to assist the user during their navigation. The user sees what the agent is doing. The AI becomes a navigation copilot, capable of filling out complex forms or filtering results instantly, under human supervision.

What You Need to Do Today

Although WebMCP is still in its infancy (available via an Early Preview Program), the direction is clear. We are moving from SEO (Search Engine Optimization) to AIO (AI Optimization).

For developers, this means:

  1. Monitor the evolution of navigator.modelContext.
  2. Rethink your application architecture: do not just think "User Interface" (UI), but "Agent Interface" (AI).
  3. Register for the test program if you develop complex SaaS applications, as those who adopt this standard first will offer a radically superior experience to AI assistant users.

The web is evolving. It is no longer just about being seen, but about being usable by the machines that assist us.

Source and technical documentation: Chrome Developers Blog - WebMCP Early Preview

RouterLab endpoint

Try the RouterLab API

Move from the article to a real request: start a trial, get a key, and call models through an OpenAI-compatible API.

https://api.routerlab.ch/v1