A JavaScript function with a natural language description and a JSON Schema for its inputs. Agents discover it, call it, and read its serialized result.
WebMCP is a JavaScript API that lets a web page expose its functionality as tools AI agents can call. Instead of an agent guessing from pixels and clicks, the page publishes named actions with schemas. The specification says such pages can be thought of as client-side MCP servers.
A JavaScript function with a natural language description and a JSON Schema for its inputs. Agents discover it, call it, and read its serialized result.
The registry of tools attached to every document, reached via document.modelContext. Register, list and execute tools through it.
An autonomous assistant acting on the user's behalf: built into the browser, an AI platform, or in-page JavaScript.
What a browser agent sees of the page: available tools, possibly with screenshots and the accessibility tree.
The imperative API is the current specification: document.modelContext.registerTool(), discovery, execution, cancellation, events, annotations and cross-frame exposure. Chrome 149 and Edge 150 list origin trials; ChatGPT Desktop lists WebMCP support. Browser support is still experimental and must be feature-detected.
Declarative HTML forms are a separate proposal: attributes such as toolname, tooldescription, toolparamdescription and toolautosubmit are not part of the normative specification today. The audit inventories this markup as experimental evidence but does not grade it as spec conformance.
Three methods on document.modelContext carry registration, discovery and invocation. Registration and execution each use an AbortSignal; toolchange, toolactivated and toolcancel expose lifecycle events.
async function installTools() { const mc = document.modelContext; if (!mc?.registerTool) return () => {}; const lifecycle = new AbortController(); await mc.registerTool({ name: "search_products", title: "Search Products", description: "Search product catalog", inputSchema: { type: "object", properties: { query: { type: "string" }, maxResults: { type: "number" } } }, execute: async (input, { signal }) => { // Validate in code; schema is not authorization. const { query, maxResults = 10 } = validate(input); return search({ query, maxResults, signal }); }, annotations: { readOnlyHint: true, untrustedContentHint: true, consequentialHint: false, debugging: false } }, { signal: lifecycle.signal }); return () => lifecycle.abort(); } const disposeTools = await installTools(); // Later, on logout, route change or teardown: // disposeTools();
Loads without a forced WebMCP flag, reads native registrations, response headers, Permissions Policy and origin-trial tokens.
Forces the experimental Blink feature and compares the result with pass 1. This separates a live deployment from code that is present but dark.
Installs a document-start recorder to retain legacy entry points, raw schemas, annotations and exposedTo before WebIDL normalizes them.
Also inventoried: all readable frames, experimental declarative-form attributes, iframe allow="tools" grants, redirects, HTTP status and resource budgets. Findings are deterministic and carry a field-level citation.
Agent readiness: four extra fetches (robots.txt, llms.txt, the sitemap, /.well-known/security.txt) and the page's head metadata feed a separate checklist that never affects the grade. Each check and its source.
Deliberate limits: the public audit never calls a tool, does not sign in, cannot prove that a description matches the hidden implementation, and observes one point in time after a fixed settle window. A clean report is not a certification and cannot cover authenticated states, user-only routes or behavior that appears after interaction.
The security section is guidance, not a page-author conformance class. We label findings derived from it SECURITY, not SPEC; only actual API requirements are reported as spec violations.
Malicious instructions in tool metadata or outputs manipulate the agent: metadata poisoning, output injection, attacks on tool implementations.
A tool's description need not match its behavior. Authenticated tools can purchase, transfer or delete without explicit verification.
Over-parameterized input schemas quietly exfiltrate sensitive user data through tool parameters.
Cross-origin access requires explicit exposedTo grants; the "tools" permissions policy defaults to same-origin only.
Run them through the audit before an agent does it for you.