Skip to main content
Prerequisites: Node.js 18+, MCP-B Chrome Extension

Quick Setup

1. Install Dependencies

2. Start Your Dev Server

3. Open in Chrome with MCP-B Extension

  1. Navigate to your local dev server (e.g., http://localhost:5173)
  2. Click the MCP-B extension icon
  3. Check the “Tools” tab to see your registered tools

Development Workflow

React Development

Vanilla JavaScript Development

Hot Reload Support

WebMCP works seamlessly with hot module replacement (HMR):

Vite

Tools registered with useWebMCP() automatically handle HMR - they’ll re-register when your component code changes.

Webpack

For vanilla JS with Webpack HMR:

Debugging Tools

Browser DevTools

Access the MCP bridge in the console:

MCP-B Extension Inspector

  1. Click the MCP-B extension icon
  2. Go to the “Tools” tab
  3. See all registered tools from your page
  4. Test tools directly from the inspector

React DevTools

The useWebMCP hook exposes execution state:

Testing

Unit Testing Tools

E2E Testing with Playwright

Environment Configuration

Development vs Production

Troubleshooting

  1. Ensure @mcp-b/global is imported
  2. Check browser console for errors
  3. Verify extension is installed and enabled
  4. Refresh the page after starting dev server
  5. Check extension popup “Tools” tab
  1. Check tool handler for errors
  2. Verify inputSchema matches arguments
  3. Ensure async handler returns proper format
  4. Check browser console for exceptions
This is normal in React StrictMode (development only). useWebMCP() handles this correctly and deduplicates registrations.
Use useWebMCP() in React - it handles HMR automatically. For vanilla JS, unregister tools in HMR disposal hooks.

Next Steps

Examples

Explore complete examples and patterns

React Hooks

Deep dive into useWebMCP hook

Advanced Patterns

Learn advanced techniques

Troubleshooting

Common issues and solutions