Chrome-Devtools-MCP Error on Linux

Resolved 💬 25 comments Opened Oct 14, 2025 by xochaels Closed Mar 29, 2026
💡 Likely answer: A maintainer (gpeal, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.46.0

Which model were you using?

gpt-5-codex high

What platform is your computer?

Linux 5.15.146.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

Attempting to open Chrome DevTools through the Codex CLI with a headful browser immediately fails. The runtime lacks an X server, so Chromium can’t create a display. The DevTools API returns: Missing X server to start the headful browser. Either set headless to true or use xvfb-run to run your Puppeteer script.

What is the expected behavior?

output form claude code :<br>● I'll list the pages currently open in Chrome for you.<br> ⎿ # list_pages response <br> ## Pages<br> 0: about:blank \[selected\]

What do you see instead?

Called chrome-devtools.list_pages({})<br> └ Missing X server to start the headful browser. Either set headless to true or<br> use xvfb-run to run your Puppeteer script.

Additional information

No response

View original on GitHub ↗

25 Comments

gpeal contributor · 9 months ago

I don't think this is Codex related but if it works in another agentic coding tool and not in Codex, feel free to reopen.

irfan798 · 9 months ago

Same thing happens to me as well, I can use chrome-devtools with copilot and claude code but not with codex

TKasperczyk · 9 months ago

Same thing here - works in Gemini and Claude Code, but reports the aforementioned error in Codex CLI (Full Permissions granted).

irfan798 · 9 months ago

Could it be related to sandboxing?
https://github.com/openai/codex/issues/1124 ?

But there are no more .ts code its written so it could be related to https://github.com/openai/codex/blob/774892c6d7ddbe55bf8862748f9507b03b75c92f/codex-rs/core/src/landlock.rs#L16

bluebirddm · 9 months ago
  1. Configure the browser-url parameter for chrome-devtools mcp
  2. Run the following command to open Chrome.

nohup google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug-headful --no-first-run --disable-gpu about:blank >/tmp/chrome-launch.log 2>&1 &
A workaround to bypass the codex sandbox, even when I use --yolo.

gpeal contributor · 9 months ago

I was able to get the following successful result form the Chrome MCP using the prompt:

Please check the LCP of web.dev.

which was suggested by their docs. Could somebody provide more specific set of examples/cases of what isn't working.

The Chrome MCP server is what will execute its chrome commands, not our sandboxed exec tool so the sandbox shouldn't be in play here.

<img width="2986" height="2622" alt="Image" src="https://github.com/user-attachments/assets/ff8cde99-db6c-44d8-8a3c-bd45bce8a36f" />

timothy-web3-dev · 9 months ago

same thing on ubuntu

gpeal contributor · 9 months ago
same thing on ubuntu

Does it work with other coding agents?

ReversedK · 9 months ago

Same thing on Linux Mint, works fine with Claude Code

cratexnet · 9 months ago

LMDE7 is the same; both Codex and Claude Code have this issue.

LittleTurtle2333 · 9 months ago

Same thing here - works in Gemini and Claude Code, but reports the aforementioned error in Codex CLI (Full Permissions granted).

xochaels · 9 months ago
1. Configure the browser-url parameter for chrome-devtools mcp 2. Run the following command to open Chrome. nohup google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug-headful --no-first-run --disable-gpu about:blank >/tmp/chrome-launch.log 2>&1 & A workaround to bypass the codex sandbox, even when I use --yolo.

Thanks, It worked

gpeal contributor · 9 months ago

@LittleTurtle2333 are you also on Linux?

LittleTurtle2333 · 9 months ago
@LittleTurtle2333 are you also on Linux?

Yes, I also use a Linux-based system.

tonyho · 8 months ago
> 1. Configure the browser-url parameter for chrome-devtools mcp > 2. Run the following command to open Chrome. > nohup google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug-headful --no-first-run --disable-gpu about:blank >/tmp/chrome-launch.log 2>&1 & > A workaround to bypass the codex sandbox, even when I use --yolo. Thanks, It worked

What parameter should be used for the browser-url?

Just gotta it:
"--browser-url=http://127.0.0.1:9222"

csmashe · 7 months ago

Using the following to set up the mcp seems to work

[mcp_servers.chrome-devtools]
command = "bash"
args = [
"-lc",
"DISPLAY=:1 XAUTHORITY=$HOME/.Xauthority npx -y chrome-devtools-mcp@latest --isolated"
]

kleinhenz · 7 months ago
[mcp_servers.chrome-devtools]
command = "npx"
args = ["chrome-devtools-mcp@latest", "--executablePath", "/usr/bin/chromium", "--headless", "--isolated"]
env = {}

This is what worked for me on opensuse. It seems to work fine with headless.

StrayDragon · 6 months ago

I have same issue on wayland ... seem like mcp exec in sandbox and no idea to lanuch chrome

dushaoshuai · 6 months ago

Same issue on wayland. I'm using Manjaro. Please help. Thanks.

abcfy2 · 6 months ago

Same issue on wayland. Please help. Thanks.

StrayDragon · 6 months ago

i find a workaround to use this mcp with headful but need manually run chrome before

[mcp_servers.chrome-devtools]
args = [
    "-y",
    "chrome-devtools-mcp@latest",
    "--browser-url=http://127.0.0.1:9222"
]
command = "npx"
startup_timeout_sec = 60
# NOTE: run cmd before `google-chrome-stable --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-profile-stable --no-first-run`

ref: https://github.com/ChromeDevTools/chrome-devtools-mcp?tab=readme-ov-file#manual-connection-using-port-forwarding

joevtap · 6 months ago

Edit: @BeardTech workaround is more solid! Check it out: https://github.com/openai/codex/issues/5166#issuecomment-3824698247

---

On Fedora with Wayland and XWayland available:

[mcp_servers.chrome-devtools]
command = "npx"
args = ["-y", "chrome-devtools-mcp@latest"]
env = { DISPLAY = ":0", GDK_BACKEND = "x11", QT_QPA_PLATFORM = "xcb", SDL_VIDEODRIVER = "x11" }

Then run xhost +SI:localuser:$(whoami) to allow local connections to XWayland.

Restart codex.

It worked for me.

BeardTech · 5 months ago

Thanks to Codex, I found a working fix for Wayland.

✅ Fix

Edit ~/.codex/config.toml and pass Wayland env vars + force Chrome’s Wayland backend:

[mcp_servers.chrome-devtools]
command = "npx"
args = [
  "-y",
  "chrome-devtools-mcp@latest",
  "--chrome-arg=--ozone-platform=wayland",
  "--chrome-arg=--enable-features=UseOzonePlatform"
]
env_vars = ["WAYLAND_DISPLAY", "XDG_RUNTIME_DIR", "DBUS_SESSION_BUS_ADDRESS"]

✅ Result

Chrome launches headful under Wayland without switching to X11 or using Xvfb.

abcfy2 · 5 months ago

@BeardTech Wow! Amazing! It works.

etraut-openai contributor · 3 months ago

This bug report hasn't received any new upvotes or posts in about two months, so I presume that it no longer occurs or the above workaround suffices.