# connect_to_browser

Connect to an existing Chrome instance with remote debugging enabled. Establishes a connection to a Chrome browser that's already running with remote debugging enabled on the specified port. Enables necessary DevTools Protocol domains and retrieves browser information. This function is useful when Chrome is already running (perhaps started manually or by another process) and you want to control it programmatically. It verifies the browser is accessible before attempting connection. Args: port: TCP port where Chrome remote debugging is listening (default: 9222). Chrome must be started with --remote-debugging-port=PORT for this to work. Returns: Connection status dictionary containing: - success: Boolean indicating connection success - message: Human-readable status description - data: Connection details including: - connected: Boolean connection status - port: Port Chrome is running on - targetInfo: Browser version and capability information Note: If Chrome is not running on the specified port, the function returns an error response with suggestions for starting Chrome with the correct debugging options.

Agent View of the PolicyLayer registry record for `connect_to_browser`. HTML page: https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/connect-to-browser

## Facts

- Tool: `connect_to_browser`
- Server: Chrome Devtools (`benjaminr/chrome-devtools-mcp`) — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp.md
- Homepage: https://github.com/benjaminr/chrome-devtools-mcp
- Risk category: Execute (High risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "connect_to_browser",
    "arguments": {}
  }
}
```

## Why connect_to_browser is rated High

Connecting to a Chrome instance with remote debugging enabled establishes a control channel that allows programmatic manipulation of the browser. This is an execution-oriented action that triggers external operations (browser control via DevTools Protocol). Combined with sibling tools like execute_javascript and evaluate_in_all_frames, this connection is the gateway to high-impact browser control.

From the tool's own definition: "Connect to an existing Chrome instance with remote debugging enabled... control it programmatically... Enables necessary DevTools Protocol domains"

## Use case

AI agents invoke connect_to_browser to trigger actions in Chrome Devtools. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Chrome Devtools:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "connect_to_browser": {
      "limits": [
        {
          "counter": "connect_to_browser_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Chrome Devtools (46)

- `clear_all_cookies` — Destructive — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/clear-all-cookies.md
- `clear_storage_for_origin` — Destructive — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/clear-storage-for-origin.md
- `clear_console` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/clear-console.md
- `evaluate_in_all_frames` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/evaluate-in-all-frames.md
- `execute_javascript` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/execute-javascript.md
- `focus_element` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/focus-element.md
- `inspect_console_object` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/inspect-console-object.md
- `navigate_to_url` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/navigate-to-url.md
- `override_storage_quota` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/override-storage-quota.md
- `start_chrome` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/start-chrome.md
- `start_chrome_and_connect` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/start-chrome-and-connect.md
- `start_css_coverage_tracking` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/start-css-coverage-tracking.md
- `track_indexeddb` — Execute — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/track-indexeddb.md
- `disconnect_from_browser` — Other — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/disconnect-from-browser.md
- `collect_css_class_names` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/collect-css-class-names.md
- `describe_element` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/describe-element.md
- `get_all_cookies` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-all-cookies.md
- `get_background_colors` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-background-colors.md
- `get_computed_styles` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-computed-styles.md
- `get_connection_status` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-connection-status.md
- `get_console_error_summary` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-console-error-summary.md
- `get_console_logs` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-console-logs.md
- `get_cookies` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-cookies.md
- `get_document` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-document.md
- `get_element_at_position` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-element-at-position.md
- `get_element_attributes` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-element-attributes.md
- `get_element_box_model` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-element-box-model.md
- `get_element_outer_html` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-element-outer-html.md
- `get_inline_styles` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-inline-styles.md
- `get_matched_styles` — Read — https://policylayer.com/tools/benjaminr-chrome-devtools-mcp/get-matched-styles.md
- …and 16 more: https://policylayer.com/tools/benjaminr-chrome-devtools-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=benjaminr-chrome-devtools-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/benjaminr-chrome-devtools-mcp
