chrome-devtools-mcp
Similar
Coding agents face a fundamental problem: they are not able to see what the code they generate actually does when it runs in the browser. They're effectively programming with a blindfold on.
The Chrome DevTools MCP server changes this. AI coding assistants are able to debug web pages directly in Chrome, and benefit from DevTools debugging capabilities and performance insights. This improves their accuracy when identifying and fixing issues.
## What can you use it for?
Following are a few example prompts you can try out in the AI assistant of your choice like Gemini CLI.
Verify code changes in real-time
Generate a fix with your AI agent, and then automatically verify that the solution works as intended with Chrome DevTools MCP.
Verify in the browser that your change works as expected.
Diagnose network and console errors
Empower your agent to analyze network requests to uncover CORS issues or inspect console logs to understand why a feature isn't working as expected.
Prompt to try:
\`\`\`
A few images on localhost:8080 are not loading. What's happening?
\`\`\`
Simulate user behavior
Navigate, fill out forms, and click buttons to reproduce bugs and test complex user flows—all while inspecting the runtime environment.
Prompt to try:
\`\`\`
Why does submitting the form fail after entering an email address?
\`\`\`
Debug live styling and layout issues
Ask your AI agent to connect to a live page, inspect the DOM and CSS, and get concrete suggestions to fix complex layout problems like overflowing elements based on live data from the browser.
Prompt to try:
\`\`\`
The page on localhost:8080 looks strange and off. Check what's happening there.
\`\`\`
Automate performance audits
Instruct your AI agent to run a performance trace, analyze the results, and investigate specific performance issues like high LCP numbers.
Prompt to try:
\`\`\`
Localhost:8080 is loading slowly. Make it load faster.
\`\`\`
See our tool reference documentation for a list of all available tools.
Get started
To try this out, add the following config entry to your MCP client:
\`\`\`
\{
"mcpServers": \{
"chrome-devtools": \{
"command": "npx",
"args": ["chrome-devtools-mcp@latest"]
\}
\}
\}
\`\`\`
To check if it works, run the following prompt in your coding agent:
Please check the LCP of web.dev.
# Chrome DevTools MCP
[](https://npmjs.org/package/chrome-devtools-mcp)
\`chrome-devtools-mcp\` lets 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.
## Key features
- **Get performance insights**: Uses [Chrome
DevTools](https://github.com/ChromeDevTools/devtools-frontend) to record
traces and extract actionable performance insights.
- **Advanced browser debugging**: Analyze network requests, take screenshots and
check the browser console.
- **Reliable automation**. Uses
[puppeteer](https://github.com/puppeteer/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.
## Requirements
- [Node.js 22.12.0](https://nodejs.org/) or newer.
- [Chrome](https://www.google.com/chrome/) current stable version or newer.
- [npm](https://www.npmjs.com/).
## Getting started
Add the following config to your MCP client:
\`\`\`json
\{
"mcpServers": \{
"chrome-devtools": \{
"command": "npx",
"args": ["chrome-devtools-mcp@latest"]
\}
\}
\}
\`\`\`
> [!NOTE]
> Using \`chrome-devtools-mcp@latest\` ensures that your MCP client will always use the latest version of the Chrome DevTools MCP server.
### MCP Client configuration
](https://cursor.com/en/install-mcp?name=chrome-devtools&config=eyJjb21tYW5kIjoibnB4IGNocm9tZS1kZXZ0b29scy1tY3BAbGF0ZXN0In0%3D)
**Or install manually:**
Go to \`Cursor Settings\` -> \`MCP\` -> \`New MCP Server\`. Use the config provided above.
### Your first prompt
Enter the following prompt in your MCP Client to check if everything is working:
\`\`\`
Check the performance of https://developers.chrome.com
\`\`\`
Your MCP client should open the browser and record a performance trace.
> [!NOTE]
> The MCP server will start the browser automatically once the MCP client uses a tool that requires a running browser instance. Connecting to the Chrome DevTools MCP server on its own will not automatically start the browser.
## Tools
- **Input automation** (7 tools)
- [\`click\`](docs/tool-reference.md#click)
- [\`drag\`](docs/tool-reference.md#drag)
- [\`fill\`](docs/tool-reference.md#fill)
- [\`fill_form\`](docs/tool-reference.md#fill_form)
- [\`handle_dialog\`](docs/tool-reference.md#handle_dialog)
- [\`hover\`](docs/tool-reference.md#hover)
- [\`upload_file\`](docs/tool-reference.md#upload_file)
- **Navigation automation** (7 tools)
- [\`close_page\`](docs/tool-reference.md#close_page)
- [\`list_pages\`](docs/tool-reference.md#list_pages)
- [\`navigate_page\`](docs/tool-reference.md#navigate_page)
- [\`navigate_page_history\`](docs/tool-reference.md#navigate_page_history)
- [\`new_page\`](docs/tool-reference.md#new_page)
- [\`select_page\`](docs/tool-reference.md#select_page)
- [\`wait_for\`](docs/tool-reference.md#wait_for)
- **Emulation** (3 tools)
- [\`emulate_cpu\`](docs/tool-reference.md#emulate_cpu)
- [\`emulate_network\`](docs/tool-reference.md#emulate_network)
- [\`resize_page\`](docs/tool-reference.md#resize_page)
- **Performance** (3 tools)
- [\`performance_analyze_insight\`](docs/tool-reference.md#performance_analyze_insight)
- [\`performance_start_trace\`](docs/tool-reference.md#performance_start_trace)
- [\`performance_stop_trace\`](docs/tool-reference.md#performance_stop_trace)
- **Network** (2 tools)
- [\`get_network_request\`](docs/tool-reference.md#get_network_request)
- [\`list_network_requests\`](docs/tool-reference.md#list_network_requests)
- **Debugging** (4 tools)
- [\`evaluate_script\`](docs/tool-reference.md#evaluate_script)
- [\`list_console_messages\`](docs/tool-reference.md#list_console_messages)
- [\`take_screenshot\`](docs/tool-reference.md#take_screenshot)
- [\`take_snapshot\`](docs/tool-reference.md#take_snapshot)
## Configuration
The Chrome DevTools MCP server supports the following configuration option:
- **\`--browserUrl\`, \`-u\`**
Connect to a running Chrome instance using port forwarding. For more details see: https://developer.chrome.com/docs/devtools/remote-debugging/local-server.
- **Type:** string
- **\`--headless\`**
Whether to run in headless (no UI) mode.
- **Type:** boolean
- **Default:** \`false\`
- **\`--executablePath\`, \`-e\`**
Path to custom Chrome executable.
- **Type:** string
- **\`--isolated\`**
If specified, creates a temporary user-data-dir that is automatically cleaned up after the browser is closed.
- **Type:** boolean
- **Default:** \`false\`
- **\`--channel\`**
Specify a different Chrome channel that should be used. The default is the stable channel version.
- **Type:** string
- **Choices:** \`stable\`, \`canary\`, \`beta\`, \`dev\`
- **\`--logFile\`**
Path to a file to write debug logs to. Set the env variable \`DEBUG\` to \`*\` to enable verbose logs. Useful for submitting bug reports.
- **Type:** string
Pass them via the \`args\` property in the JSON configuration. For example:
\`\`\`json
\{
"mcpServers": \{
"chrome-devtools": \{
"command": "npx",
"args": [
"chrome-devtools-mcp@latest",
"--channel=canary",
"--headless=true",
"--isolated=true"
]
\}
\}
\}
\`\`\`
You can also run \`npx chrome-devtools-mcp@latest --help\` to see all available configuration options.
## Concepts
### 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\`
- Window: \`%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.
## Known limitations
### Operating system sandboxes
Some MCP clients allow sandboxing the MCP server using macOS Seatbelt or Linux
containers. If sandboxes are enabled, \`chrome-devtools-mcp\` is not able to start
Chrome that requires permissions to create its own sandboxes. As a workaround,
either disable sandboxing for \`chrome-devtools-mcp\` in your MCP client or use
\`--connect-url\` to connect to a Chrome instance that you start manually outside
of the MCP client sandbox.
Prompts
A few images on localhost:8080 are not loading. What's happening?
Reviews
Tags
-
Prompt: A few images on localhost:8080 are not loading. What's happening?I just tried the recommended prompt in Google Blog and am using cursor to start the Google Chrome Dev MCPs. It's working pretty good. First the agent on Cursor recommends to use command '$ lsof -i :8080' to check what's running on the portal and guessing the programming running by scripts "$ ps aux | grep -E "(node|npm|http|server)" | grep -v grep". And then curl the terminal "$ curl -I http://localhost:8080". And Found the problem.
Write Your Review
Detailed Ratings
Name
Size
Type
Download
Last Modified
-1
-
Community
Reply