DEV Community

Discussion on: What is WebMCP? Chrome's browser-native API for AI agents

Collapse
 
trinhcuong-ast profile image
Kai Alder

The declarative API is what makes this really interesting imo. Adding toolname and tooldescription to existing forms is dead simple — no JS needed, progressive enhancement baked in. That's gonna lower the adoption barrier a ton compared to server-side MCP.

One thing I'm wondering about though: how does this play with SPAs that use controlled components? Like in React, form state lives in component state, not in DOM attributes. Would the browser even see the right values when the agent tries to invoke a declarative tool? Seems like the imperative API would be mandatory for most modern frameworks.

Also the e.agentInvoked flag on submit events is clever. I can already think of use cases where you'd want different validation or logging paths depending on whether a human or agent triggered the action.