wsl-chrome-mcp-bridge
by dijdzv
README.md
# wsl-chrome-mcp-bridge
MCP bridge that launches Chrome on Windows from WSL2 and proxies [chrome-devtools-mcp](https://www.npmjs.com/package/chrome-devtools-mcp).
## How it works
```
Claude Code (WSL2)
↕ stdio (JSON-RPC)
wsl-chrome-mcp-bridge (WSL2)
├── spawns Chrome on Windows (--remote-debugging-port)
├── spawns chrome-devtools-mcp via npx
└── proxies MCP messages + adds chrome_open / chrome_close tools
```
The bridge adds two lifecycle tools (`chrome_open` / `chrome_close`) and proxies all other tool calls to `chrome-devtools-mcp`. Chrome is launched on-demand when `chrome_open` is called and tool definitions are prefetched at startup for instant availability.
## Requirements
- WSL2 with **mirrored networking mode** enabled (see below)
- Node.js >= 20
- Google Chrome installed on Windows
- `npx` available in PATH
### WSL2 mirrored networking
The bridge connects to Chrome's debug port at `127.0.0.1`. WSL2's default NAT mode isolates the network from Windows, so mirrored mode is required.
Add to `%USERPROFILE%\.wslconfig`:
```ini
[wsl2]
networkingMode=mirrored
```
Then restart WSL: `wsl --shutdown`
## Installation
```bash
# Run directly (no install needed)
npx -y wsl-chrome-mcp-bridge
# Or install globally
npm install -g wsl-chrome-mcp-bridge
```
## Claude Code configuration
Add to your `.mcp.json`:
```json
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "wsl-chrome-mcp-bridge"]
}
}
}
```
## Options
| Option | Environment Variable | Default | Description |
|--------|---------------------|---------|-------------|
| `--port`, `-p` | `CHROME_DEBUG_PORT` | `9222` | Chrome remote debugging port |
| `--user-data-dir` | `CHROME_USER_DATA_DIR` | `C:\tmp\chrome-devtools-mcp` | Chrome user data directory (Windows path) |
| `--chrome-path` | `CHROME_PATH` | auto-detect | Path to Chrome executable |
| `--headless` | `CHROME_HEADLESS=1` | off | Run Chrome in headless mode |
| `--help`, `-h` | | | Show help |
| `--version`, `-v` | | | Show version |
### Chrome path auto-detection
1. Query Windows registry via PowerShell (`App Paths\chrome.exe`)
2. Check known paths (`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`, etc.)
## License
MIT
TDQS
A4.2/5.0
Scored across 2 tools
Disambiguation5/5
The two tools, chrome_open and chrome_close, are completely distinct actions with no overlap. Each serves a single clear purpose.
Naming Consistency5/5
Both tools follow the consistent pattern 'chrome_<verb>', using snake_case and clear verb_noun structure.
Tool Count5/5
With exactly two tools for opening and closing the bridge, the count is minimal but perfectly scoped for the server's intended role.
Completeness5/5
The tool set fully covers the lifecycle of the Chrome debugging instance (start and stop), with no necessary operations missing for this narrow domain.
Maintenance
ActivityInactive
ResponsivenessNo issues