Agent Experiences

WebMCP: The Web Finally Gets an Agent API

By Alan WeibelPublished 11 min read

What it is

WebMCP (a way for a web page to hand AI agents a list of actions they can take) is a draft standard. It is being written at the W3C (the body that sets web standards) in its Web Machine Learning Community Group, co-edited by Google and Microsoft. With it, a web page declares tools, written in JavaScript, that an agent can call. It entered a Chrome origin trial (a test period when sites can switch on an unfinished browser feature) with Chrome 149 in June 2026, running through Chrome 156. It hasn't shipped, and the spec is still changing.

Source: W3C Web Machine Learning Community Group

Every agent that has ever tried to use your website has done it the same clumsy way. It reads the finished page, guesses what each part of the screen means, and clicks things. The agent is working out your interface on the fly because you never gave it anything better. WebMCP is the first serious attempt to give it something better: a way for a page to say "these are the things you can do here, this is what each one needs, call this one." This post covers why clicking through pages goes wrong, what WebMCP does instead, how it compares with running a separate server for AI tools, and how to design and secure the tools you offer.

The problem with agents driving the page by hand

Right now, agents get things done on websites by pretending to be a user. They find the search box, type, click, wait, read the results, find the button, and click it. Developers call this driving the DOM (the browser's live model of every element on the page), and it goes wrong for both sides in several separate ways.

It breaks easily. Renaming a CSS class (a style label in the page code), reordering a form, or adding a new pop-up page in between can break an agent that had learned your layout, so any redesign can knock out the agents using your site. You won't know it broke, and you never agreed to keep it working.

You also can't see it happening. An agent clicking through your page looks like a visit with slightly odd timing, and you can't count it, group it, limit it separately, or decide anything about it, because nothing marks it as an agent.

Worse, it looks like abuse. A well-meaning agent filling in a form for a user looks a lot like a credential-stuffing script (a bot that tries stolen passwords over and over), close enough that security systems treat them the same way. Legitimate agents get caught by bot blockers, and you lose customers without ever finding out why.

And it forces the agent to guess what you meant from the visual layout: what this button does, whether this action can be undone, which of three similar-looking forms is the right one. Every guess is a chance to be confidently wrong for a real user, and better AI models won't change that, because the fix is the site saying plainly what it offers.

What WebMCP does

Here's the shape of it in words. We've left out example code on purpose, because the API (the set of commands developers write code against) is still changing, and wrong code is worse than none.

A page registers tools with the browser. Each tool has a name, a description of what it does written for both people and AI models, a schema (a description of the inputs the tool expects and their format), and a JavaScript function that does the work. An agent running in that browser, whether it's the user's assistant, an agent built into the browser, or an extension, finds the tools the current page has declared and calls them by name, passing inputs in the expected format. Your function runs in your page, inside your own JavaScript, with the user's existing session and your existing code. It sends back a structured answer, instead of a redrawn screen the agent has to read all over again.

The name is deliberate. WebMCP takes the idea behind the Model Context Protocol, or MCP (a standard way to plug tools into AI assistants), and moves it into the web page instead of a separate server. Two things follow from that straight away.

Logging in is already handled. The agent works inside the user's logged-in session. There's no OAuth (the "allow this app to access your account" handshake between services) to set up, no extra keys to swap, and no separate account linking. If the user can see something in their browser, the agent acting for them can reach it. Anything the user can't see, the agent can't reach either, so the permission model is the one you already built and already test.

Your existing app does the work. A tool calls the same functions your buttons call. Instead of building and maintaining a second API next to your app, you're putting labels on ways into the one you already have.

WebMCP or an MCP server?

They aren't rivals. They answer different questions, and what decides between them is where the agent is running and whose session it's in.

WebMCPMCP server
Where the agent runsIn the user's browser, on your pageAnywhere: a server, a desktop app, the cloud
Logging inThe user's existing session, with nothing to buildOAuth or API keys that you set up and manage
What it can reachExactly what this user can already seeWhatever you grant the integration, possibly across many users
Works without a browser windowNo, it needs a browser with the page openYes
What it costs to buildDeclare tools over code you already haveBuild and run a service, plus sign-in and rate limits
Good forAssistants helping a logged-in user do a task on your siteBehind-the-scenes integrations, bulk jobs, automation across many users, anything scheduled
How mature it isIn a Chrome trial, spec still changingEstablished and widely used

A rule of thumb: if a person is there and logged in, WebMCP is the natural fit and far cheaper. If the work happens without anyone sitting there, like nightly syncs, one server talking to another, or agents working across many users' data, you need a real MCP server, and nothing in the browser will stand in for it. Plenty of organizations will end up wanting both, offering some of the same actions through each, and that's fine.

The set of tools you offer is a design decision

Once agents call the functions you declare instead of clicking on the screen, that set of functions becomes something you design, like any other part of your product. It has names, a level of detail, rules for what errors say, and an audience that isn't human.

The instinctive move is to offer your internal API as tools, one for one. That almost always makes for a bad agent experience, because your internal API is split up around how your data is stored, while an agent is trying to finish a user's task, and those two divide up in different ways.

An internal API might offer create-cart, add-item, set-quantity, apply-promotion, set-shipping-address, and submit-order. An agent asked to "reorder what I got last month" now has to put six calls in the right order, cope if one fails halfway, and know things about your business that it can only guess at. A tool called reorder-previous-order, which takes an order reference and returns either a confirmation or a specific reason it couldn't go ahead, is one call. Any failures are yours to handle, instead of the agent's to improvise around.

A few rules for designing your tools:

Name tools after what people want to do, not after your endpoints (the individual addresses your servers answer requests on). The name and description are the only way an agent finds out what a tool is for. It decides whether to call your tool based on whether the description matches what it's trying to do. Write descriptions the way you would for a capable new colleague who has never seen your product.

Size tools by task, not by database table. Prefer one tool that finishes a recognizable piece of work over five that have to be chained together. Chains are where agents fail, and each extra call multiplies the chance of leaving something half-finished on your side.

Make errors useful. "Invalid input" tells an agent nothing, so it will retry the same thing. "Quantity exceeds the 10-unit limit for this item" tells it what to do next, and often lets it recover without bothering the user.

Say what can't be undone. If a tool charges a card, cancels a subscription, or deletes something, the description should say so plainly. Agents pass descriptions to models that weigh up risk, and some assistants will check with the user before calling something described as destructive, which is free safety you only get if the description says so.

Don't offer everything. The right set is the tasks users really hand off, not a copy of your feature list. A long list of tools is harder for an agent to choose from correctly, and every tool you declare is one more thing you have to defend.

Every tool is a logged-in door into your app

It bears repeating, because thinking "it's only some JavaScript on my page" leads people astray. A WebMCP tool runs with the user's full login, called by a program you didn't write, acting on instructions it may have picked up somewhere you can't inspect.

Prompt injection (hidden instructions planted in content an AI reads) is the concrete threat, and it isn't hypothetical. An agent working in a browser reads content from pages, and to a language model, content can act as instructions. A hostile page, whether it's another tab, an embedded widget, a forum comment, or an email open in webmail, can contain text written to steer the agent somewhere else. That agent then arrives at your page with a goal the user never gave it, and calls your declared tools with the user's full authority. Brave's security research on agentic browsers (browsers with an AI assistant built in that can click and type for you) has documented both indirect injection through page content and "unseeable" prompt injection delivered through screenshots, where a person looking at the same pixels the model is reading can't see the injected text at all.

So, when you design tools:

  • Treat every tool call as untrusted input from the public internet, because that's what it really is. Check the inputs on your server. The declared schema is a hint for the agent, not a security control.
  • Keep anything destructive or financial behind a confirmation in your own interface, not behind a setting you trust the agent to respect. If a tool moves money or deletes data, the confirmation should be something your customer sees and acts on.
  • Run your normal permission checks on your server for every call. A tool running in the user's session doesn't mean the action is allowed, so check it like any other request.
  • Rate-limit (cap how often something can be called) per account and per action. An agent stuck in a retry loop is a kind of load your site should cope with without anyone having to notice.
  • Log tool calls separately. This is the first time you can actually see what agents are doing on your site, so record it from day one instead of adding it later. Our measurement guide covers which agent signals are worth capturing.

Where to put your effort now

  • Don't build anything your live site depends on with WebMCP yet. It's in an origin trial. The API will change before it ships, if it ships.
  • Do design your set of tools. Write down the five to ten tasks users most want to hand off on your site. That list travels with you: it's the same list you need for an MCP server, an assistant integration, or whichever standard ends up winning.
  • Check which of those can't be undone. Anything that moves money or destroys data needs a step where a human confirms it before you open it to any agent, by any route.
  • Measure first. You can't design for agent behavior you've never measured. Start telling agent traffic apart from human traffic now.
  • Watch the trial, not the hype. Chrome 149 through 156 is the window. What matters is whether the companies behind Safari and Firefox get involved.

Where WebMCP stands today

WebMCP is a Community Group draft. At the W3C, that means interested parties are working on it, not that anything has been standardized. Google and Microsoft co-editing it is a strong signal, since those two make the browsers most people use, but it isn't a commitment. The origin trial exists precisely to find out whether the design holds up on real sites. Origin trials end, and while some go on to become a permanent part of the browser, others quietly don't.

The reason to pay attention anyway is that the pressure behind it is real, whichever specification wins. Agents are arriving inside real browser sessions with an ordinary user agent (the name a browser sends to say what it is), and right now they're reduced to guessing at your interface. We looked at that from the traffic side in Atlas is dead, agentic browsing isn't and from the legal side in the court just ruled your agent is you. Something will eventually let sites declare what they can do instead of leaving agents to work it out. WebMCP is the most credible candidate so far, and the design thinking it asks for (what are the tasks, what are the tools, what's dangerous) will keep its value whatever the API ends up looking like.

References