Build a Minimal WebMCP Agent with Playwright and Gemini
WebMCP is the idea that a web page can declare its own tools — buttons, forms, data endpoints — in a way an AI agent can discover and call directly, instead of the agent guessing at the DOM. This writeup builds the smallest possible working example: a Playwright-controlled browser session paired with a Gemini model that reads those tool declarations and executes them. The pattern matters because most browser-automation AI demos are either screenshot-based guessing games or rely on proprietary connectors. WebMCP gives the page itself agency over what the agent can touch, which is a cleaner contract. The walkthrough is minimal by design — no framework magic, just the wiring — so a technical reader can see every seam and decide what to swap out. Reservation: WebMCP is not yet a standard, so any page you want to automate needs to be instrumented by you or the page owner first. That is a real adoption wall. -> Best for: AI engineer or solo founder building browser-automation or agent-based workflows