Chrome Debug Mode Setup

This project provides the necessary scripts and configuration to run Chrome in debug mode for use with the Chrome DevTools MCP (Model Context Protocol).

Important: When using Chrome with the Chrome DevTools MCP, you MUST start Chrome with specific flags. The MCP cannot launch Chrome itself - it connects to an already-running instance.

Prerequisites

Before using this project, ensure you have the following installed:

Requirement Version Installation
Google Chrome Latest Download
Node.js 18+ Download
opencode Latest Download

Project Structure

project/
├── AGENTS.md                  # Agent guidelines
├── opencode.json              # MCP configuration
├── README.md                  # Project overview
├── INSTRUCTIONS.md            # Detailed documentation
├── util/
│   ├── start-chrome-debug.bat # Chrome startup script (Windows)
│   └── start-chrome-debug.sh # Chrome startup script (Mac/Linux)
└── docs/
    └── index.html             # This documentation

Quick Start

Step 1: Run the startup script to start Chrome in debug mode:
# Windows
util\start-chrome-debug.bat

# Mac/Linux (first time: chmod +x util/start-chrome-debug.sh)
./util/start-chrome-debug.sh
Step 2: Verify Chrome is running correctly by visiting:
http://localhost:9222/json

You should see a JSON response listing available pages/tabs.

Step 3: Use the Chrome DevTools MCP to control the browser. The MCP is already configured in opencode.json to connect to localhost:9222.

Startup Flags Explained

Required

--remote-debugging-port=9222

Enables the Chrome DevTools Protocol on port 9222, allowing the MCP to connect and control the browser.

Recommended

--no-first-run
--no-default-browser-check
--user-data-dir=%TEMP%\chrome-debug

MCP Configuration

The project includes an opencode.json file that configures the Chrome DevTools MCP:

{
  "mcp": {
    "chrome-devtools": {
      "type": "local",
      "command": ["npx", "-y", "chrome-devtools-mcp@latest", "--browser-url=http://localhost:9222"],
      "enabled": true
    }
  }
}

Troubleshooting

If the MCP cannot connect:

Manual Chrome Startup

If you prefer to start Chrome manually, run:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --no-first-run --no-default-browser-check --user-data-dir=%TEMP%\chrome-debug