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.

1,093 stars
Complexity: medium

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

$curl -o ~/.claude/skills/webmcp/SKILL.md --create-dirs "https://raw.githubusercontent.com/qdhenry/Claude-Command-Suite/main/.claude/skills/webmcp/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/webmcp/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How webmcp Compares

Feature / AgentwebmcpStandard Approach
Platform SupportClaudeLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/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

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

31392
from sickn33/antigravity-awesome-skills

Senior Laravel Engineer role for production-grade, maintainable, and idiomatic Laravel solutions. Focuses on clean architecture, security, performance, and modern standards (Laravel 10/11+).

Coding & DevelopmentClaude

Prompt Coach

799
from bear2u/my-skills

Analyze your Claude Code session logs to improve prompt quality, optimize tool usage, and enhance your skills as an AI-native engineer.

Coding & DevelopmentClaude

nextjs

389
from udecode/better-convex

Provides comprehensive Next.js routing capabilities, including typed routes, helpers for `PageProps` and `LayoutProps`, and `nuqs` for managing URL state.

Coding & DevelopmentClaude

react

389
from udecode/better-convex

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.

Coding & DevelopmentClaude

just

208
from disler/bowser

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.

Coding & DevelopmentClaude

chrome-debug

159
from majiayu000/claude-skill-registry

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.

Coding & DevelopmentClaude

worktree-manager

125
from Wirasm/worktree-manager-skill

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.

Coding & DevelopmentClaude

clearshot

124
from udayanwalvekar/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.

Coding & DevelopmentClaude

osgrep

101
from pr-pm/prpm

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.

Coding & DevelopmentClaude

10up-css

87
from petenelson/wp-rest-api-log

CSS architecture, best practices, and patterns for WordPress projects. Covers ITCSS methodology, accessibility, specificity management, naming conventions, and modern CSS features.

Coding & DevelopmentClaude

agentifind

68
from AvivK5498/Beads-Kanban-UI

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.

Coding & DevelopmentClaude

CLAUDE.md – JJ Quick Command List

58
from mizchi/chezmoi-dotfiles

A concise cheat sheet for essential Jujutsu (`jj`) version control commands, designed to help AI agents or users quickly perform common repository operations.

Coding & DevelopmentClaude