# Chrome DevTools MCP server

> Lets an AI coding agent control and inspect a live Chrome browser for automation, debugging, and performance analysis.

- Repository: https://github.com/ChromeDevTools/chrome-devtools-mcp
- Page: https://hostedmcp.org/servers/chromedevtools/chrome-devtools-mcp
- Transport: stdio
- Stars: 56922
- License: Apache-2.0
- Latest version: 1.13.0

## Install

### Claude Code

```sh
claude mcp add chrome-devtools-mcp -- npx -y chrome-devtools-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "chrome-devtools-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "chrome-devtools-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"chrome-devtools-mcp","type":"stdio","command":"npx","args":["-y","chrome-devtools-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "chrome-devtools-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add chrome-devtools-mcp -- npx -y chrome-devtools-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.chrome-devtools-mcp]
command = "npx"
args = ["-y", "chrome-devtools-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user chrome-devtools-mcp npx -- -y chrome-devtools-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "chrome-devtools-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-devtools-mcp"
      ]
    }
  }
}
```

## Tools (33)

- `click`: Clicks on the provided element
- `close_page`: Closes the page by its index. The last open page cannot be closed.
- `drag`: Drag an element onto another element
- `emulate`: Emulates various features on the target page. Each call replaces all emulation settings (except extraHttpHeaders), so pass all desired settings in a single call.
- `evaluate_script`: Evaluate JavaScript inside the target page. The source can be provided inline or loaded from a local file. Returns the response as JSON, so returned values have to be JSON-serializable.
- `fill`: Type text into an input, text area or select an option from a <select> element.
- `fill_form`: Fill out multiple form elements (inputs, selects, checkboxes, radios) at once. ALWAYS prefer this tool over multiple individual 'fill' or 'click' calls when interacting with forms. It is significantly faster, more reliable, and reduces turn count. Example: Fill username, password, and check "Remember Me" in one call.
- `get_console_message`: Gets a console message by its ID. You can get all messages by calling list_console_messages. (read-only)
- `get_css_styles`: Retrieve matched CSS rules, inline styles (element.style), inherited styles, custom properties, and cascade wrappers (@layer, @media, @container, @scope) for an element identified by its UID. Rules are ordered from highest to lowest cascade precedence and include source line numbers (e.g. index:196). Active (winning) declarations have no prefix tag, while (losing) overridden declarations are prefixed with [overloaded]. Treat the output as authoritative and complete. Results are paginated (10 rules per page by default); use pageIdx to page through the remaining rules. Requires a UID from take_snapshot. (read-only)
- `get_network_request`: Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel. Useful for inspecting request headers (including 'Cookie') and response headers (including 'Set-Cookie' and directives).
- `handle_dialog`: If a browser dialog was opened, use this command to handle it
- `hover`: Hover over the provided element
- `lighthouse_audit`: Get Lighthouse scores, failing audits, and the DOM nodes they flag for accessibility, SEO, best practices, and agentic browsing. Full reports are saved to disk. This excludes performance. For performance audits, run performance_start_trace
- `list_console_messages`: List all console messages for the target page since the last navigation. (read-only)
- `list_network_requests`: Lists the most recent requests for the target page since the last navigation. (read-only)
- `list_pages`: Get a list of pages open in the browser. (read-only)
- `navigate_page`: Go to a URL, or back, forward, or reload. Use project URL if not specified otherwise.
- `new_page`: Open a new tab and load a URL. Use project URL if not specified otherwise.
- `performance_analyze_insight`: Provides more detailed information on a specific Performance Insight of an insight set that was highlighted in the results of a trace recording. (read-only)
- `performance_start_trace`: Start a performance trace on the target webpage. Use to find frontend performance issues, Core Web Vitals (LCP, INP, CLS), and improve page load speed.
- `performance_stop_trace`: Stop the active performance trace recording on the target webpage.
- `press_key`: Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations). Note: On macOS, native <select> elements cannot be operated with ArrowDown/Enter via press_key; use fill() on the combobox or click() on the option instead.
- `resize_page`: Resizes the page's window so that the page has specified dimension
- `screencast_start`: Starts recording a screencast (video) of the target page.
- `screencast_stop`: Stops the active screencast recording on the target page.
- `select_page`: Select a page as a context for future tool calls. (read-only)
- `set_logpoints`: Set the complete set of logpoints of the selected page: logpoints not in the list are removed, new ones are added, and an empty list removes all. A logpoint logs expressions to the console every time a line executes, without pausing or changing the source, like logpoints in the DevTools Sources panel. Locations are script URLs or original source files resolved through source maps (not available with --no-source-maps; scripts in workers and out-of-process iframes are not supported). A location in a generated script moves to its original source line when a source map covers it, and locations on the same line become one logpoint with the last expression. Output appears in list_console_messages; an expression that throws produces an error message without text. Logpoints survive reloads and navigations until removed or the page is closed. The response lists the resulting logpoints and where they are bound.
- `take_heapsnapshot`: Capture a heap snapshot of the target page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.
- `take_screenshot`: Take a screenshot of the page or element.
- `take_snapshot`: Take a text snapshot of the target page based on the a11y tree. The snapshot lists page elements along with a unique identifier (uid). Always use the latest snapshot. Prefer taking a snapshot over taking a screenshot. The snapshot indicates the element selected in the DevTools Elements panel (if any).
- `type_text`: Type text using keyboard into a previously focused input
- `upload_file`: Upload a file through a provided element.
- `wait_for`: Wait for the specified text to appear on the selected page. By default, hidden text is also matched. Set visible to true to wait until the matched text is visible. (read-only)

## FAQ

### What can an AI agent do with the Chrome DevTools MCP server?

It can control and inspect a live Chrome browser, including recording performance traces, analyzing network requests, taking screenshots, and checking console messages.

### Which browsers does chrome-devtools-mcp support?

It officially supports Google Chrome and Chrome for Testing; other Chromium-based browsers may work but are not guaranteed.

### How do I install the Chrome DevTools MCP server?

Add an MCP client config entry that runs npx with the chrome-devtools-mcp@latest package.

### Does chrome-devtools-mcp collect usage statistics?

Yes, Google collects usage statistics by default; you can opt out with the --no-usage-statistics flag or the CHROME_DEVTOOLS_MCP_NO_USAGE_STATISTICS environment variable.

### What are the requirements to run the server?

You need a Node.js LTS version, a current stable Chrome version or newer, and npm.
