Skip to content

Chrome Bridge

scarecr0w12 edited this page Jun 19, 2026 · 1 revision

Chrome Bridge

Chrome Bridge provides real-browser automation by connecting to the chrome-bridge MCP server, which controls a Chrome browser via CDP (Chrome DevTools Protocol). All 60 chrome-bridge browser automation tools are registered as first-class chrome_* prefixed tools accessible directly by the LLM.

Architecture

┌──────────────────────────────────────────────────────────┐
│                      CortexPrism                          │
│                                                           │
│   ToolRegistry → mcp-adapter.ts → chrome_bridge_manager   │
│          │              │              │                   │
│          ▼              ▼              ▼                   │
│   60 chrome_* tools   JSON Schema    Subprocess           │
│   registered           → ToolParam   lifecycle             │
│                                                           │
└──────────────────────────────────────────────────────────┘
                         │
                         ▼
┌──────────────────────────────────────────────────────────┐
│           chrome-bridge (external Node.js process)         │
│                                                           │
│   Chrome DevTools Protocol (CDP)                           │
│          │                                                │
│          ▼                                                │
│   Chrome Browser (with chrome-bridge extension)           │
│                                                           │
│   60 tools across 7 categories:                            │
│   • Core & Navigation (8)   • Interaction (12)            │
│   • DOM & Inspection (10)   • Waiting & Discovery (3)     │
│   • Debugging & Network (8) • Visual & Responsive (7)     │
│   • Audits (6)             • State & Storage (4)          │
└──────────────────────────────────────────────────────────┘

Tool Categories

Category Count Description
Core & Navigation 8 Launch browser, navigate, go back/forward, refresh
Interaction 12 Click, type, hover, select, drag, press key, fill form
DOM & Inspection 10 Get element, query selector, get text, get attribute
Waiting & Discovery 3 Wait for element, wait for text, find elements
Debugging & Network 8 Network requests, console logs, execute JS, intercept
Visual & Responsive 7 Screenshots, viewport resize, full page capture
Audits 6 Performance, accessibility, SEO, best practices
State & Storage 4 Cookies, localStorage, sessionStorage, IndexedDB

Dynamic MCP Registration

Chrome Bridge tools are dynamically registered via the MCP adapter pattern:

  1. Connect via connectStdio() from src/mcp/client.ts
  2. Register via registry.registerMcpConnection("chrome-bridge", "chrome_")
  3. Execute — wrapped tools proxy calls to callStdioTool()
  4. Unregister via registry.unregisterByPrefix("chrome_") on disconnect

Security

Chrome Bridge tools pass through the same multi-layer validation as all other tools:

  • chrome_execute_js — requires explicit checkPolicy('tool', 'chrome_execute_js') allow
  • chrome_upload_file — paths checked for ../ traversal + path policy rules
  • chrome_save_page / chrome_manage_downloads — paths stripped of ../ + path policy rules
  • chrome_network_rules — modifications require checkPolicy('capability', 'network_rules_modify') approval

Configuration

In ~/.cortex/config.json:

{
  "chromeBridge": {
    "enabled": true,
    "autoStart": true,
    "autoRegisterTools": true,
    "toolPrefix": "chrome_",
    "serverPath": "/path/to/chrome-bridge/server/index.js",
    "nodePath": "/usr/bin/node"
  }
}

CLI

cortex chrome-bridge start    # Start chrome-bridge MCP server
cortex chrome-bridge stop     # Stop chrome-bridge MCP server
cortex chrome-bridge status   # Check connection state
cortex chrome-bridge tools    # List registered chrome_* tools

Web UI

Settings → Chrome Bridge page provides status cards, registered tools grid, and a Quick Setup button that pre-fills the MCP connection form. Start/Stop/Restart buttons in the page header toggle based on running state.

REST API

Method Path Description
GET /api/chrome-bridge/status Connection state, tool count, server info
POST /api/chrome-bridge/start Start chrome-bridge server
POST /api/chrome-bridge/stop Stop chrome-bridge server
GET /api/chrome-bridge/tools List registered chrome_* tools

See Also

Clone this wiki locally