The Problem with Agentic Web Interaction

Currently, AI agents navigate the web by "seeing" it like a human: parsing the entire DOM, analyzing the accessibility tree, taking screenshots, and calculating pixel coordinates to click elements. This process is token-intensive, slow, and highly brittle—a single layout shift from an ad can break the agent's entire workflow. Before implementing agent-specific standards, developers should ensure their sites are "agent-ready" by adhering to semantic HTML, robust accessibility standards, and core web vitals, which provide the foundation for reliable automation.

Introducing WebMCP

WebMCP (Web Model Context Protocol) is a proposed standard that treats a website as a set of structured tools rather than a visual interface. It acts as the client-side counterpart to the broader MCP standard, allowing agents to interact directly with browser-based features. By providing a menu of named, typed, and described actions, developers enable agents to execute complex tasks—like filtering products or booking tickets—reliably and efficiently without guessing UI elements.

Implementation Approaches

WebMCP provides two primary APIs for exposing site capabilities:

  • Declarative API: Best for standard HTML forms. By adding specific attributes (e.g., tool-name, tool-description) to existing form elements, the browser automatically generates a JSON schema that agents can interpret. This requires minimal code changes.
  • Imperative API: Designed for complex, multi-step UI flows. Developers register custom tools using JavaScript, defining a schema and an execute block. The execute block runs standard DOM logic, validates inputs, and returns state back to the agent, ensuring the UI remains in sync with the agent's actions.

Getting Started

WebMCP is currently in an experimental early preview stage (Chrome 146+). Developers can test their sites using:

  • Chrome Canary: Required to enable the experimental WebMCP testing flag.
  • Model Context Tool Inspector: A Chrome extension that lists available tools on a page and allows for debugging agent interactions.
  • Evaluation CLI: Available in the official GitHub repository to test and benchmark tool performance on custom sites.