When you move from server-side MCP (stdio or HTTP tools running on your own backend) to client-side WebMCP ( document.modelContext inside a live browser tab), your failure modes change completely.
In the browser, routes unmount mid-call, tabs navigate, multiple origins exist in frames, and experimental APIs may be partially implemented or disabled.
Spec maturity note: WebMCP is an experimental Community Group draft ( spec text ), not a W3C Standard. Chrome trials and early polyfills may differ, so defensive runtime checks matter.
While building open-source examples and an interactive playground for testing document.modelContext , these are the four lifecycle bugs that bit us first—and the patterns that fixed them.
Bug 1: Treating registerTool Presence as Full Execution Support
It's tempting to check if (document.modelContext) and enable your entire agent UI.…