Skip to content

Latest commit

 

History

History
185 lines (145 loc) · 5.96 KB

File metadata and controls

185 lines (145 loc) · 5.96 KB

Chrome DevTools MCP

chrome-devtools-mcp is a server that enables Model-Context-Protocol (MCP) clients to automate Chrome for debugging purposes. This is an early experimental prototype!

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

Getting started

Add the following config to your MCP client:

{
  "mcpServers": {
    "chrome-devtools-mcp": {
      "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 specific configuration

Cursor Follow https://docs.cursor.com/en/context/mcp#using-mcp-json and use the config provided above.
Claude Code Use the Claude Code CLI to add the Chrome DevTools MCP server ([guide](https://docs.anthropic.com/en/docs/claude-code/mcp)):
claude mcp add chrome-devtools-mcp npx chrome-devtools-mcp@latest
Cline Follow https://docs.cline.bot/mcp/configuring-mcp-servers and use the config provided above.
Copilot / VS Code Follow the MCP install [guide](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server), with the standard config from above. You can also install the Chrome DevTools MCP server using the VS Code CLI:
code --add-mcp '{"name":"chrome-devtools-mcp","command":"npx","args":["chrome-devtools-mcp@latest"]}'
Gemini CLI Follow the [MCP guide](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md#how-to-set-up-your-mcp-server) using the standard config from above.
Gemini Code Assist Follow the [configure MCP guide](https://cloud.google.com/gemini/docs/codeassist/use-agentic-chat-pair-programmer#configure-mcp-servers) using the standard config from above.

Tools

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.

    • Type: string
    • Choices: stable, canary, beta, dev
    • Default: stable

Pass them via the args property in the JSON configuration. For example:

{
  "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/mcp-profile-$CHANNEL
  • Window: %HOMEPATH%/.cache/chrome-devtools-mcp/mcp-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.