# web-bridge-mcp — Let AI editors operate any static web page [![CI](https://github.com/kirakiray/web-bridge-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/kirakiray/web-bridge-mcp/actions/workflows/ci.yml) [![npm version](https://img.shields.io/npm/v/web-bridge-mcp)](https://www.npmjs.com/package/web-bridge-mcp) [![node](https://img.shields.io/node/v/web-bridge-mcp)](https://www.npmjs.com/package/web-bridge-mcp) [![license](https://img.shields.io/npm/l/web-bridge-mcp)](https://github.com/kirakiray/web-bridge-mcp/blob/main/LICENSE) [![MCP](https://img.shields.io/badge/MCP-compatible-blue)](https://modelcontextprotocol.io) **web-bridge-mcp** is an MCP Server (single Node process, dual interfaces) that lets AI editors execute JavaScript, read the console, and simulate clicks / typing on any static web page that includes `client.js`. Great for cross-browser, multi-tab local debugging — and it can also be deployed to a public server. ``` AI Editor ┌───────────────────┐ Browser page ┌──────────────┐ │ MCP Server │ ┌──────────────────┐ │ MCP Client │ │ (Node, 1 process) │ │ ``` When deployed on a server, point the script at it (with token if enabled): ```html ``` ### Verify Tell the AI: "Use web-bridge-mcp's list_pages to see which pages are connected, then eval_js to click #btn and read the console". If it lists your page, all three steps are wired up. > Order doesn't matter: the page can be opened before the server — client.js auto-reconnects (1s→2s→5s→10s backoff) and attaches as soon as the server is up. Hub status page: http://127.0.0.1:3210/ > > Once embedded, the page shows a small draggable status bubble in the top-right corner (green = connected, yellow = connecting, red = disconnected), so you can always tell the page is bridged to the MCP server and whether the link is alive. Double-click the bubble to see exactly what the MCP server has done to the page — every operation with its natural-language note, success/failure and duration, grouped per page load. ## Alternative: local stdio mode (the editor starts the server) If you only use it locally and don't want to run step 1 manually, put the server path directly in your editor config: the editor spawns it as a child process, MCP runs over the process's stdin/stdout pipe (no URL needed), and the relay is up automatically; the process exits with the editor. ```json { "mcpServers": { "web-bridge-mcp": { "command": "npx", "args": ["-y", "web-bridge-mcp"], "env": { "PORT": "3210" } } } } ``` (Same format for Cursor / Claude Desktop; if you cloned this repo, use `"command": "node", "args": ["/path/to/web-bridge-mcp/server.js"]` — see the template [mcp.json](mcp.json).) How to choose: | | HTTP mode (3-step guide above) | stdio mode | | --- | --- | --- | | Who starts server.js | You, manually; can live on a server | The editor, on demand | | Editor config | Just a URL | command + args | | Best for | Server deployment, multi-device / shared, remote access | Local instant use; the only option for Claude Desktop | In both modes the browser side is identical (the `