SETUP

Connect your MCP client locally.

Prerequisites

1. Clone and install

git clone https://github.com/rxluz/browser-agent-bridge.git
cd browser-agent-bridge/server
npm ci

2. Generate a bridge token

export BRIDGE_TOKEN="$(node -e "console.log(require('crypto').randomBytes(32).toString('base64url'))")"
npm start

Do not use a memorable phrase. Keep this token private and do not commit it to a config file.

3. Load the extension

  1. Visit chrome://extensions and enable Developer mode.
  2. Select Load unpacked and choose the repository's extension/ folder.
  3. Open the extension popup and provide host 127.0.0.1, port 8765, and the generated token.
  4. Confirm the badge displays on.

4. Configure MCP

{
  "mcpServers": {
    "browser-agent-bridge": {
      "command": "node",
      "args": ["/absolute/path/to/browser-agent-bridge/mcp-server/index.js"],
      "env": {
        "BRIDGE_HOST": "127.0.0.1",
        "BRIDGE_PORT": "8765",
        "BRIDGE_TOKEN": "your-generated-token"
      }
    }
  }
}

Use the configuration file or UI documented by your MCP client. The server uses the standard stdio JSON-RPC transport.

Action reference

ActionPurpose
snapshotReturn interactive controls. Prefer viewportOnly: true.
clickClick by agentId, CSS selector, or coordinate.
typeSet a regular input, textarea, or contenteditable field.
insert_textInsert trusted text into a focused rich-text editor.
pressSend a key or shortcut such as Enter, CTRL+A, or META+A.
clearSelect and delete an editable target.
get_contentRead title, URL, and visible text.
wait_forWait for a selector, page text, or JavaScript condition.
evalRun page JavaScript only if the bridge started with BRIDGE_ENABLE_EVAL=1.

Troubleshooting