Chrome-Devtools-MCP Error on Linux
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
25 Comments
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.
Same thing happens to me as well, I can use
chrome-devtoolswith copilot and claude code but not with codexSame thing here - works in Gemini and Claude Code, but reports the aforementioned error in Codex CLI (Full Permissions granted).
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
browser-urlparameter for chrome-devtools mcpnohup 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.
I was able to get the following successful result form the Chrome MCP using the prompt:
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
chromecommands, not our sandboxedexectool 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" />
same thing on ubuntu
Does it work with other coding agents?
Same thing on Linux Mint, works fine with Claude Code
LMDE7 is the same; both Codex and Claude Code have this issue.
Same thing here - works in Gemini and Claude Code, but reports the aforementioned error in Codex CLI (Full Permissions granted).
Thanks, It worked
@LittleTurtle2333 are you also on Linux?
Yes, I also use a Linux-based system.
What parameter should be used for the
browser-url?Just gotta it:
"--browser-url=http://127.0.0.1:9222"
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"
]
This is what worked for me on opensuse. It seems to work fine with headless.
I have same issue on wayland ... seem like mcp exec in sandbox and no idea to lanuch chrome
Same issue on wayland. I'm using Manjaro. Please help. Thanks.
Same issue on wayland. Please help. Thanks.
i find a workaround to use this mcp with headful but need manually run chrome before
ref: https://github.com/ChromeDevTools/chrome-devtools-mcp?tab=readme-ov-file#manual-connection-using-port-forwarding
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:
Then run
xhost +SI:localuser:$(whoami)to allow local connections to XWayland.Restart codex.
It worked for me.
Thanks to Codex, I found a working fix for Wayland.
✅ Fix
Edit
~/.codex/config.tomland pass Wayland env vars + force Chrome’s Wayland backend:✅ Result
Chrome launches headful under Wayland without switching to X11 or using Xvfb.
@BeardTech Wow! Amazing! It works.
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.