webmcp
This skill guides AI agents in implementing WebMCP within web projects, enabling browser-native structured tools for AI interaction using JavaScript or HTML APIs.
About this skill
The `webmcp` skill empowers AI agents to facilitate the integration and management of the WebMCP (Web Model Context Protocol) standard in web applications. WebMCP provides a structured, browser-native way for AI agents to interact with websites, moving beyond unreliable screen-scraping to use defined JavaScript APIs (`window.navigator.modelContext`) and HTML annotations (`toolname`/`tooldescription` attributes on forms). This skill offers comprehensive guidance for an AI agent to assist developers through the entire WebMCP lifecycle. It covers initial setup and integration, adding new tools via both imperative JavaScript and declarative HTML methods, debugging tools that aren't functioning as expected, auditing existing implementations against best practices, and testing the functionality of WebMCP tools. Developers leverage this skill to create more robust and reliable AI-agent-friendly web interfaces. The core principles enforced by this skill ensure that tools are atomic, accept natural user input, validate data programmatically, update the UI before confirming execution, and are described clearly. This ensures AI agents can interact with web applications efficiently and predictably, reducing errors and improving the overall user experience for AI-driven workflows.
Best use case
The primary use case is for web developers and teams who are building or maintaining web applications and want to enable AI agents (like Claude, Cursor, or similar tools) to interact with their sites in a structured, reliable, and programmatic manner. It's ideal for making web applications 'AI-native' by providing well-defined interfaces instead of relying on brittle screen-scraping techniques. Developers benefit by creating more robust integrations for AI-assisted workflows.
This skill guides AI agents in implementing WebMCP within web projects, enabling browser-native structured tools for AI interaction using JavaScript or HTML APIs.
A web project with WebMCP successfully implemented, allowing AI agents to interact with defined browser-native structured tools reliably and programmatically.
Practical example
Example input
Help me set up WebMCP in my web project's frontend code.
Example output
Okay, I can assist with WebMCP setup. Before we begin, please confirm you are running Chrome 146.0.7672.0 or newer and have enabled the `chrome://flags/#enable-webmcp-testing` flag. What is the root directory of your project?
When to use this skill
- When you need to integrate the WebMCP standard into a new or existing web project.
- When adding new structured tools for AI agents using either JavaScript or HTML APIs.
- When debugging or auditing existing WebMCP implementations for correctness and best practices.
- When aiming to make a web application more reliably interactive for AI agents, avoiding screen-scraping.
When not to use this skill
- When the target browser is not Chrome 146.0.7672.0+ or `chrome://flags/#enable-webmcp-testing` cannot be enabled.
- For tasks unrelated to implementing, debugging, or auditing WebMCP in a web project.
- If structured browser-native tools for AI agent interaction are not a requirement.
- When working with server-side APIs or non-browser contexts where WebMCP is not applicable.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/webmcp/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How webmcp Compares
| Feature / Agent | webmcp | Standard Approach |
|---|---|---|
| Platform Support | Claude | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | medium | N/A |
Frequently Asked Questions
What does this skill do?
This skill guides AI agents in implementing WebMCP within web projects, enabling browser-native structured tools for AI interaction using JavaScript or HTML APIs.
Which AI agents support this skill?
This skill is designed for Claude.
How difficult is it to install?
The installation complexity is rated as medium. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
<essential_principles> WebMCP is a browser-native standard that exposes structured tools for AI agents on websites. Instead of screen-scraping, agents interact through typed JavaScript APIs and HTML annotations. **Two APIs:** - **Imperative API** — `window.navigator.modelContext` — register tools via JavaScript - **Declarative API** — HTML `toolname`/`tooldescription` attributes on `<form>` elements **Prerequisites:** Chrome 146.0.7672.0+, `chrome://flags/#enable-webmcp-testing` enabled. **Core principles that always apply:** 1. **Tools must be atomic and composable** — one function per tool, no overlapping tools with nuanced differences. Combine similar tools into one with input parameters. 2. **Accept raw user input** — tools should accept natural strings (e.g., "11:00") not computed values (e.g., minutes-from-midnight). Minimize cognitive computing for the model. 3. **Validate in code, not schema** — schema constraints are helpful but not guaranteed. Validate within execute functions and return descriptive errors so agents can self-correct. 4. **Update UI before returning** — agents use UI state to verify execution. Ensure execute/submit logic updates visible state before resolving. 5. **Positive, verb-first descriptions** — describe what the tool does and when to use it. Avoid negations. "Creates a calendar event for a specific date" not "Do not use for weather." </essential_principles> <intake> What would you like to do? 1. **Set up WebMCP** in a project (initial integration) 2. **Add a tool** using the imperative JavaScript API 3. **Add a tool** using the declarative HTML form API 4. **Debug** WebMCP tools that aren't working 5. **Audit** existing WebMCP implementation for best practices 6. **Test** WebMCP tools 7. Something else **Wait for response before proceeding.** </intake> <routing> | Response | Workflow | |----------|----------| | 1, "setup", "integrate", "install", "start" | `workflows/setup-webmcp.md` | | 2, "imperative", "javascript", "js", "register", "programmatic" | `workflows/add-imperative-tool.md` | | 3, "declarative", "html", "form", "annotate" | `workflows/add-declarative-tool.md` | | 4, "debug", "fix", "broken", "not working", "error" | `workflows/debug-webmcp.md` | | 5, "audit", "review", "check", "best practices" | `workflows/audit-webmcp.md` | | 6, "test", "verify", "inspect" | `workflows/test-webmcp.md` | | 7, other | Clarify, then select workflow or references | **After reading the workflow, follow it exactly.** </routing> <reference_index> All in `references/`: **APIs:** imperative-api.md, declarative-api.md **Design:** tool-design.md **Events:** events-and-css.md **Quality:** testing.md, anti-patterns.md </reference_index> <workflows_index> All in `workflows/`: | Workflow | Purpose | |----------|---------| | setup-webmcp.md | Initial WebMCP integration into a project | | add-imperative-tool.md | Register tools via JavaScript API | | add-declarative-tool.md | Annotate HTML forms as WebMCP tools | | debug-webmcp.md | Diagnose and fix WebMCP issues | | audit-webmcp.md | Review implementation against best practices | | test-webmcp.md | Test tools with inspector extension and agents | </workflows_index> <templates_index> All in `templates/`: | Template | Purpose | |----------|---------| | imperative-tool.md | Scaffolding for JS-registered tools | | declarative-form.md | Scaffolding for HTML form-based tools | </templates_index> <verification_loop> After every WebMCP change: 1. Open Chrome DevTools console — check for JS errors 2. Verify `navigator.modelContext` exists (Chrome flag enabled?) 3. Use Model Context Tool Inspector extension to list registered tools 4. Manually execute a tool from the inspector to confirm it works 5. Check that UI updates are visible after tool execution Report to user: - "Tools registered: X imperative, Y declarative" - "Tool [name]: executes successfully / returns error [detail]" - "UI state: updates correctly after execution / missing update" </verification_loop>
Related Skills
laravel-expert
Senior Laravel Engineer role for production-grade, maintainable, and idiomatic Laravel solutions. Focuses on clean architecture, security, performance, and modern standards (Laravel 10/11+).
Prompt Coach
Analyze your Claude Code session logs to improve prompt quality, optimize tool usage, and enhance your skills as an AI-native engineer.
nextjs
Provides comprehensive Next.js routing capabilities, including typed routes, helpers for `PageProps` and `LayoutProps`, and `nuqs` for managing URL state.
react
This AI agent skill guides the generation of modern React components, incorporating best practices such as destructured props, leveraging compiler optimizations, and proper use of React Effects. It also ensures compatibility and utilizes Tailwind CSS v4 syntax.
just
Use `just` to save and run project-specific commands. Use when the user mentions `justfile`, `recipe`, or needs a simple alternative to `make` for task automation.
chrome-debug
This skill empowers AI agents to debug web applications and inspect browser behavior using the Chrome DevTools Protocol (CDP), offering both collaborative (headful) and automated (headless) modes.
worktree-manager
Create, manage, and cleanup git worktrees with Claude Code agents across all projects. USE THIS SKILL when user says "create worktree", "spin up worktrees", "new worktree for X", "worktree status", "cleanup worktrees", "sync worktrees", or wants parallel development branches. Also use when creating PRs from a worktree branch (to update registry with PR number). Handles worktree creation, dependency installation, validation, agent launching in Ghostty, and global registry management.
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
osgrep
Semantic code search using natural language queries. Use when users ask "where is X implemented", "how does Y work", "find the logic for Z", or need to locate code by concept rather than exact text. Returns file paths with line numbers and code snippets.
10up-css
CSS architecture, best practices, and patterns for WordPress projects. Covers ITCSS methodology, accessibility, specificity management, naming conventions, and modern CSS features.
agentifind
This skill sets up codebase intelligence for AI agents by running the `agentifind` CLI to extract code structure and synthesize a `CODEBASE.md` navigation guide. It includes staleness detection and intelligently handles LSP installation for optimal accuracy.
CLAUDE.md – JJ Quick Command List
A concise cheat sheet for essential Jujutsu (`jj`) version control commands, designed to help AI agents or users quickly perform common repository operations.