1.
https://www.npmjs.com/package/auto-webmcp does this. Drop it into any React+Vite app:
npm install auto-webmcp
// main.tsx
import { autoWebMCP } from 'auto-webmcp'
autoWebMCP()
Automatically scans all <form> elements on the page and registers them as MCP tools via navigator.modelContext — zero manual coding needed.
For non-form interactions (buttons, custom actions), you can also call navigator.modelContext directly yourself:
navigator.modelContext?.registerTool({ ... })
2. Requirements for Testing in Chrome Beta
- Use Chrome Dev or Canary (not just Beta) — WebMCP flag support is more stable there
- Enable the flag: chrome://flags/#enable-webmcp-testing
- The Model Context Tool Inspector extension you already have is exactly the right tool, it will show registered tools once the page loads
Since you are deploying a React+Vite app, it works both locally (localhost) and on a deployed URL.