Overview
Your frontend AI agents need a way to interact with your website. This guide shows how to wire WebMCP tools into frameworks like Assistant-UI, AG-UI, or custom runtimes, then use the MCP client protocol to let agents discover and call your tools. By the end, your AI will be able to understand and use every feature you expose.How Frontend Tool Calling Works
1
Register tools on your website
Tools are defined and registered on your website using
navigator.modelContext2
Connect an MCP client
Your AI runtime connects to the website’s tools using an MCP client
3
Register tools with AI runtime
The MCP tools are registered with your frontend AI framework
4
AI calls tools
When the AI needs to use a tool, it calls through your runtime → MCP client → WebMCP
5
Tool executes on frontend
The tool runs in the browser, returns results to the AI
Supported Frameworks
WebMCP tools work with any frontend AI framework that supports tool calling:Assistant-UI
React framework for building AI assistants with built-in tool support
AG-UI
Agentic UI framework with frontend-defined tools
Custom Runtime
Build your own integration with any AI framework
Key Benefits
Tool Execution in Browser
With WebMCP frontend tool calling, tools execute in the browser:- ✅ Direct access to DOM, localStorage, app state
- ✅ No server roundtrip required
- ✅ Works offline
- ✅ Real-time UI updates
