/webmcp-browser-agents:webmcp-dev-patternsfrom webmcp-browser-agents
Applies WebMCP cross-cutting development patterns for SPA routing, error handling, performance optimization, multi-site agents, accessibility, SEO, and production deployment. Useful when architecting WebMCP-enabled sites or solving cross-cutting concerns.
Ships in webmcp-browser-agents. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
https://developer.chrome.com/docs/ai/webmcp for the latest developer guidance and patternswebmcp development best practices patterns for community patternswebmcp SPA single page application routing for SPA-specific patternswebmcp SEO agent discovery for discoverability patternsIn single-page applications, tools must be managed across route changes:
// React example: register/unregister tools on route change
useEffect(() => {
const tools = getToolsForRoute(currentRoute);
tools.forEach(tool => navigator.modelContext.registerTool(tool));
return () => {
// Cleanup on route change
tools.forEach(tool => navigator.modelContext.unregisterTool(tool.name));
};
}, [currentRoute]);
Key principles:
clearContext() or selective unregisterTool)Tools should handle errors at multiple levels:
Network errors:
async execute(input) {
try {
const res = await fetch(`/api/products?q=${input.query}`);
if (!res.ok) {
return { status: "error", code: res.status, message: "Server error" };
}
return await res.json();
} catch (err) {
return { status: "error", code: "network_error", message: "Unable to reach server" };
}
}
Business logic errors:
async execute(input) {
const product = await fetchProduct(input.productId);
if (!product) {
return { status: "error", code: "not_found", message: "Product not found" };
}
if (!product.inStock) {
return { status: "error", code: "out_of_stock", message: "Product is out of stock" };
}
// proceed...
}
Consistent error format:
{ status: "error", code: "error_code", message: "Human-readable message" }
WebMCP tools are inherently faster than UI scraping, but optimize further:
Agents may navigate across multiple sites, each with WebMCP:
Agent Journey:
1. Open site-a.com → discovers tools [searchA, addToCartA, checkoutA]
2. Call searchA("wireless headphones") → get results
3. Open site-b.com → discovers tools [searchB, addToCartB, checkoutB]
4. Call searchB("wireless headphones") → get results
5. Agent compares results and recommends best option to user
6. User picks site-a → agent calls addToCartA and checkoutA
Design implications:
WebMCP tools should support accessible interactions:
WebMCP enhances AI discoverability:
As tools evolve:
searchProductsV2) for backward compatibilitydestructiveHint, etc.) set on all toolsTrack agent interactions in production:
Commerce platforms will likely add built-in WebMCP support:
toolname attributes to Liquid templatesMonitor your platform's announcements for native WebMCP support.
Fetch the latest community patterns, Chrome DevTools features, and platform integration announcements before architecting.
What SKILL.md sets; muted values are Claude Code's defaults
14 skills in this plugin
/webmcp-authenticationImplement WebMCP authentication patterns — browser session inheritance, cookie-based auth, role-gated tool registration, and conditional tool exposure. Use when managing which tools are available based on user authentication state./webmcp-commerce-toolsImplement commerce-specific WebMCP tools — product search, cart management, checkout, returns, subscriptions, and support. Use when building agentic shopping experiences on e-commerce websites./webmcp-context-providerImplement the WebMCP provideContext API — bulk tool registration, contextual metadata, page state sharing, and dynamic context updates. Use when providing rich context and multiple tools to agents simultaneously./webmcp-declarative-formsImplement the WebMCP Declarative API — annotate HTML forms with toolname and tooldescription attributes for automatic tool extraction. Use when making existing forms agent-ready with minimal code changes./webmcp-mcp-bridgeIntegrate WebMCP client-side tools with backend MCP servers and UCP endpoints — bridge browser-based agent interactions with server-to-server protocols. Use when connecting front-end WebMCP to existing backend API infrastructure./webmcp-polyfillSet up and use the MCP-B polyfill — vanilla JS and React packages that implement navigator.modelContext for browsers without native WebMCP. Use when developing for browsers that don't yet support WebMCP natively.npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin webmcp-browser-agentsOther plugins' skills for the same job