WebMCP - Giving Browser Agents Tools Without an MCP Server


Sarah Dutkiewicz, Senior Trainer
In Teach Your AI Agent to Read This Blog with Agent Skills, we looked at agents that come to this blog from the outside: a coding agent or chat assistant that fetches llms.txt and the Markdown copy of a post. Those agents never render a page. They just read files.
There’s another kind of agent showing up: the one built into the browser. It sits next to the page you’re looking at, and you can ask it about that page or ask it to do something there. Today, that agent mostly works by reading the page and clicking things on it, the same way you would - only slower and more fragile.
WebMCP is a proposal to fix that. It lets a web page hand the browser’s agent a set of tools, written in JavaScript, with names, descriptions, and input schemas. This blog now registers two of them. In this post, we’ll look at what WebMCP is, how it relates to the MCP servers Barret covered in Next Level AI Coding Agents - MCP Servers and Building Your Own MCP Server in .NET, what we built, and how you might use it in your own apps.
A Quick MCP Refresher
Barret’s posts go into depth, but here’s the short version. The Model Context Protocol (MCP) connects an AI agent (the client) to a server that exposes tools, resources, and prompts. The server is a running process - local over stdio, or shared over Streamable HTTP - and the two sides talk JSON-RPC 2.0. In Barret’s .NET example, an MCP server exposes a GetShipmentStatus tool so an AI chat on a shipping company’s website can look up a customer’s order.
As Barret put it: an MCP server is just another delivery mechanism for your source of truth, the same as a controller or any other endpoint. Keep that idea in mind, because WebMCP is one more.
What WebMCP Is
WebMCP is a browser API that lets a page register tools for AI agents. The page is the server. There’s no separate process, no transport to configure, and no endpoint to host.
A tool looks a lot like an MCP tool:
await document.modelContext.registerTool({
name: "search_posts",
title: "Search NimblePros blog posts",
description: "Full-text search over NimblePros blog posts...",
inputSchema: {
type: "object",
properties: {
query: { type: "string", description: "Search terms" }
},
required: ["query"]
},
annotations: { readOnlyHint: true },
execute: async (input) => {
// Plain JavaScript, running in the page
}
});
The browser’s agent sees the tool’s name, description, and schema, decides when to call it, and gets back whatever execute returns.
It’s important to know what WebMCP isn’t: it isn’t MCP running in the browser. The explainer describes it as sharing “a common vocabulary with MCP” - tools, schemas, parameters - and says the editors considered adopting MCP directly and chose not to. Nothing in the page speaks JSON-RPC. If you’ve written MCP tools, though, WebMCP will feel very familiar.
Where It Stands
WebMCP is early, so set expectations accordingly:
- The spec is a Draft Community Group Report from the W3C Web Machine Learning Community Group. Editors are from Microsoft and Google. The latest draft is dated November 2, 2026. It’s not a W3C Standard, and it’s not on the standards track yet.
- Chrome 149 and Edge 150 have origin trials. For local development in Chrome, enable
about:flags#enable-webmcp-testing. - Brave has experimental support in its Leo AI chat. Firefox and Safari haven’t shipped anything.
- The API has already changed. Older Chrome builds exposed it as
navigator.modelContext. The spec now usesdocument.modelContext.
Check the implementation status page for the latest before you build on it.
MCP Server or WebMCP?
Barret compared skills to MCP servers. Here’s that comparison extended to WebMCP:
| Skills File | MCP Server | WebMCP | |
|---|---|---|---|
| What it gives the agent | Procedural knowledge | Live capabilities | Live capabilities on the current page |
| Lives in | A folder of Markdown | A running process | JavaScript in your web page |
| Used by | Any agent that loads skills | Coding agents, desktop apps, chat clients | AI agents in the browser |
| Requires running infra | No | Yes | No - your site already runs |
| Whose identity | None | Whatever credentials you configure | The user’s existing browser session |
| Available when | Always | Whenever the server runs | Only while the page is open |
The last two rows are the interesting ones. A WebMCP tool runs in the page, so it calls your APIs with the same cookies and session the user already has. You don’t hand an agent a token. And the tools exist only while the user has your page open, with the user watching.
The WebMCP explainer is clear about what it’s not trying to do: fully autonomous workflows with no browser UI, or replacing backend MCP or OpenAPI integrations. If you want an agent to work with your system on its own, in a CI pipeline, or from a terminal, build an MCP server. If you want to help an agent work alongside a user in your web app, WebMCP is the better fit.
What We Built for This Blog
We first heard about WebMCP from Is It Agent Ready?, a scanner that checks a site for the things AI agents look for, such as agent skills, discovery manifests, and WebMCP tools. It loads your homepage in a browser, reports what passes and what’s missing, and links to guidance for each check. The agent skills from the last post and the WebMCP tools in this one both came from working through that list.
This blog registers two read-only tools on every page, in static/js/webmcp.js:
search_poststakes aqueryand an optionallimit, and returns matching posts with title, URL, Markdown URL, and an excerpt.read_posttakes a post URL or slug, and returns that post as Markdown. With no argument, it reads the post you have open.
These are the same two jobs as the agent skills from the last post: find posts, then read them. The difference is that in the browser, we can do more than point at files.
Search Reuses What the Site Already Has
The blog is static, so there’s no search API. But the site’s search page uses Pagefind, which builds a search index when we deploy and runs searches in the browser. That’s exactly what a WebMCP tool needs. search_posts imports the same index and runs the same search:
execute: function (input) {
var query = String((input && input.query) || "").trim();
if (!query) {
return Promise.reject(new Error("query is required"));
}
var limit = Math.min(Math.max(parseInt(input.limit, 10) || 10, 1), MAX_RESULTS);
return loadPagefind()
.then(function (pagefind) { return pagefind.search(query); })
// ...keep only /blogs/ posts and shape the results
}
This is the “code reuse” goal from the WebMCP explainer in action. We didn’t build a search service for agents. We gave agents the search the site already had.
Reading Reuses the Markdown Copies
read_post fetches the post’s Markdown copy - the same index.md the agent skills point to:
return fetch(path + "index.md", { headers: { Accept: "text/markdown" } })
.then(function (response) {
if (!response.ok) {
throw new Error("No post found at " + origin + path + " (HTTP " + response.status + ").");
}
return response.text().then(function (markdown) {
return { url: origin + path, markdown: markdown };
});
});
Before fetching, it turns the input into a post path and rejects anything that isn’t a post on this site. A tool that takes a URL shouldn’t fetch whatever URL it’s handed.
A Few Design Choices
- Feature detection first. The script checks for
document.modelContext, then the oldernavigator.modelContext, and only in a secure context. In a browser without WebMCP, it returns before doing anything else. - Nothing loads until it’s needed. Registering a tool is cheap. The Pagefind index loads only on the first search, so readers who never use an agent don’t pay for it.
- Read-only, and marked that way. Both tools set
readOnlyHint: true, so the agent knows calling them changes nothing. - Error messages written for the agent. “Not a NimblePros blog post. Pass a URL like
https://blog.nimblepros.com/blogs/<slug>/or a post slug” tells an agent how to fix its next call. “Invalid input” doesn’t.
Trying It
In Chrome with about:flags#enable-webmcp-testing turned on, open any page on this blog and ask your browser’s agent something like:
- “Search this blog for posts about Testcontainers.”
- “Read this post and list the NuGet packages it uses.”
Which agent you use - and whether it picks up WebMCP tools yet - depends on your browser and its settings. That will change quickly.
How You Might Use It
A blog with two read-only tools is a gentle start. The bigger payoff is in apps where users get real work done. Let’s go back to Barret’s shipping scenario.
In Building Your Own MCP Server in .NET, the company wanted an AI chat on its website to check order status. Barret’s MCP server wraps a GetShipmentStatusQuery in the application layer and exposes it as a tool. That’s the right design when the company hosts the agent.
Now say the customer brings their own agent - the one built into their browser. They’re already signed in to the order history page. With WebMCP, that page can register the same capability:
await document.modelContext.registerTool({
name: "get_shipment_status",
title: "Get shipment status",
description: "Get the shipping status, carrier, tracking number, and estimated delivery for one of the signed-in customer's orders.",
inputSchema: {
type: "object",
properties: {
orderNumber: { type: "string", description: "Order number, for example ORD-10042" }
},
required: ["orderNumber"]
},
annotations: { readOnlyHint: true },
execute: async ({ orderNumber }) => {
const response = await fetch(`/api/orders/${encodeURIComponent(orderNumber)}/shipment`);
if (response.status === 404) {
throw new Error(`No order ${orderNumber} on this account.`);
}
return await response.json();
}
});
Behind /api/orders/{orderNumber}/shipment is an ordinary ASP.NET Core endpoint, and behind that is the same GetShipmentStatusQuery handler from Barret’s post. That’s the payoff of Clean Architecture here. The MCP server, the web API, and the WebMCP tool are three delivery mechanisms in front of one application layer. The business logic doesn’t know or care which one called it.
And notice what we didn’t have to do. The tool doesn’t need its own authentication. The fetch sends the customer’s session cookie, so the API’s existing authorization checks still decide which orders they can see. An agent using this tool can’t do anything the customer couldn’t do by clicking around the page.
A few more places WebMCP could fit:
- Line-of-business apps. Expose “find customer,” “filter this report,” or “fill in this form from the email I pasted” on the pages where users already do that work.
- Documentation sites. Register a search tool and a “get this page as Markdown” tool, the same way we did here.
- Internal tools. The explainer’s own examples include filtering products, editing designs, and checking code review status in Gerrit - all things a user does in the browser today.
Security Still Matters
Barret’s advice for MCP servers applies here too: least privilege, and watch what your agent is doing. WebMCP changes the details:
- The tool acts as the user. That’s convenient, and it’s also the risk. Start with read-only tools. Think hard before registering anything that changes data, spends money, or sends messages. The spec doesn’t define a consent prompt yet - user prompting is still an open question - so if a tool does something that matters, ask the user to confirm it in your own UI.
- Tool output is untrusted content. A blog post, a product review, or a support ticket could contain text written to trick an agent. The spec’s security section calls out prompt injection. Return the data the agent needs, and no more.
- Validate input like it came from the internet, because it did.
read_postrejects URLs on other sites.get_shipment_statusrelies on the API’s authorization, not on the agent asking nicely. - You control where tools are available. By default, tools are available in top-level pages and same-origin iframes. A cross-origin iframe needs
allow="tools", and you can turn WebMCP off entirely with thePermissions-Policy: tools=()header. To unregister a tool, pass anAbortSignalwhen you register it and abort it later.
Wrapping Up
Agent skills tell agents where to look. MCP servers give agents capabilities wherever they run. WebMCP gives agents capabilities on your page, using the user’s own session, while the user is right there.
For this blog, that meant about 200 lines of JavaScript that reuse search and Markdown copies we already had. For your apps, it could mean taking the application layer you’ve already built and offering it to the agent in your users’ browsers - with no new server to run.
The spec is still a draft and browser support is still in origin trials, so this isn’t something to ship to production and forget. It is a good time to experiment. Pick one read-only task your users do all the time, register a tool for it, and see how a browser agent handles it. If you’re not sure where to start, run your site through Is It Agent Ready? and see what it flags.
If you’d like help figuring out where AI agents fit in your applications - whether that’s WebMCP, an MCP server, or something else - reach out to NimblePros. We’re happy to help.
Resources
From the NimblePros Blog
- Teach Your AI Agent to Read This Blog with Agent Skills
- Next Level AI Coding Agents - MCP Servers
- Building Your Own MCP Server in .NET