Skip to content

Bug: chrome-devtools-mcp fails to connect to Chrome when run via Bun (bunx) #2256

@RichardFevrier

Description

@RichardFevrier

Hi 👋

I was trying to use chrome-devtools-mcp with VSCodium (Flatpak) on NixOS, but when running it via bunx instead of npx, Puppeteer silently fails to connect to Chrome.

The error is:

Error: Could not connect to Chrome. Check if Chrome is running.
    at ensureBrowserConnected (.../browser.js:101:19)

It fails in ~25ms, suggesting immediate rejection. Both --browser-url=http://127.0.0.1:9222 and --ws-endpoint=ws://127.0.0.1:9222/devtools/browser/<id> fail the same way.

Chrome's endpoint is reachable — curl http://127.0.0.1:9222/json/version and Bun's native fetch() both return valid JSON. The issue is specific to Puppeteer when running under Bun.

Switching from bunx to npx (Node.js v20) resolved the issue immediately.

System Info

  • OS: NixOS (VSCodium as Flatpak)
  • Chrome: Chromium Flatpak v146 with remote debugging on 127.0.0.1:9222
  • chrome-devtools-mcp: v0.20.3
  • Runtime: Bun via bunx

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions