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 whe...
This record as markdown: /tools/benjaminr-chrome-devtools-mcp/connect-to-browser.md
What connect_to_browser does on Chrome Devtools
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.
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 definition Connect to an existing Chrome instance with remote debugging enabled... control it programmatically... Enables necessary DevTools Protocol domains
Attacks that exploit this kind of access
The rule that runs connect_to_browser safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Chrome Devtools, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For connect_to_browser, this is the rule to start with:
connect_to_browser stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Chrome Devtools, apply this rule, and every connect_to_browser call is checked against it from then on.
Questions about 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. It is categorised as a Execute tool in the Chrome Devtools MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
Register the Chrome Devtools MCP server in PolicyLayer and add a rule for connect_to_browser: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Chrome Devtools. Nothing to install.
connect_to_browser is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the connect_to_browser rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for connect_to_browser. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
connect_to_browser is provided by the Chrome Devtools MCP server (benjaminr/chrome-devtools-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Chrome Devtools, and thousands of servers like it.
Across the catalogue