Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
WebMCP - Enable AI agents to interact with your web applications through structured tools. Implements the WebMCP standard for Next.js/React apps with tool re...
WebMCP - Enable AI agents to interact with your web applications through structured tools. Implements the WebMCP standard for Next.js/React apps with tool re...
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Enable AI agents to interact with your web applications through structured tools. WebMCP provides a clean, self-documenting interface between AI agents and your web app.
WebMCP is a web standard that gives AI agents an explicit, structured contract for interacting with websites. Instead of screen-scraping or brittle DOM selectors, a WebMCP-enabled page exposes tools β each with: A name A JSON Schema describing inputs and outputs An executable function Optional annotations (read-only hints, etc.)
# Initialize WebMCP in your Next.js project webmcp init # Add a new tool webmcp add-tool searchProducts # Generate TypeScript types webmcp generate-types
const searchTool = { name: "searchProducts", description: "Search for products by query", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query" } }, required: ["query"] }, outputSchema: { type: "string" }, execute: async (params) => { // Implementation }, annotations: { readOnlyHint: "true" } };
Tools are registered when components mount and unregistered when they unmount: useEffect(() => { registerSearchTools(); // Tools appear to agent return () => { unregisterSearchTools(); // Tools disappear }; }, []);
Tools communicate with React through CustomEvents: Agent β execute() β dispatch CustomEvent β React updates β signal completion β Agent receives result
βββββββββββββββββββββββββββββββββββββββββββ β Browser (navigator.modelContext) β β β β βββββββββββββ registers/ ββββββ β β β AI Agent ββββunregistersβββββweb β β β β (Claude) β tools βmcpβ β β β β β.tsβ β β β callsββββββΌββββββββββββββββββΊβ β β β βββββββββββββ ββββ¬ββ β β β β β CustomEventβ β β dispatch β β β βΌ β β ββββββββββββββββββββββββββββββββββββ β β β React Component Tree β β β β β β β β ββββββββββββ ββββββββββββ β β β β β/products β β /cart β β β β β βuseEffect:β βuseEffect:β β β β β β register β β register β β β β β β search β β cart β β β β β β tools β β tools β β β β β ββββββββββββ ββββββββββββ β β β ββββββββββββββββββββββββββββββββββββ β βββββββββββββββββββββββββββββββββββββββββββ
# In your Next.js project npx webmcp init # Or install globally npm install -g @webmcp/cli webmcp init
webmcp init This creates: lib/webmcp.ts - Core implementation hooks/useWebMCP.ts - React hook components/WebMCPProvider.tsx - Provider component
// lib/webmcp.ts export const searchProductsTool = { name: "searchProducts", description: "Search for products", execute: async (params) => { return dispatchAndWait("searchProducts", params, "Search completed"); }, inputSchema: { type: "object", properties: { query: { type: "string" } }, required: ["query"] }, annotations: { readOnlyHint: "true" } };
// app/products/page.tsx "use client"; import { useEffect, useState } from "react"; import { registerProductTools, unregisterProductTools } from "@/lib/webmcp"; export default function ProductsPage() { const [results, setResults] = useState([]); const [completedRequestId, setCompletedRequestId] = useState(null); // Signal completion after render useEffect(() => { if (completedRequestId) { window.dispatchEvent( new CustomEvent(`tool-completion-${completedRequestId}`) ); setCompletedRequestId(null); } }, [completedRequestId]); // Register tools + listen for events useEffect(() => { const handleSearch = (event: CustomEvent) => { const { requestId, query } = event.detail; // Perform search setResults(searchProducts(query)); if (requestId) setCompletedRequestId(requestId); }; window.addEventListener("searchProducts", handleSearch); registerProductTools(); return () => { window.removeEventListener("searchProducts", handleSearch); unregisterProductTools(); }; }, []); return <div>{/* Product UI */}</div>; }
CommandDescriptionwebmcp initInitialize WebMCP in projectwebmcp add-tool <name>Add new tool definitionwebmcp generate-typesGenerate TypeScript typeswebmcp example <type>Create example project
{ name: "viewCart", description: "View cart contents", annotations: { readOnlyHint: "true" } }
{ name: "addToCart", description: "Add item to cart", annotations: { readOnlyHint: "false" } }
{ name: "setFilters", inputSchema: { type: "object", properties: { category: { type: "string", enum: ["electronics", "clothing"] }, maxPrice: { type: "number" } } } }
webmcp example e-commerce Features: Product search Cart management Checkout flow Order tracking
webmcp example dashboard Features: Widget interactions Data filtering Export functionality Real-time updates
webmcp example blog Features: Article search Comment posting Category filtering Related articles
Use camelCase verbs that describe the action: β searchProducts β addToCart β updateProfile β product_search β handleCart
Write clear, specific descriptions: β "Search for products by name or category" β "Search stuff"
Always include descriptions for parameters: properties: { query: { type: "string", description: "The search query to find products by name or category" } }
Register tools only when relevant: // Product page useEffect(() => { registerProductTools(); return () => unregisterProductTools(); }, []); // Cart page useEffect(() => { registerCartTools(); return () => unregisterCartTools(); }, []);
Always handle timeouts and errors: async function execute(params) { try { return await dispatchAndWait("action", params, "Success", 5000); } catch (error) { return `Error: ${error.message}`; } }
WebMCP requires browsers that support: CustomEvent API navigator.modelContext (proposed standard) For development, use the WebMCP polyfill: import "@webmcp/polyfill";
WebMCP Specification Example Projects React Integration Guide
ai-labs-builder: Use WebMCP to make AI apps agent-accessible mcp-workflow: Combine with workflow automation gcc-context: Version control your tool definitions
Code helpers, APIs, CLIs, browser automation, testing, and developer operations.
Largest current source with strong distribution and engagement signals.