Browser tool cannot connect (ECONNREFUSED :: localhost:9222)

Solving Chrome DevTools Protocol (CDP) issues for Eigent.ai, OpenWork & similar local AI agents

What is CDP and why do we care in 2026?

CDP stands for Chrome DevTools Protocol.

It's the communication system that lets tools remotely control a Chrome/Chromium browser — open tabs, click buttons, read pages, fill forms, take screenshots, etc.

Almost every modern local AI agent desktop app (Eigent.ai, OpenWork, Claude Cowork clones, Browser Use tools, etc.) uses CDP to give the AI real browser access.

By default, Chrome listens for these remote control connections on port 9222 when you start it with the flag --remote-debugging-port=9222.

Why you get the "ECONNREFUSED" error

  • No Chrome is running with remote debugging enabled
  • OR — more commonly now — another AI agent tool already took port 9222 (very frequent when running OpenWork + Eigent.ai at the same time)
  • Only one Chrome instance can listen on any given port at once

Result: second tool gets "connection refused" because the port is already busy.

Fastest Fix – Use One Agent at a Time

  1. Fully quit OpenWork (check Task Manager / Activity Monitor — kill any lingering openwork/electron/chrome.exe processes)
  2. Close all Chrome windows and background Chrome processes
  3. Launch Chrome with remote debugging enabled (commands below)
  4. Go back to Eigent.ai and retry giving browser access

Chrome Launch Commands

Pick the one for your operating system:

  • Windows (run in Command Prompt or PowerShell): "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="C:\temp\chrome-debug"
  • macOS (run in Terminal): /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug
  • Linux: google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug (or chromium-browser)

Pro tip — you can safely add these flags too: --no-first-run --disable-extensions

How to check if it’s working

Open Firefox, Edge or any other browser and go to:

http://localhost:9222/json/version

You should see JSON output including a webSocketDebuggerUrl. If you see it → port 9222 is open and ready for Eigent.ai.

Running Eigent.ai + OpenWork at the same time?

It’s possible but requires extra steps:

  • Let one tool (usually OpenWork) launch and control its own browser
  • For the second tool, start Chrome on a different port (example: 9223)
  • Point the second tool to localhost:9223 (only works if the tool supports custom CDP endpoints)

→ For 95% of users: just close one agent completely. It's much less headache.

Still having trouble?

Useful quick checks:

  • See what's using port 9222 • macOS/Linux: lsof -i :9222 • Windows: netstat -ano | findstr :9222
  • Emergency kill (macOS/Linux): pkill -f chrome

Drop your OS + what you see in the terminal — I’ll give you exact next steps! 🚀

More detailed commands & troubleshooting

Full copy-paste technical guide (Markdown)