Skip to content

381sm016/brave-devtools-mcp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

492 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brave DevTools MCP

Modified version of chrome-devtools-mcp without telemetry data and adapted to work with brave. Plug and play as it is just a Chromium browser.

Fork of chrome-devtools-mcp, adapted for Brave Browser.

Disclaimers

brave-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

Installation

Since brave-devtools-mcp is not published to the public npm registry, you need to install it manually from this repository.

1. Clone the repository

git clone https://github.com/381sm016/brave-devtools-mcp.git
cd brave-devtools-mcp

2. Install dependencies

npm install

3. (Optional) Build / prepare

If the project uses a build step (e.g. TypeScript), run it here. If not, you can skip this.

npm run build

4. Decide how you want to reference the server

You have two main options:

  1. Use a local path directly (recommended for development)
  2. Use a global install from the cloned repo

Option A: Use a local path directly

Most MCP clients let you point command at a local node or npm and then pass a relative path to the repo’s entry point.

Example (generic):

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": [
        "/absolute/path/to/brave-devtools-mcp/dist/index.js"
      ]
    }
  }
}

Adjust the path to whatever the actual entry file is (e.g. bin/brave-devtools-mcp.js, dist/index.js, etc).

Option B: Global install from the cloned repo

From inside the cloned repo:

npm install -g .

This will make a brave-devtools-mcp binary available on your PATH (assuming the project exposes one). You can then use just brave-devtools-mcp as the command in your MCP clients.

brave-devtools-mcp --help

Getting started

After manual installation, configure your MCP client to use the locally installed brave-devtools-mcp rather than npx / npm.

MCP Client configuration

Below are per–agent examples using manual/local installation.

Replace /absolute/path/to/brave-devtools-mcp and any script paths with the actual location on your system. If you installed globally with npm install -g . and have a brave-devtools-mcp binary, you can use "command": "brave-devtools-mcp" and omit the path.

Claude Code Use the Claude Code CLI to add the Brave DevTools MCP server (guide).

If you installed globally and have a brave-devtools-mcp binary:

claude mcp add brave-devtools --scope user brave-devtools-mcp

If you prefer calling the local script directly:

claude mcp add brave-devtools --scope user node /absolute/path/to/brave-devtools-mcp/dist/index.js

Adjust the entry file path as needed.

Cursor

Go to Cursor Settings -> MCP -> New MCP Server and configure it to use the locally installed server.

If installed globally:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "brave-devtools-mcp",
      "args": []
    }
  }
}

If using a local script:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": ["/absolute/path/to/brave-devtools-mcp/dist/index.js"]
    }
  }
}
Copilot / VS Code

Follow the MCP install guide, but reference the local brave-devtools-mcp instead of npx.

In your mcpServers configuration:

Global binary:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "brave-devtools-mcp",
      "args": []
    }
  }
}

Local script:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": ["/absolute/path/to/brave-devtools-mcp/dist/index.js"]
    }
  }
}
Windsurf Follow the configure MCP guide using a local command instead of `npx`.

Example using a global binary:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "brave-devtools-mcp",
      "args": []
    }
  }
}

Or using a local script:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": ["/absolute/path/to/brave-devtools-mcp/dist/index.js"]
    }
  }
}
Cline Follow https://docs.cline.bot/mcp/configuring-mcp-servers, but instead of using `npx`, reference the local installation.

Global binary:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "brave-devtools-mcp",
      "args": []
    }
  }
}

Local script:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": ["/absolute/path/to/brave-devtools-mcp/dist/index.js"]
    }
  }
}
Gemini CLI Install the Brave DevTools MCP server manually, then point Gemini at your local command instead of using the npm registry.

Project wide (global binary):

gemini mcp add brave-devtools brave-devtools-mcp

Project wide (local script):

gemini mcp add brave-devtools node /absolute/path/to/brave-devtools-mcp/dist/index.js

Globally (global binary):

gemini mcp add -s user brave-devtools brave-devtools-mcp

Globally (local script):

gemini mcp add -s user brave-devtools node /absolute/path/to/brave-devtools-mcp/dist/index.js
Codex Follow the configure MCP guide using the local `brave-devtools-mcp` command instead of `npx`. You can also register it via the Codex CLI.

Global binary:

codex mcp add brave-devtools -- brave-devtools-mcp

Local script:

codex mcp add brave-devtools -- node /absolute/path/to/brave-devtools-mcp/dist/index.js

On Windows 11

Configure the Brave install location and increase the startup timeout by updating .codex/config.toml and adding the following env and startup_timeout_ms parameters:

[mcp_servers.brave-devtools]
command = "cmd"
args = [
    "/c",
    "node",
    "C:\\path\\to\\brave-devtools-mcp\\dist\\index.js",
]
env = { SystemRoot="C:\\Windows", PROGRAMFILES="C:\\Program Files" }
startup_timeout_ms = 20_000

Adjust the path to match your local checkout.

Your first prompt

Enter the following prompt in your MCP Client to check if everything is working:

Check the performance of https://search.brave.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 Brave DevTools MCP server on its own will not automatically launch Brave.

Tools

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

Configuration

The Brave DevTools MCP server supports the following configuration options:

  • --autoConnect/ --auto-connect If specified, automatically connects to a running Brave instance using the user data directory identified by the channel param. Requires the remote debugging server to be started in the Brave instan[...]

    • Type: boolean
    • Default: false
  • --browserUrl/ --browser-url, -u Connect to a running, debuggable Brave instance (e.g. http://127.0.0.1:9222).

    • Type: string
  • --wsEndpoint/ --ws-endpoint, -w WebSocket endpoint to connect to a running Brave instance (e.g., ws://127.0.0.1:9222/devtools/browser/). Alternative to --browserUrl.

    • Type: string
  • --wsHeaders/ --ws-headers Custom headers for WebSocket connection in JSON format (e.g., '{"Authorization":"Bearer token"}'). Only works with --wsEndpoint.

    • Type: string
  • --headless Whether to run in headless (no UI) mode.

    • Type: boolean
    • Default: false
  • --executablePath/ --executable-path, -e Path to custom Brave executable.

    • Type: string
  • --isolated If specified, creates a temporary user-data-dir that is automatically cleaned up after the browser is closed. Defaults to false.

    • Type: boolean
  • --userDataDir/ --user-data-dir Path to the user data directory for Brave. Default is $HOME/.cache/brave-devtools-mcp/brave-profile$CHANNEL_SUFFIX_IF_NON_STABLE

    • Type: string
  • --channel Specify a different Brave channel that should be used. The default is the stable channel version.

    • Type: string
    • Choices: stable, beta, dev, nightly
  • --logFile/ --log-file 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
  • --viewport Initial viewport size for the Brave instances started by the server. For example, 1280x720. In headless mode, max size is 3840x2160px.

    • Type: string
  • --proxyServer/ --proxy-server Proxy server configuration for Brave passed as --proxy-server when launching the browser. See https://www.chromium.org/developers/design-documents/network-settings/ for details.

    • Type: string
  • --acceptInsecureCerts/ --accept-insecure-certs If enabled, ignores errors relative to self-signed and expired certificates. Use with caution.

    • Type: boolean
  • --braveArg/ --brave-arg Additional arguments for Brave. Only applies when Brave is launched by brave-devtools-mcp.

    • Type: array
  • --ignoreDefaultBraveArg/ --ignore-default-brave-arg Explicitly disable default arguments for Brave. Only applies when Brave is launched by brave-devtools-mcp.

    • Type: array
  • --categoryEmulation/ --category-emulation Set to false to exclude tools related to emulation.

    • Type: boolean
    • Default: true
  • --categoryPerformance/ --category-performance Set to false to exclude tools related to performance.

    • Type: boolean
    • Default: true
  • --categoryNetwork/ --category-network Set to false to exclude tools related to network.

    • Type: boolean
    • Default: true

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

{
  "mcpServers": {
    "brave-devtools": {
      "command": "brave-devtools-mcp",
      "args": [
        "--channel=nightly",
        "--headless=true",
        "--isolated=true"
      ]
    }
  }
}

Or, if using a local script:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": [
        "/absolute/path/to/brave-devtools-mcp/dist/index.js",
        "--channel=nightly",
        "--headless=true",
        "--isolated=true"
      ]
    }
  }
}

Connecting via WebSocket with custom headers

You can connect directly to a Brave WebSocket endpoint and include custom headers (e.g., for authentication):

{
  "mcpServers": {
    "brave-devtools": {
      "command": "brave-devtools-mcp",
      "args": [
        "--wsEndpoint=ws://127.0.0.1:9222/devtools/browser/<id>",
        "--wsHeaders={\"Authorization\":\"Bearer YOUR_TOKEN\"}"
      ]
    }
  }
}

Or with a local script:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": [
        "/absolute/path/to/brave-devtools-mcp/dist/index.js",
        "--wsEndpoint=ws://127.0.0.1:9222/devtools/browser/<id>",
        "--wsHeaders={\"Authorization\":\"Bearer YOUR_TOKEN\"}"
      ]
    }
  }
}

To get the WebSocket endpoint from a running Brave instance, visit http://127.0.0.1:9222/json/version and look for the webSocketDebuggerUrl field.

You can also run brave-devtools-mcp --help (or node /absolute/path/to/brave-devtools-mcp/dist/index.js --help) to see all available configuration options.

Concepts

User data directory

brave-devtools-mcp starts a Brave stable channel instance using the following user data directory:

  • Linux / macOS: $HOME/.cache/brave-devtools-mcp/brave-profile-$CHANNEL
  • Windows: %HOMEPATH%/.cache/brave-devtools-mcp/brave-profile-$CHANNEL

The user data directory is not cleared between runs and shared across all instances of brave-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 Brave instance

By default, the Brave DevTools MCP server will start a new Brave 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 Brave DevTools MCP server).
  • If you're running your LLM inside a sandboxed environment, but you would like to connect to a Brave instance that runs outside the sandbox.

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

  • Automatic connection: 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 Brave instance

Step 1: Set up remote debugging in Brave

In Brave, do the following to set up remote debugging:

  1. Navigate to brave://inspect/#remote-debugging to enable remote debugging.
  2. Follow the dialog UI to allow or disallow incoming debugging connections.

Step 2: Configure Brave DevTools MCP server to automatically connect to a running Brave instance

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

The following code snippet is an example configuration:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "brave-devtools-mcp",
      "args": ["--autoConnect", "--channel=stable"]
    }
  }
}

Or, with a local script:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": [
        "/absolute/path/to/brave-devtools-mcp/dist/index.js",
        "--autoConnect",
        "--channel=stable"
      ]
    }
  }
}

Step 3: Test your setup

Make sure your browser is running. Open your MCP client and run the following prompt:

Check the performance of https://search.brave.com

Note

The autoConnect option requires the user to start Brave. If the user has multiple active profiles, the MCP server will connect to the default profile (as determined by Brave). The MCP s[...]

The Brave DevTools MCP server will try to connect to your running Brave instance.

Manual connection using port forwarding

You can connect to a running Brave 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 Brave in[...]

Here is a step-by-step guide on how to connect to a running Brave 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 Brave instance. http://127.0.0.1:9222 is a common default.

{
  "mcpServers": {
    "brave-devtools": {
      "command": "brave-devtools-mcp",
      "args": [
        "--browser-url=http://127.0.0.1:9222"
      ]
    }
  }
}

Or, with a local script:

{
  "mcpServers": {
    "brave-devtools": {
      "command": "node",
      "args": [
        "/absolute/path/to/brave-devtools-mcp/dist/index.js",
        "--browser-url=http://127.0.0.1:9222"
      ]
    }
  }
}

Step 2: Start the Brave 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[...]

Start the Brave browser with the remote debugging port enabled. Make sure to close any running Brave instances before starting a new one with the debugging port enabled. The port number you choose mus[...]

macOS

/Applications/Brave\ Browser.app/Contents/MacOS/Brave\ Browser --remote-debugging-port=9222 --user-data-dir=/tmp/brave-profile-stable

Linux

/usr/bin/brave-browser --remote-debugging-port=9222 --user-data-dir=/tmp/brave-profile-stable

Windows

"C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe" --remote-debugging-port=9222 --user-data-dir="%TEMP%\brave-profile-stable"

Step 3: Test your setup

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

Check the performance of https://search.brave.com

Your MCP client should connect to the running Brave 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](./docs/troubleshooting.md#remote-debugging-b[...]

Known limitations

Operating system sandboxes

Some MCP clients allow sandboxing the MCP server using macOS Seatbelt or Linux containers. If sandboxes are enabled, brave-devtools-mcp is not able to start Brave that requires permissions to create its own sandboxes. As a workaround, either disable sandboxing for brave-devtools-mcp in your MCP client or use --browser-url to connect to a Brave instance that you start manually outside of the MCP client sandbox.

About

Modified version of Chrome DevTools for Brave

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 96.2%
  • JavaScript 3.8%