In September 2025, Google announced Chrome DevTools MCP, a server that lets AI coding agents control a live Chrome browser. AI coding agents face a fundamental problem: they can’t see what their generated code actually does when it runs in the browser. Chrome DevTools MCP fixes this by giving your AI assistant direct access to Chrome DevTools. You can automate testing, debug performance issues, and inspect network requests without leaving your chat with Claude or Cursor.

The basic setup works great until you need to debug a site that requires authentication. Or when you want to gather intelligence from your authenticated sessions on X, LinkedIn, or other platforms. That’s when you need a persistent Chrome debug profile.

The key is Chrome’s --user-data-dir flag. It creates a separate profile directory where Chrome saves all your login sessions, cookies, and browsing data. Log into your accounts once, and they stay logged in between browser restarts. Claude can then access those authenticated sessions whenever you need them.

Note: This guide assumes you’re on macOS. Chrome 136+ requires --user-data-dir for security reasons when using remote debugging.

What You Can Do With This

Once you have a persistent Chrome profile connected to Claude, you can:

Gather intelligence from authenticated sessions:

  • Summarize top tweets in your X timeline
  • Track trending topics across your feeds
  • Check LinkedIn for updates from your network
  • Research people before meetings using their LinkedIn profiles
  • Monitor GitHub notifications for critical issues

Debug authenticated web applications:

  • Test user flows that require login
  • Analyze network requests with real cookies
  • Screenshot dashboards and internal tools
  • Verify how your site works for logged-in users

Use your actual browser environment:

  • Test with your installed extensions
  • Debug performance on pages that need authentication
  • Access sites with your existing cookies and sessions

The setup takes five minutes. If you regularly work with authenticated web applications or want Claude to access your social media feeds, this capability is worth the time.

How It Works

The standard Chrome DevTools MCP installation launches Chrome in a fresh, isolated profile. This works well for basic automation, but you can’t use it with sites that require authentication. You can’t ask Claude to “check my GitHub notifications” if Chrome isn’t logged into GitHub.

You might think you could connect Chrome DevTools MCP to your existing Chrome profile, the one where you’re already logged into everything. Chrome won’t let you do this. Starting with Chrome 136, remote debugging is blocked on your default profile for security reasons. This change prevents attackers from exploiting remote debugging to steal cookies. If you try to start your main Chrome instance with --remote-debugging-port, it will fail.

The solution is --user-data-dir. This flag is the key to making persistent Chrome debug profiles work. When you specify --user-data-dir="$HOME/.chrome-debug-profile", you’re telling Chrome to create and use a separate profile directory. Chrome automatically creates this directory if it doesn’t exist. Everything you do in that browser window (logins, cookies, extensions, browsing history) gets saved to that directory. Close Chrome and reopen it with the same --user-data-dir, and all your sessions are still there.

This is why the flag is required (not optional) for remote debugging in modern Chrome. It creates an isolated profile with its own encryption keys, protecting your main browsing data while giving you a persistent debug environment.

The tradeoff is security. Any content in that browser window becomes accessible to the AI agent. I only use this setup for development and testing, never for sensitive browsing.

Setup

Step 1: Launch Chrome with Remote Debugging

Close any running Chrome instances. Start Chrome with remote debugging enabled:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --remote-debugging-port=9222 \
  --user-data-dir="$HOME/.chrome-debug-profile"

The --remote-debugging-port=9222 flag opens a debugging port on localhost. The --user-data-dir flag is what makes persistent sessions possible. It tells Chrome where to store your profile data (cookies, login sessions, extensions, history). Chrome automatically creates this directory if it doesn’t exist. Every time you launch Chrome with the same --user-data-dir path, you get the same profile with all your logins intact.

Step 2: Configure Claude Code

Use Claude Code’s CLI to add the Chrome DevTools MCP server:

claude mcp add --transport stdio chrome-devtools -- npx -y chrome-devtools-mcp@latest --browserUrl=http://127.0.0.1:9222

The --browserUrl flag tells the MCP server to connect to your running Chrome instance instead of launching its own. The -- separator is important - it separates Claude Code’s options from the MCP server’s arguments.

Claude Code will automatically configure the server and make it available. You don’t need to restart or edit config files manually.

Step 3: Test the Connection

Open Claude Code and ask:

Can you navigate to https://example.com and take a screenshot?

If the setup works, Claude will control your debugging Chrome window and capture a screenshot. You’ll see the browser window update in real time.

Try a performance test:

Check the performance of https://developer.chrome.com

Claude will navigate to the site, record a performance trace, and report back with insights.

Optional: Convenient Launch Methods

Typing that Chrome command every time is tedious. Here are two options:

Option 1: Shell script

Create a file called chrome-debug.sh:

#!/bin/bash
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --remote-debugging-port=9222 \
  --user-data-dir="$HOME/.chrome-debug-profile" \
  > /dev/null 2>&1 &

Make it executable:

chmod +x chrome-debug.sh

Launch with ./chrome-debug.sh. The > /dev/null 2>&1 & runs Chrome in the background and hides output.

Option 2: Shell alias (recommended)

Add this to your ~/.zshrc or ~/.bashrc:

alias chrome:debug="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=\"$HOME/.chrome-debug-profile\" > /dev/null 2>&1 &"

Reload your shell config:

source ~/.zshrc  # or ~/.bashrc

Start debug Chrome by typing chrome:debug. This approach saves the most time if you’re frequently switching between regular browsing and debug sessions.

Using This for Productivity

Setting Up Your Accounts

Launch your debug Chrome profile and log into the accounts you want Claude to access:

  • X (Twitter)
  • LinkedIn
  • GitHub
  • Your internal tools
  • Any other authenticated sites

Sample Prompts for X (Twitter)

Gathering insights from your timeline:

Navigate to twitter.com and screenshot my timeline. Then summarize the top 5 most interesting tweets I should read.

Analyzing engagement:

Go to my Twitter notifications page and tell me which of my recent tweets got the most engagement. Include the tweet text and engagement numbers.

Research mode:

Search for tweets about “Chrome DevTools MCP” on Twitter and give me a summary of what people are saying about it. Include any interesting use cases mentioned.

Drafting content:

Look at my recent tweets and analyze the writing style. Then help me draft a tweet about [topic] that matches my usual tone.

Sample Prompts for LinkedIn

Staying current with your network:

Go to linkedin.com and check my feed. Summarize any important updates from my connections, particularly job changes or company announcements.

Research before a meeting:

Navigate to [person’s name]‘s LinkedIn profile and give me a summary of their background, current role, and recent activity. I have a meeting with them tomorrow.

Content planning:

Look at the top posts in my LinkedIn feed this week. What topics are getting the most engagement? Help me brainstorm content ideas based on these trends.

Job market intelligence:

Search LinkedIn for [job title] positions at [company type] and summarize the common requirements and salary ranges mentioned.

Sample Prompts for GitHub

Monitoring your projects:

Check the notifications on github.com and tell me about any critical issues or pull requests that need my attention.

Research mode:

Go to the [repo name] repository and analyze the recent issues. What are the top 3 pain points users are reporting?

Competitive analysis:

Navigate to [competitor’s repo] and give me a summary of their recent commits. What new features are they working on?

Combining Multiple Sources

You can ask Claude to synthesize information across platforms:

Check my Twitter mentions and LinkedIn messages. Are there any common themes or questions people are asking me? Help me draft responses.

Look at the trending topics on X and the popular posts on LinkedIn. What’s the overlap? What should I be paying attention to this week?

Best Practices

Keep prompts specific. Instead of “check Twitter,” ask for specific information like “check my Twitter DMs for messages from the last 24 hours.”

Ask for screenshots. Visual confirmation helps you verify Claude found the right information before acting on it.

Start small. Test simple navigation and data extraction before building complex workflows.

Be mindful of rate limits. Some platforms may flag unusual activity. Don’t hammer their servers with repeated requests.

Security Considerations

Opening the remote debugging port exposes your browser to any application on your machine. Any process can connect to port 9222 and control Chrome.

Use this setup only for development and testing. Don’t browse sensitive sites (banking, email with personal info, etc.) in a Chrome instance with remote debugging enabled. Keep test accounts and minimal personal data in your debug profile. When you’re done testing, close Chrome and the debugging port closes with it.

Troubleshooting

“Failed to connect to browser”

Make sure Chrome is running with the --remote-debugging-port=9222 flag before starting your MCP client. You can verify the port is open by visiting http://127.0.0.1:9222 in another browser. You should see a JSON response with Chrome’s debugging endpoints.

“Browser closes immediately”

You might have another Chrome instance running without the debugging flag. Close all Chrome windows and restart with the debugging flags.

“Can’t find Chrome executable”

Chrome should be at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome. If you installed Chrome somewhere else, update the path in your launch script or alias.

What About Other Agents and Operating Systems?

This guide focuses on Claude Code and macOS, but the core concepts apply to other AI coding agents (Cursor, GitHub Copilot, Gemini CLI) and operating systems (Windows, Linux).

If you’re using a different setup, ask your AI agent to read this blog post and adapt the instructions for your specific situation. The key principles remain the same: launch Chrome with --remote-debugging-port and --user-data-dir, then configure your agent’s MCP server to connect via --browserUrl.

Next Steps

Start with a simple task. Ask your agent to screenshot your favorite website. Once that works, move on to more complex debugging tasks.

Keep the debugging Chrome window visible while you work. It helps to see what the agent is doing, especially when debugging issues with the setup.