Agent-friendly websites
Use WebMCP to build sites that work better with AI agents.
WebMCP APIs
Overview
What is WebMCP and why should you care?
Imperative API
Define WebMCP tools with standard JavaScript to execute site-specific functions, such as form input and site navigation.
Declarative API
Transform your standard HTML forms into WebMCP tools by adding annotations.
WebMCP and MCP
Together, WebMCP and MCP help agents accomplish personalized tasks on behalf of human users.
How WebMCP works
In just three steps, your site tells agents exactly what they can do.
Step 1
Your site registers tools
Your site declares the actions an agent can take, as WebMCP tools. Each tool has a name, description, and JSON schema.
// Imperative API document.modelContext.registerTool({ name: "bookSlot", title: "Book a consultation slot", description: "Reserve a 30-minute consultation.", inputSchema: { type: "object", properties: { date: { type