WSL helper to start Windows Chrome with remote debugging and socat port forwarding.
npm install @dbalabka/chrome-wslA lightweight shell script that automates Chrome DevTools MCP setup from WSL by launching Windows Chrome with remote debugging enabled and transparently proxying traffic from WSL using socat.
No Linux Chrome, no gWSL, no manual Windows networking setup.
* ๐ค Automatically bridges WSL โ Windows Chrome DevTools (9222) using socat
* โ
Validates required Windows portproxy and firewall rules
* ๐ Launches existing Windows Chrome with remote debugging and a temporary profile
* ๐งน Cleans up easily with a stop command and leaves no permanent system changes
* Fully automated: one command to get Chrome DevTools MCP working from WSL
* Lightweight: simple, readable shell script
* Uses your existing Windows Chrome โ no Linux Chrome or gWSL required
* Clean & reversible: minimal system changes, easy to uninstall
* Windows Chrome already installed
* WSL environment
* The script will install one small dependency (socat) automatically for port proxying
sh
npx @dbalabka/chrome-wsl
`
- If portproxy/firewall entries are missing, run the printed admin PowerShell commands on Windows, then rerun the script.
- The script logs socat output to /tmp/socat-9222.log.
- To stop the socat forwarder:
`sh
npx @dbalabka/chrome-wsl --stop
`
- To uninstall (prompts before removing the firewall rule and socat):
`sh
npx @dbalabka/chrome-wsl --uninstall
`
- Runs directly via npm without cloning; default entrypoint is chrome-wsl (matching the package name).> โน๏ธ๏ธ Note: Must be run from WSL. Docker is supported only for proxying (no Chrome launch).
#### Example
`sh
โฏ npx @dbalabka/chrome-wsl
โ
Detected Windows host IP: 172.18.112.1
โ
Portproxy 172.18.112.1:9222 -> 127.0.0.1:9222 is configured.
โ
Firewall rule "Chrome Remote Debug" exists.
โ
socat is already installed.
โ
Started socat (logging to /tmp/socat-9222.log).
โ
Launched Chrome (pid 32408) with remote debugging.
โ
Chrome is listening on port 9222.
`
`sh
โฏ npx @dbalabka/chrome-wsl --stop
โ
Stopped tracked Chrome process (pid 32408).
โ
Stopped socat forwarding for port 9222.
`$3
To install globally instead of npx:
`sh
npm install -g @dbalabka/chrome-wsl
`
Then run:
`sh
chrome-wsl
chrome-wsl --stop
chrome-wsl --uninstall
`Docker
chrome-wsl can also take care of starting a proxy inside the Docker container and allow to access the MCP server from localhost. It helps to use the same Chrome DevTools MCP configuration for agents running inside the docker container as well as outside.
`shell
npx @dbalabka/chrome-wsl --container=
npx @dbalabka/chrome-wsl --stop --container=
npx @dbalabka/chrome-wsl --uninstall --container=
`Chrome DevTools MCP configuration for agents
To use Windows Chrome with any agent running in WSL you have
to cofigure the DevTools to connect to
--browser-url=http://127.0.0.1:9222.$3
`toml
[mcp_servers.chome-devtools]
command = "npx"
args = ["-y", "chrome-devtools-mcp@latest", "--browser-url=http://127.0.0.1:9222"]
startup_timeout_sec = 20.0
`To run Codex inside the container and use the same MCP configuration and authorisation token, mount the Codex configuration folder inside the docker container using the following docker composer settings:
`shell
services:
app:
volumes:
- ~/.codex:/home/vscode/.codex
`License
MIT License. See LICENSE` for details.