What Is WebMCP?
WebMCP is a W3C Community Group standard that allows websites to expose structured tools to AI agents through browser-native APIs. Websites can opt in by annotating HTML forms or registering tools via JavaScript. BAP includes first-class WebMCP support — agents using BAP do not need a separate WebMCP integration.Two API Surfaces
Declarative (HTML Attributes)
Websites annotate forms with tool metadata:Imperative (JavaScript)
Websites register tools programmatically:Discovering WebMCP Tools
CLI
TypeScript SDK
MCP Tool
Thediscover_tools MCP tool is available to any MCP-native agent:
Fused Discovery with Observe
Get interactive elements and WebMCP tools in a single call:Progressive Detection
BAP’s discovery implementation follows a three-step strategy:1
Declarative Scan
Query the DOM for
form[toolname] elements and extract tool metadata from HTML attributes.
Fast, no JavaScript execution required.2
Imperative Scan
Check for
navigator.modelContext and enumerate programmatically registered tools. Catches
dynamic tools without DOM representation.3
Graceful Fallback
If neither API surface is present, return an empty tool list with
totalDiscovered: 0. No
errors — the agent proceeds with standard BAP automation.Agent Decision Pattern
The recommended pattern for agents:Discovery Response Format
source field: "webmcp-declarative" for HTML attribute-based tools or "webmcp-imperative" for JavaScript API-based tools.