A single switch for agent-ready pages
WebMCP is a browser standard, shipping experimentally in Chrome 146, that exposes a site's capabilities to browser-based agents through document.modelContext. Instead of an agent guessing its way through human-oriented UI, a site can register tools that an agent calls directly. The catch has been that implementing WebMCP by hand requires designing tools, wiring them into existing interfaces, and keeping them current as the spec evolves.
Cloudflare now offers a developer preview that removes that work. With the feature enabled in the dashboard, Cloudflare injects a small bridge into HTML responses. The bridge registers a set of tools for a visitor's agent — no code changes, no deployment, and nothing modified at the origin.
What ships in the preview
The implementation has two parts, both running in front of your origin. Neither touches your site's code, and both work identically for static sites and single-page apps.
First, the edge injection. When WebMCP is toggled on for a domain in the Cloudflare Dashboard, HTMLRewriter adds a script reference to each HTML response:
<!-- Cloudflare injects this at the edge. Same origin, and your HTML is otherwise untouched. -->
<script type="module"
src="/.webmcp/bridge.js"
data-packs="c2pa,mcp-server-client"
data-mcp-url="/mcp"></script>
The data-packs attribute lists the tool packs to activate. If you already run a Model Context Protocol (MCP) server, data-mcp-url can point to it; the default is /mcp on the same origin.
Second, the bridge.
The script runs in the page, locates the WebMCP surface, and exits silently if unavailable — the page behaves exactly as before. Where the surface exists, the bridge composes the requested packs into one tool list and registers each tool with .registerTool.
Tool packs are groups of related tools that can be enabled as a set. Two ship in this preview, both executing entirely in the visitor's browser with no round trip to Cloudflare infrastructure:
- The Content Credentials pack reads C2PA provenance metadata locally.
- The Site MCP Server pack connects from the page to your MCP server endpoint, using the visitor's origin and session.
The bridge code itself is served by a worker at the edge, leaving room for future packs that may need server-side help — for example, summarizing a sitemap with Workers AI or querying an AI Search index.
To an agent, these tools look like ordinary MCP tools. The implementation uses MCP's own Tool and CallToolResult types, so an agent that already speaks to MCP servers can drive the page without anything special. Connecting an MCP tool of your own via the bridge looks like this:
// For each tool the site's own MCP server advertises (via tools/list),
// registering a proxy whose execute() calls the site back on the
// visitor's origin, with their session.
document.modelContext.registerTool({
name: tool.name, // e.g. "search_products"
description: tool.description,
inputSchema: tool.inputSchema, // taken straight from tools/list
execute: async (args) => {
const res = await fetch(mcpUrl, { // same-origin /mcp
method: "POST",
credentials: "same-origin",
headers: { "content-type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0", id: 1, method: "tools/call",
params: { name: tool.name, arguments: args },
}),
});
const { result } = await res.json();
return result; // an MCP CallToolResult, passed straight through
},
});
Inspecting content credentials
The Content Credentials pack reads provenance metadata for C2PA participants. A scan of all images returns a brief summary of each:
{
"imageCount": 12,
"scanned": 12,
"withC2pa": 8,
"results": [
{
"src": "https://example.com/hero.jpg",
"hasC2pa": true,
"format": "image/jpeg",
"manifestCount": 1,
"claimGenerator": "Adobe Firefly",
"title": "sunrise over the bay",
"signedBy": "Adobe Inc."
},
{ "src": "https://example.com/logo.png", "hasC2pa": false, "format": "image/png" }
]
}
For a deeper view, inspect_image_c2pa decodes a single image's full manifest — edit history, stated author, and signing certificate. The reader is plain TypeScript that touches only a few kilobytes of metadata at the front of the image. It reports credentials without cryptographic verification; every result carries signatureVerified: false, so an agent cannot mistake a decoded claim for a checked one.
Trying it out
Enablement takes one dashboard change. Go to Agent Readiness > WebMCP in the Cloudflare Dashboard, switch on WebMCP for the domain, and pick your packs. Both Content Credentials and Site MCP Server default to on, and future packs will appear there as they ship. There is nothing to deploy; the next HTML response includes the bridge.
Verification is straightforward — fetch any HTML page from your site and check that Cloudflare injected the script reference:
curl -s https://your-site.example | grep webmcp
Testing the tools does not require building your own agent. Cloudflare's BrowserRun remote browser already supports WebMCP: point it at a URL, and it will discover and call the tools the packs registered. The tools behave the same on a laptop browser or one running headless in the cloud.
This preview ships as a single step toward a web that accommodates non-human visitors. Feedback is welcome through the Cloudflare Developers Discord or the Community forum.



