agent-ready-webmcp
Sub-skill de agent-ready-cloudflare: Implement WebMCP
Files1
View on GitHubSKILL.mdskills/agent-ready-cloudflare/webmcp/SKILL.md
GitHubImplement WebMCP
Expose site tools to AI agents via the browser using the WebMCP API (Chrome blog, declarative API).
Requirements
- Call
document.modelContext.registerTool()for each tool you want to expose; it returns a Promise - Each tool needs
name,description,inputSchema(JSON Schema), and anexecutecallback - Tools should expose your site's key actions (search, navigation, data retrieval)
- Pass an
AbortControllersignal in the options to unregister tools when no longer needed - For existing HTML forms, add
toolnameandtooldescriptionto the<form>andtoolparamdescriptionto its inputs to expose them declaratively - Older Chrome builds expose the API on
navigator.modelContext; feature-detectdocument.modelContextfirst and fall back to it if needed - The API is detected by loading the page in a browser — ensure the script runs on page load
Validate
POST https://isitagentready.com/api/scan
Content-Type: application/json
{"url": "https://YOUR-SITE.com"}
Check that checks.discovery.webMcp.status is "pass".