AI news and explainers at 7 AM weekdays, plus a Sunday weekly at 8Get it in your inbox

METAL LAB

webmachinelearning/webmcp

3,223Bikeshed

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

  1. 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()
  2. 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
  3. HTML <form> elements can be turned into tools declaratively without extra code, while JavaScript functions are exposed via the imperative registerTool API
  4. 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
  5. 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 site

Coverage

Trending repos

All repos →

Latest from METAL LAB