Try It Now
Build and test your first WebMCP tool right here - no setup required:Prerequisites
Before you begin, ensure you have:- Modern browser: Chrome, Edge, or Brave (latest version)
- MCP-B Extension installed from Chrome Web Store
- Node.js 18+ (for NPM installation) or basic HTML knowledge (for script tag method)
- Package manager: npm, pnpm, or yarn (optional for NPM method)
Early Incubation: WebMCP is being incubated by the W3C Web Machine Learning Community Group. Not all MCP-B features may be included in the final WebMCP specification. See the introduction for details.
Installation
- Script Tag
- Vanilla JS
- React
Real-World Example
Wrap your existing application logic as tools:- Vanilla JS
- React
Testing
- Run dev server:
pnpm dev - Open in Chrome with MCP-B extension
- Click extension icon → Tools tab
- Test tools via chat or inspector
Examples
webmcp.sh
Production-ready React app with database, navigation, and graph tools
Vanilla TypeScript
Shopping cart app with dynamic tool registration
React Task Manager
Task management app demonstrating useWebMCP() hook
More Examples
Vue, Nuxt, React Flow, and community examples
Quick Tips
- Security: Only expose tools users can already access via your UI. Tools inherit user authentication.
- Naming: Use descriptive names like
add_to_cart,search_products,update_profile - Validation: Always define input schemas - use Zod (React) or JSON Schema (vanilla)
- Feedback: Update UI state in handlers so users see what’s happening
See Best Practices for comprehensive guidance on tool design and security.
