webmachinelearning/webmcp
Instead of AI agents fumbling with clicks on a webpage, websites now tell agents exactly what functions they can call
WebMCP is a browser standard proposal letting web developers register JavaScript functions or HTML forms as AI-usable 'tools' with natural-language descriptions and structured schemas. Rather than having AI agents take screenshots and simulate mouse clicks to operate a site, a page calls document.modelContext.registerTool() to directly expose its own functions. It was first published August 13, 2025 by authors from Microsoft and Google, and has since been actively developed further, led by Dominic Farolino.
What it does
- A website registers a 'tool' via document.modelContext.registerTool() with a name, description, input schema (JSON Schema), and an execute function; built-in browser AI, extensions, or AI running in an iframe can then discover tools with getTools() and run them with executeTool()
- Existing approaches like Model Context Protocol (MCP) or OpenAPI are 'backend integrations' where the AI platform talks directly to a server, forcing developers to replicate user state and authentication on a separate backend and bypassing the page's own UI—WebMCP avoids this by defining tools directly in client-side script
- HTML <form> elements can be turned into tools declaratively without extra code, while JavaScript functions are exposed via the imperative registerTool API
- Access across iframes or origins is controlled via Permissions Policy (allow="tools") and the exposedTo option; tool execution can be cancelled mid-flight with AbortSignal, and dynamic changes are tracked via the toolchange event
- Example use cases described include filtering and editing templates plus ordering prints on a design site, filtering dresses by photo on a shopping site, and diagnosing failing build bots and applying code fixes in Gerrit
Why it matters
As AI agents increasingly operate websites on users' behalf, today's approach of mimicking clicks via screenshots is slow and unreliable. If WebMCP becomes standard, developers can reuse existing client-side code to let AI safely and accurately act on their own sites.
Terms in this repo
- MCP (Model Context Protocol) · A protocol from Anthropic that lets AI models connect to and use external services' functionality
- registerTool · The core WebMCP function a webpage calls to expose a function to AI agents
- inputSchema · A JSON Schema defining what input a tool expects
- Permissions Policy · A browser mechanism for allowing or blocking specific features in frames like iframes
- AbortSignal · A web standard signal used to cancel an in-progress operation
Repository description (English)
🤖 WebMCP
Open on GitHubProject siteCoverage
Trending repos
- tt-a1i/archify
- bookorbit/bookorbitA self-hosted book server that syncs your reading progress across web, Kobo, and KOReader
- ConardLi/garden-skills
- browser-use/browser-use
- K-Dense-AI/scientific-agent-skills
- DietrichGebert/ponytailA ruleset that teaches AI coding agents to say no to writing code
- liustack/modlensA plugin that lets text-only AI models like DeepSeek 'see' pasted images by turning them into structured text data
- marin-community/marinMarin is an open-source platform that publishes the entire process of building large language models, not just the final model
Latest from METAL LAB
- Ox Alpha turns out to be GLM-5.3-Flash
- Martin Casado says AI has erased startups' distribution barrier
- OpenAI introduces Runme, which uses Codex to document repetitive work
- Stable Diffusion Maker Raises $76M From Music, Game Studios
- Meta's paid agent Hatch to launch alongside new Watermelon model in October