WebMCP: Teaching Your Website to Talk to AI Agents
TL;DR Highlight
Let sites declare tools and agents call them without guessing at the DOM
Who Should Read
Frontend or full-stack developer whose browser agents keep breaking when scraping their web app's buttons and forms
Core Mechanics
- Declare tools instead of scraping
- Today agents read HTML, guess buttons, click, and break when layouts change.
- WebMCP lets a site register tools like book_table with a name and input schema.
- Redesigns don't break it as long as the tool name and schema stay the same.
- A draft standard from Chrome and Edge
- It is a W3C Web Machine Learning Community Group draft, not a finished standard.
- It is an origin trial from Chrome 149 and can be enabled locally via chrome://flags/#enable-webmcp-testing.
- Chrome's docs say it is subject to change.
- Registering a tool is one call
- Pass name, description, inputSchema (JSON Schema), and execute to document.modelContext.registerTool.
- execute just calls functions your site already has, like addTodoToPage.
- A declarative option annotates HTML forms instead.
- Runs in the logged-in tab
- execute runs visibly in the user's open page with their own JS and session.
- There is no headless background execution.
- A tools Permissions Policy defaults to self, so cross-origin iframes can't register tools on their own.
- Split read, reversible, and risky actions
- The author's Career Copilot demo groups 13 tools into read-only, reversible changes, and one human-approved action (submit_batch).
- Hints like readOnlyHint and untrustedContentHint let tools label themselves.
- Sensitive actions like purchases can require a user confirmation dialog.
- ChatGPT did real work through declared tools
- The author had ChatGPT read a resume and score 24 real job descriptions on the demo site.
- The result was 4 shortlisted, 0 applied, stopping at the human gate.
- The demo was built by the author, so this is not independent verification.
Community Reactions
- Why not plain APIs or server-side MCP
- Some argue a robust server-side MCP is better for new services.
- Others say WebMCP helps with cross-site tasks and client-side UI actions like filtering.
- Another view is that it suits big legacy web SaaS that can layer it over existing UI.
- Tying it to the browser is a weakness
- Some say listing and calling tools needs a JS environment, limiting it to in-browser agents.
- Others prefer publishing options under .well-known so any client can use them.
- Worry about humans and agents diverging
- One view is that maintaining separate info for humans and agents will drift apart.
- Another skeptical view is that only about 0.1% of sites adopt such features properly.
- Simpler alternatives people tried
- One commenter exposed an AI summary of actions per HTMX component with a short-lived token prompt and said even small models navigated well.
- Another said an accessibility engineer called WebMCP accessibility tech disguised as an AI thing.
How to Apply
- List 3 candidate actions on your site
- In 30 minutes, write down 3 things you want agents to do, like search, filter, or create a ticket.
- Classify each as read, reversible change, or risky action.
- Check whether a JS function for each already exists.
- Enable the flag and register one tool
- Turn on chrome://flags/#enable-webmcp-testing.
- Register one read-only tool with registerTool.
- Confirm it appears in DevTools under Application → WebMCP.
- Put a human gate before risky actions
- Route irreversible tools like payments or submissions through a confirmation dialog.
- Add readOnlyHint to read-only tools.
- Add untrustedContentHint to tools that return third-party content.
- Add a shim for the API rename
- Support both document.modelContext and navigator.modelContext with a one-line shim.
- Keep it on an experimental branch and don't ship to production.
Try It
// Enable chrome://flags/#enable-webmcp-testing in Chrome 149+, then paste into your page's console or script
const mc = document.modelContext || navigator.modelContext;
await mc.registerTool({
name: 'add_todo',
description: 'Add an item to the to-do list',
inputSchema: {
type: 'object',
properties: { text: { type: 'string' } },
required: ['text']
},
execute: async ({ text }) => {
addTodoToPage(text); // {{replace with an existing function on your site}}
return `Added to-do: ${text}`;
}
});
// Next: check DevTools → Application → WebMCP for the tool, then register one more read-only toolTerminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques