<div class="x9k _f3 css-1qhz">
<svg viewBox="0 0 16 16">…</svg>
<span class="v _t">72°</span>
<button class="btn-4a" onclick="…">
<i class="ico ico--sm"></i>
</button>
</div>Scrape the DOM. Guess which pixel is a button. Click and hope. It breaks the moment the markup changes.
A two-minute walkthrough. I built a tiny smart home into this page — scroll, and watch the live panel change.
Now picture an AI agent trying to use it. Today it renders the page, scrapes the DOM, and guesses which pixel is a button. To an agent, this page is pixels.
WebMCP flips the approach. Instead of making agents guess, the page declares its capabilities as tools: a name, a description, and a JSON Schema for the inputs. That’s the whole contract.
I defined these once. Three devices became three typed, callable functions — each card in the panel is matched to the device it controls.
Try it: the palette below is live, and it drives the devices above. Each parameter form is generated straight from the tool’s schema — an enum becomes a dropdown, a bounded number becomes a slider.
This is the agent’s-eye view: the tools registered on document.modelContext right now. No scraping, no guessing — a typed catalog.
This site serves Chrome’s WebMCP origin-trial token. If your browser has the API, this page registered its three tools for real. If not, the panel shows the same content, labeled simulated. Both states are the truth.
Because the tools are typed, natural language can compile into a plan: one sentence in, three tool calls with real parameters out.
The planner here is scripted so the walkthrough needs no API key — in your app you plug in Anthropic, OpenAI, Gemini, or your own provider.
A plan is not an action. With approval turned on, agentk shows you the plan and waits — nothing touches the devices until you say go.
Click Approve & run and watch the devices actually change.
WebMCP is early — the panel is the deal today. If the trade sounds right, everything you just used is one npm install away.