chore: handling more client name enums (#1228)
The openclaw client name is defined at https://github.com/openclaw/openclaw/blob/ea476de1e488979a3e9e5bf32e4d4f20e563144f/src/browser/chrome-mcp.ts#L234C14-L234C29
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Chrome DevTools MCP
chrome-devtools-mcplets your coding agent (such as Gemini, 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.Tool reference | Changelog | Contributing | Troubleshooting | Design Principles
Key features
Disclaimers
chrome-devtools-mcpexposes 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.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-cruxflag.Usage statistics
Google collects usage statistics (such as tool invocation success rates, latency, and environment information) to improve the reliability and performance of Chrome DevTools MCP.
Data collection is enabled by default. You can opt-out by passing the
--no-usage-statisticsflag when starting the server:Google handles this data in accordance with the Google Privacy Policy.
Google’s collection of usage statistics for Chrome DevTools MCP is independent from the Chrome browser’s usage statistics. Opting out of Chrome metrics does not automatically opt you out of this tool, and vice-versa.
Collection is disabled if CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS or CI env variables are set.
Requirements
Getting started
Add the following config to your MCP client:
If you are interested in doing only basic browser tasks, use the
--slimmode:See Slim tool reference.
MCP Client configuration
Amp
Follow https://ampcode.com/manual#mcp and use the config provided above. You can also install the Chrome DevTools MCP server using the CLI:Antigravity
To use the Chrome DevTools MCP server follow the instructions from Antigravity’s docs to install a custom MCP server. Add the following config to the MCP servers config:
This will make the Chrome DevTools MCP server automatically connect to the browser that Antigravity is using. If you are not using port 9222, make sure to adjust accordingly.
Chrome DevTools MCP will not start the browser instance automatically using this approach because the Chrome DevTools MCP server connects to Antigravity’s built-in browser. If the browser is not already running, you have to start it first by clicking the Chrome icon at the top right corner.
Claude Code
Install via CLI (MCP only)
Use the Claude Code CLI to add the Chrome DevTools MCP server (guide):
Install as a Plugin (MCP + Skills)
To install Chrome DevTools MCP with skills, add the marketplace registry in Claude Code:
Then, install the plugin:
Restart Claude Code to have the MCP server and skills load (check with
/skills).Cline
Follow https://docs.cline.bot/mcp/configuring-mcp-servers and use the config provided above.Codex
Follow the configure MCP guide using the standard config from above. You can also install the Chrome DevTools MCP server using the Codex CLI:On Windows 11
Configure the Chrome install location and increase the startup timeout by updating
.codex/config.tomland adding the followingenvandstartup_timeout_msparameters:Copilot CLI
Start Copilot CLI:
Start the dialog to add a new MCP server by running:
Configure the following fields and press
CTRL+Sto save the configuration:chrome-devtools[1] Localnpx -y chrome-devtools-mcp@latestCopilot / VS Code
Click the button to install:
Or install manually:
Follow the MCP install guide, with the standard config from above. You can also install the Chrome DevTools MCP server using the VS Code CLI:
For macOS and Linux:
For Windows (PowerShell):
Cursor
Click the button to install:
Or install manually:
Go to
Cursor Settings->MCP->New MCP Server. Use the config provided above.Factory CLI
Use the Factory CLI to add the Chrome DevTools MCP server (guide):Gemini CLI
Install the Chrome DevTools MCP server using the Gemini CLI.Project wide:
Globally:
Alternatively, follow the MCP guide and use the standard config from above.
Gemini Code Assist
Follow the configure MCP guide using the standard config from above.JetBrains AI Assistant & Junie
Go to
Settings | Tools | AI Assistant | Model Context Protocol (MCP)->Add. Use the config provided above. The same way chrome-devtools-mcp can be configured for JetBrains Junie inSettings | Tools | Junie | MCP Settings->Add. Use the config provided above.Kiro
In Kiro Settings, go to
Configure MCP>Open Workspace or User MCP Config> Use the configuration snippet provided above.Or, from the IDE Activity Bar >
Kiro>MCP Servers>Click Open MCP Config. Use the configuration snippet provided above.Katalon Studio
The Chrome DevTools MCP server can be used with Katalon StudioAssist via an MCP proxy.
Step 1: Install the MCP proxy by following the MCP proxy setup guide.
Step 2: Start the Chrome DevTools MCP server with the proxy:
Note: You may need to pick another port if 8080 is already in use.
Step 3: In Katalon Studio, add the server to StudioAssist with the following settings:
http://127.0.0.1:8080/mcpHTTPOnce connected, the Chrome DevTools MCP tools will be available in StudioAssist.
OpenCode
Add the following configuration to your
opencode.jsonfile. If you don’t have one, create it at~/.config/opencode/opencode.json(guide):Qoder
In Qoder Settings, go to
MCP Server>+ Add> Use the configuration snippet provided above.Alternatively, follow the MCP guide and use the standard config from above.
Qoder CLI
Install the Chrome DevTools MCP server using the Qoder CLI (guide):
Project wide:
Globally:
Visual Studio
Click the button to install:
Warp
Go to
Settings | AI | Manage MCP Servers->+ Addto add an MCP Server. Use the config provided above.Windsurf
Follow the configure MCP guide using the standard config from above.Your first prompt
Enter the following prompt in your MCP Client to check if everything is working:
Your MCP client should open the browser and record a performance trace.
Tools
If you run into any issues, checkout our troubleshooting guide.
clickdragfillfill_formhandle_dialoghoverpress_keytype_textupload_fileclose_pagelist_pagesnavigate_pagenew_pageselect_pagewait_foremulateresize_pageperformance_analyze_insightperformance_start_traceperformance_stop_tracetake_memory_snapshotget_network_requestlist_network_requestsevaluate_scriptget_console_messagelighthouse_auditlist_console_messagestake_screenshottake_snapshotConfiguration
The Chrome DevTools MCP server supports the following configuration option:
--autoConnect/--auto-connectIf specified, automatically connects to a browser (Chrome 144+) running locally from the user data directory identified by the channel param (default channel is stable). Requires the remoted debugging server to be started in the Chrome instance via chrome://inspect/#remote-debugging.false--browserUrl/--browser-url,-uConnect to a running, debuggable Chrome instance (e.g.http://127.0.0.1:9222). For more details see: https://github.com/ChromeDevTools/chrome-devtools-mcp#connecting-to-a-running-chrome-instance.--wsEndpoint/--ws-endpoint,-wWebSocket endpoint to connect to a running Chrome instance (e.g., ws://127.0.0.1:9222/devtools/browser/). Alternative to –browserUrl.--wsHeaders/--ws-headersCustom headers for WebSocket connection in JSON format (e.g., ‘{“Authorization”:”Bearer token”}’). Only works with –wsEndpoint.--headlessWhether to run in headless (no UI) mode.false--executablePath/--executable-path,-ePath to custom Chrome executable.--isolatedIf specified, creates a temporary user-data-dir that is automatically cleaned up after the browser is closed. Defaults to false.--userDataDir/--user-data-dirPath to the user data directory for Chrome. Default is HOME/.cache/chrome−devtools−mcp/chrome−profileCHANNEL_SUFFIX_IF_NON_STABLE--channelSpecify a different Chrome channel that should be used. The default is the stable channel version.stable,canary,beta,dev--logFile/--log-filePath to a file to write debug logs to. Set the env variableDEBUGto*to enable verbose logs. Useful for submitting bug reports.--viewportInitial viewport size for the Chrome instances started by the server. For example,1280x720. In headless mode, max size is 3840x2160px.--proxyServer/--proxy-serverProxy server configuration for Chrome passed as –proxy-server when launching the browser. See https://www.chromium.org/developers/design-documents/network-settings/ for details.--acceptInsecureCerts/--accept-insecure-certsIf enabled, ignores errors relative to self-signed and expired certificates. Use with caution.--experimentalScreencast/--experimental-screencastExposes experimental screencast tools (requires ffmpeg). Install ffmpeg https://www.ffmpeg.org/download.html and ensure it is available in the MCP server PATH.--chromeArg/--chrome-argAdditional arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.--ignoreDefaultChromeArg/--ignore-default-chrome-argExplicitly disable default arguments for Chrome. Only applies when Chrome is launched by chrome-devtools-mcp.--categoryEmulation/--category-emulationSet to false to exclude tools related to emulation.true--categoryPerformance/--category-performanceSet to false to exclude tools related to performance.true--categoryNetwork/--category-networkSet to false to exclude tools related to network.true--performanceCrux/--performance-cruxSet to false to disable sending URLs from performance traces to CrUX API to get field performance data.true--usageStatistics/--usage-statisticsSet to false to opt-out of usage statistics collection. Google collects usage data to improve the tool, handled under the Google Privacy Policy (https://policies.google.com/privacy). This is independent from Chrome browser metrics. Disabled if CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS or CI env variables are set.true--slimExposes a “slim” set of 3 tools covering navigation, script execution and screenshots only. Useful for basic browser tasks.Pass them via the
argsproperty in the JSON configuration. For example:Connecting via WebSocket with custom headers
You can connect directly to a Chrome WebSocket endpoint and include custom headers (e.g., for authentication):
To get the WebSocket endpoint from a running Chrome instance, visit
http://127.0.0.1:9222/json/versionand look for thewebSocketDebuggerUrlfield.You can also run
npx chrome-devtools-mcp@latest --helpto see all available configuration options.Concepts
User data directory
chrome-devtools-mcpstarts a Chrome’s stable channel instance using the following user data directory:$HOME/.cache/chrome-devtools-mcp/chrome-profile-$CHANNEL%HOMEPATH%/.cache/chrome-devtools-mcp/chrome-profile-$CHANNELThe user data directory is not cleared between runs and shared across all instances of
chrome-devtools-mcp. Set theisolatedoption totrueto 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:
In these cases, start Chrome first and let the Chrome DevTools MCP server connect to it. There are two ways to do so:
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:
chrome://inspect/#remote-debuggingto enable remote debugging.Step 2: Configure Chrome DevTools MCP server to automatically connect to a running Chrome Instance
To connect the
chrome-devtools-mcpserver to the running Chrome instance, use--autoConnectcommand line argument for the MCP server.The following code snippet is an example configuration for gemini-cli:
Step 3: Test your setup
Make sure your browser is running. Open gemini-cli and run the following prompt:
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-urloption. 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-urloption to your MCP client configuration. The value of this option should be the URL of the running Chrome instance.http://127.0.0.1:9222is a common default.Step 2: Start the Chrome browser
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-urloption 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-dirflag. This ensures that your regular browsing profile and data are not exposed to the debugging session.macOS
Linux
Windows
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:
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.
Known limitations
See Troubleshooting.