Labsco
ChromeDevTools logo

Chrome DevTools MCP

β˜… 45,600

from ChromeDevTools

Official Chrome DevTools MCP server for controlling and inspecting a live Chrome browser from coding agents such as Gemini, Claude, Cursor, and Copilot.

πŸ”₯πŸ”₯πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

Chrome DevTools for agents

Chrome DevTools for agents (chrome-devtools-mcp) lets your coding agent (such as Antigravity, Claude, Cursor or Copilot) control and inspect a live Chrome browser. It acts as a Model-Context-Protocol (MCP) server, giving your AI coding assistant access to the full power of Chrome DevTools for reliable automation, in-depth debugging, and performance analysis. A CLI is also provided for use without MCP.

Key features

  • Get performance insights: Uses Chrome DevTools to record traces and extract actionable performance insights.

  • Advanced browser debugging: Analyze network requests, take screenshots and check browser console messages (with source-mapped stack traces).

  • Reliable automation. Uses puppeteer to automate actions in Chrome and automatically wait for action results.

Disclaimers

chrome-devtools-mcp exposes content of the browser instance to the MCP clients allowing them to inspect, debug, and modify any data in the browser or DevTools. Avoid sharing sensitive or personal information that you don't want to share with MCP clients.

chrome-devtools-mcp officially supports Google Chrome and Chrome for Testing only. Other Chromium-based browsers may work, but this is not guaranteed, and you may encounter unexpected behavior. Use at your own discretion. We are committed to providing fixes and support for the latest version of Extended Stable Chrome.

Performance tools may send trace URLs to the Google CrUX API to fetch real-user experience data. This helps provide a holistic performance picture by presenting field data alongside lab data. This data is collected by the Chrome User Experience Report (CrUX). To disable this, run with the --no-performance-crux flag.

Update checks

By default, the server periodically checks the npm registry for updates and logs a notification when a newer version is available. You can disable these update checks by setting the CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS environment variable.

Tools

If you run into any issues, checkout our troubleshooting guide.

Concepts

Concurrent sessions

Most MCP clients start one Chrome DevTools MCP server per conversation. If your client shares a single server instance across concurrent agents or subagents, start the server with --experimentalPageIdRouting. This exposes pageId on page-scoped tools so each agent can route tool calls to the tab it is working with.

Copy & paste β€” that's it
{
 "mcpServers": {
 "chrome-devtools": {
 "command": "npx",
 "args": [
 "-y",
 "chrome-devtools-mcp@latest",
 "--experimentalPageIdRouting"
 ]
 }
 }
}

If you run multiple independent MCP client sessions and want each session to launch its own temporary Chrome profile, also pass --isolated. This avoids sharing the default Chrome DevTools MCP user data directory between those server instances.

User data directory

chrome-devtools-mcp starts a Chrome's stable channel instance using the following user data directory:

  • Linux / macOS: $HOME/.cache/chrome-devtools-mcp/chrome-profile-$CHANNEL

  • Windows: %HOMEPATH%/.cache/chrome-devtools-mcp/chrome-profile-$CHANNEL

The user data directory is not cleared between runs and shared across all instances of chrome-devtools-mcp. Set the isolated option to true to use a temporary user data dir instead which will be cleared automatically after the browser is closed.

Connecting to a running Chrome instance

By default, the Chrome DevTools MCP server will start a new Chrome instance with a dedicated profile. This might not be ideal in all situations:

  • If you would like to maintain the same application state when alternating between manual site testing and agent-driven testing.

  • When the MCP needs to sign into a website. Some accounts may prevent sign-in when the browser is controlled via WebDriver (the default launch mechanism for the Chrome DevTools MCP server).

  • If you're running your LLM inside a sandboxed environment, but you would like to connect to a Chrome instance that runs outside the sandbox.

In these cases, start Chrome first and let the Chrome DevTools MCP server connect to it. There are two ways to do so:

  • Automatic connection (available in Chrome 144): best for sharing state between manual and agent-driven testing.

  • Manual connection via remote debugging port: best when running inside a sandboxed environment.

Automatically connecting to a running Chrome instance

Step 1: Set up remote debugging in Chrome

In Chrome (>= M144), do the following to set up remote debugging:

  • Navigate to chrome://inspect/#remote-debugging to enable remote debugging.

  • Follow the dialog UI to allow or disallow incoming debugging connections.

Step 2: Configure Chrome DevTools MCP server to automatically connect to a running Chrome Instance

To connect the chrome-devtools-mcp server to the running Chrome instance, use --autoConnect command line argument for the MCP server.

The following code snippet is an example configuration for gemini-cli:

Copy & paste β€” that's it
{
 "mcpServers": {
 "chrome-devtools": {
 "command": "npx",
 "args": ["chrome-devtools-mcp@latest", "--autoConnect"]
 }
 }
}

Step 3: Test your setup

Make sure your browser is running. Open gemini-cli and run the following prompt:

Copy & paste β€” that's it
Check the performance of https://developers.chrome.com

[!NOTE] The autoConnect option requires the user to start Chrome. If the user has multiple active profiles, the MCP server will connect to the default profile (as determined by Chrome). The MCP server has access to all open windows for the selected profile.

The Chrome DevTools MCP server will try to connect to your running Chrome instance. It shows a dialog asking for user permission.

Clicking Allow results in the Chrome DevTools MCP server opening developers.chrome.com and taking a performance trace.

Manual connection using port forwarding

You can connect to a running Chrome instance by using the --browser-url option. This is useful if you are running the MCP server in a sandboxed environment that does not allow starting a new Chrome instance.

Here is a step-by-step guide on how to connect to a running Chrome instance:

Step 1: Configure the MCP client

Add the --browser-url option to your MCP client configuration. The value of this option should be the URL of the running Chrome instance. http://127.0.0.1:9222 is a common default.

Copy & paste β€” that's it
{
 "mcpServers": {
 "chrome-devtools": {
 "command": "npx",
 "args": [
 "chrome-devtools-mcp@latest",
 "--browser-url=http://127.0.0.1:9222"
 ]
 }
 }
}

Step 2: Start the Chrome browser

[!WARNING] Enabling the remote debugging port opens up a debugging port on the running browser instance. Any application on your machine can connect to this port and control the browser. Make sure that you are not browsing any sensitive websites while the debugging port is open.

Start the Chrome browser with the remote debugging port enabled. Make sure to close any running Chrome instances before starting a new one with the debugging port enabled. The port number you choose must be the same as the one you specified in the --browser-url option in your MCP client configuration.

For security reasons, Chrome requires you to use a non-default user data directory when enabling the remote debugging port. You can specify a custom directory using the --user-data-dir flag. This ensures that your regular browsing profile and data are not exposed to the debugging session.

macOS

Copy & paste β€” that's it
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-profile-stable

Linux

Copy & paste β€” that's it
/usr/bin/google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-profile-stable

Windows

Copy & paste β€” that's it
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="%TEMP%\chrome-profile-stable"

Step 3: Test your setup

After configuring the MCP client and starting the Chrome browser, you can test your setup by running a simple prompt in your MCP client:

Copy & paste β€” that's it
Check the performance of https://developers.chrome.com

Your MCP client should connect to the running Chrome instance and receive a performance report.

If you hit VM-to-host port forwarding issues, see the β€œRemote debugging between virtual machine (VM) and host fails” section in docs/troubleshooting.md.

For more details on remote debugging, see the Chrome DevTools documentation.

Debugging Chrome on Android

Please consult these instructions.

Integrating as a browser subagent

If you are developing agentic tooling and want to provide an integrated browser subagent as part of your product, we recommend building on top of Chrome DevTools for agents.

For a reference implementation, see the Gemini CLI browser agent documentation.