Driving Chrome with an Agent

Coding agents like OpenCode can now drive your real, logged-in Chrome browser.

Chrome just became a lot more useful for automation. As of Chrome 144, coding agents like OpenCode or Claude Code can now natively drive your real browser — the one you use every day, with all your tabs open and all your accounts logged in. No extensions. No headless browser. No separate logins.

Copy this and paste it into your agent:

Set up Chrome DevTools MCP for me:

https://zeke.sikelianos.com/driving-chrome-with-an-agent

How it works

Google Chrome has long had a remote debugging protocol used by DevTools itself. With --autoConnect, the Chrome DevTools MCP server can request access to that session — Chrome shows a permission dialog every time, and displays a "Chrome is being controlled" banner while active. There's no way for an agent to silently connect.

Step 1: Enable remote debugging in Chrome

Navigate to this URL in Chrome and enable remote debugging:

chrome://inspect/#remote-debugging

Step 2: Configure the MCP server

For OpenCode, edit ~/.config/opencode/opencode.json:

{
  "mcp": {
    "chrome-devtools": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "chrome-devtools-mcp@latest",
        "--autoConnect"
      ]
    }
  }
}

For Claude Code, edit ~/.claude.json:

{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp@latest",
        "--autoConnect"
      ]
    }
  }
}

Step 3: Ask your agent to do something

Open OpenCode, and ask it to do something in your browser. The agent will request a debugging session, Chrome will prompt you to allow it, and then it gets to work.

Some good first things to try:

Take a screenshot of my current tab

Run a Lighthouse performance audit on the page I have open

I have a failing network request selected in the DevTools Network panel — investigate it

The killer feature: your existing session

Most browser automation tools — Playwright, Puppeteer, headless Chrome — require you to log in programmatically. That means handling 2FA, managing cookies, dealing with CAPTCHAs, and often building an entire auth flow just to get to the thing you actually want to automate.

With --autoConnect, your agent inherits your existing Chrome session. You're already logged in everywhere. That opens up a whole category of sites that were never designed to be automated — sites with no API, no CLI, no MCP server, and a complex authenticated UI:

I'm on my health insurance portal — what's my deductible status and what claims are pending?

I'm on my bank's website — categorize my last 30 transactions and flag anything unusual

I'm logged into Workday — what's my remaining PTO balance and when does it expire?

I'm on my kid's school portal — what assignments are due this week?

I'm on a paywalled article I subscribe to — summarize it for me

I'm on a government site filing something — walk me through this form and tell me if I'm filling it out correctly

The common thread: these are all authenticated, proprietary UIs that were never meant to be automated. Your agent doesn't need an API key — it just needs you to already be logged in.

A word of caution

Your agent can do a lot once it has access to your browser — including clicking, filling forms, and navigating on your behalf. Before letting it loose, consider starting in Plan Mode. Most agents support a mode where they'll describe what they intend to do before actually doing it. That gives you a chance to review and approve the plan before anything happens in your browser.

Hat tip to Addy Osmani for the hot tip. 🙏