Install the package globally to make the chrome-devtools command available. You only need to do this the first time you use it.
npm i chrome-devtools-mcp@latest -g
chrome-devtools status # check if install worked.If Chrome is not already installed, install it with winget:
winget install --id Google.Chrome --accept-source-agreements --accept-package-agreementsChrome requires a non-default --user-data-dir when enabling --remote-debugging-port. To reuse your existing Chrome profile, create a junction from a non-default path to the real profile:
New-Item -ItemType Directory -Path "$HOME\.cache\Google\Chrome" -Force
New-Item -ItemType Directory -Path "$HOME\AppData\Local\Google\Chrome\User Data" -Force
cmd /c mklink /J "$HOME\.cache\Google\Chrome\User Data" "$HOME\AppData\Local\Google\Chrome\User Data"Tip: A junction does not require Administrator privileges or Developer Mode, unlike a symbolic link.
Create a new shortcut with the remote debugging flags baked in (overwrites any existing one):
$shell = New-Object -ComObject WScript.Shell
$lnk = $shell.CreateShortcut("$env:USERPROFILE\Desktop\Google Chrome.lnk")
$lnk.TargetPath = "C:\Program Files\Google\Chrome\Application\chrome.exe"
$lnk.Arguments = '--remote-debugging-port=9222 --user-data-dir="C:\Users\lijunle\.cache\Google\Chrome\User Data"'
$lnk.WorkingDirectory = "C:\Program Files\Google\Chrome\Application"
$lnk.Save()Move the shortcut to your preferred location (e.g., Start Menu, taskbar). To verify the shortcut is correct, right-click it → Properties and confirm the Target field includes the --remote-debugging-port and --user-data-dir flags.
Close Chrome completely, then relaunch it from the updated shortcut, or run manually:
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="C:\Users\lijunle\.cache\Google\Chrome\User Data"Note: Chrome must be fully closed before launching with these flags. The junction and shortcut setup are one-time steps.
After Chrome is running, verify that the remote debugging port is active:
curl http://localhost:9222/jsonA successful response returns a JSON array listing the open tabs. If the connection is refused, ensure Chrome was launched with the --remote-debugging-port=9222 flag and that no other process is using port 9222.
- Command not found: If
chrome-devtoolsis not recognized, ensure your global npmbindirectory is in your system'sPATH. Restart your terminal or source your shell configuration file (e.g.,.bashrc,.zshrc). - Permission errors: If you encounter
EACCESor permission errors during installation, avoid usingsudo. Instead, use a node version manager likenvm, or configure npm to use a different global directory. - Old version running: Run
chrome-devtools stop && npm uninstall -g chrome-devtools-mcpbefore reinstalling, or ensure the latest version is being picked up by your path.