webmcp-setup
Set up a WebMCP project — enable Chrome flags, install MCP-B polyfill, scaffold tool registration, and configure development environment. Use when starting a new WebMCP-enabled website from scratch.
Best use case
webmcp-setup is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Set up a WebMCP project — enable Chrome flags, install MCP-B polyfill, scaffold tool registration, and configure development environment. Use when starting a new WebMCP-enabled website from scratch.
Teams using webmcp-setup should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/webmcp-setup/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How webmcp-setup Compares
| Feature / Agent | webmcp-setup | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Set up a WebMCP project — enable Chrome flags, install MCP-B polyfill, scaffold tool registration, and configure development environment. Use when starting a new WebMCP-enabled website from scratch.
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.
SKILL.md Source
# WebMCP Project Setup
## Before writing code
**Fetch live docs**:
1. Fetch `https://developer.chrome.com/blog/webmcp` for the latest Chrome WebMCP announcement and API overview
2. Web-search `site:github.com mcp-b polyfill README` for the MCP-B polyfill installation and quickstart
3. Web-search `webmcp chrome canary flag enable` for current browser flag names and version requirements
4. Fetch the MCP-B npm page for the latest package version numbers
5. Web-search `site:chromestatus.com webmcp` for feature status and milestones
## Conceptual Architecture
### What Setup Involves
WebMCP project setup prepares a website to expose tools to AI agents:
1. **Enable browser support** — Chrome 146+ Canary with the `WebMCP for Testing` flag, or install the MCP-B polyfill
2. **Install polyfill (if needed)** — `mcp-b` packages for vanilla JS or React
3. **Scaffold tool registration** — create the entry point where tools are registered via `navigator.modelContext.registerTool()`
4. **Configure development environment** — set up testing with AI agents
### Project Structure (Vanilla JS)
```
my-webmcp-site/
├── src/
│ ├── webmcp/
│ │ ├── tools.js # Tool definitions and registration
│ │ ├── schemas.js # JSON Schemas for tool inputs
│ │ └── interactions.js # User interaction handlers
│ ├── index.html # Page with optional declarative form attributes
│ └── app.js # Main application entry
├── package.json
└── tests/
└── webmcp.test.js
```
### Project Structure (React + MCP-B)
```
my-webmcp-react-app/
├── src/
│ ├── webmcp/
│ │ ├── tools.ts # Tool definitions
│ │ ├── schemas.ts # JSON Schemas
│ │ ├── McpProvider.tsx # MCP-B React provider/hooks wrapper
│ │ └── interactions.ts # User interaction logic
│ ├── App.tsx
│ └── index.tsx
├── package.json
├── tsconfig.json
└── tests/
└── webmcp.test.tsx
```
### Setup Decision Checklist
- **Browser target** — Native Chrome 146+ (flag-gated) or polyfill for broader support?
- **Framework** — Vanilla JS, React, Vue, or server-rendered HTML?
- **API approach** — Imperative (JS `registerTool`), Declarative (HTML attributes), or both?
- **Tool scope** — Which user journeys will be exposed as tools?
- **Authentication** — What user role is required before registering sensitive tools?
- **Testing strategy** — Which AI agents to test with (Gemini, Claude, etc.)?
### Chrome Flag Setup
To enable native WebMCP in Chrome Canary:
1. Install Chrome 146+ Canary
2. Navigate to `chrome://flags`
3. Search for the WebMCP flag (name may change — search for it live)
4. Enable the flag and restart Chrome
### MCP-B Polyfill Setup
For browsers without native WebMCP, the MCP-B polyfill provides the same API surface. Fetch the README for exact installation commands, as packages and APIs may have changed.
### Best Practices
- Start with one or two simple read-only tools before adding transactional ones
- Use the polyfill for development even if targeting native Chrome — it works everywhere
- Register tools after the page has loaded and the user is authenticated
- Group related tools logically (all cart tools together, all search tools together)
- Test tool discovery with at least one AI agent before going to production
Fetch the latest Chrome blog post and MCP-B README for exact commands, package names, and API patterns before scaffolding.Related Skills
woo-setup
Install WooCommerce, configure the development stack, and set up a local dev environment with WP-CLI, Docker, or wp-env. Use when setting up a new WooCommerce project or development environment.
webmcp-user-interaction
Implement human-in-the-loop flows with requestUserInteraction() — confirmation dialogs, approval workflows, and user prompts during tool execution. Use when building tools that require user consent before performing actions.
webmcp-tool-schemas
Design JSON Schemas for WebMCP tool inputs and outputs — proper types, constraints, nested objects, and agent-friendly documentation. Use when defining or refining tool schemas for agent consumption.
webmcp-tool-annotations
Implement WebMCP tool annotations — readOnlyHint, destructiveHint, idempotentHint safety hints that inform browser permission prompts and agent behavior. Use when marking tools with appropriate safety metadata.
webmcp-testing
Test WebMCP tools with AI agents — Chrome DevTools integration, agent testing workflows, tool discovery verification, and end-to-end commerce flow testing. Use when validating that tools work correctly with real AI agents.
webmcp-security
Implement WebMCP security best practices — permission model, data minimization, honest descriptions, input validation, fingerprinting prevention, and fraud mitigation. Use when auditing or hardening WebMCP tool implementations.
webmcp-register-tool
Implement the WebMCP Imperative API — register tools via navigator.modelContext.registerTool() with proper schemas, execute callbacks, and lifecycle management. Use when building dynamic tool registration in JavaScript.
webmcp-polyfill
Set 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.
webmcp-mcp-bridge
Integrate 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-context-provider
Implement 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-commerce-tools
Implement commerce-specific WebMCP tools — product search, cart management, checkout, returns, subscriptions, and support. Use when building agentic shopping experiences on e-commerce websites.
webmcp-authentication
Implement 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.