Dive icon indicating copy to clipboard operation
Dive copied to clipboard

[Bug] Cannot execute puppeteer on Linux

Open mritzco opened this issue 1 year ago • 2 comments

Description

Puppeteer MCP server error:

Error: MCP error -32603: Failed to launch the browser process! undefined [145878:145878:0331/182806.881014:ERROR:ozone_platform_x11.cc(244)] Missing X server or $DISPLAY [145878:145878:0331/182806.881071:ERROR:env.cc(257)] The platform failed to initialize. Exiting.

TROUBLESHOOTING: https://pptr.dev/troubleshooting

I've tried every recommended configuration but the error never changes within Dive.

Puppeteer runs directly from terminal using NPX or global install. I've tried to debug using the inspector with this line:

npx -y @modelcontextprotocol/inspector npx @modelcontextprotocol/server-puppeteer

And it also works perfectly.

Are there any differences between running with inspector and with Dive to make it work?

System

Linux Mint 21.3 All dependencies installed following puppeteer troubleshooting

mritzco avatar Mar 31 '25 11:03 mritzco

Puppeteer cannot access $DISPLAY environment variable. You need to run it with Xvfb (X Virtual Framebuffer).

Please refer to this related issue for a solution: https://github.com/modelcontextprotocol/servers/issues/819

In that issue, the solution was to:

  1. Install Xvfb: sudo apt-get update && sudo apt-get install xvfb
  2. Wrap the Puppeteer command with xvfb-run: xvfb-run -a npx -y @modelcontextprotocol/server-puppeteer

This provides a virtual display for Puppeteer to run on without an actual X server.

kevinwatt avatar Mar 31 '25 16:03 kevinwatt

hi @kevinwatt

Thanks for your reply; sadly with that configuration I get an error right after saving the configuration: puppeteer failed to load: MCP error -32000: Connection closed

Just like before, it works with inspector

mritzco avatar Apr 02 '25 14:04 mritzco