Troubleshooting Guide
Troubleshooting Guide
Section titled “Troubleshooting Guide”Version: 1.0.13
Status: Active
This guide addresses common issues users encounter with puppeteer-mcp installation, configuration, and runtime. Each section provides clear problem descriptions, step-by-step solutions, and verification methods.
Table of Contents
Section titled “Table of Contents”- Installation Issues
- CLI Command Issues
- Claude Desktop Integration Issues
- Runtime Issues
- Network Issues
- Browser-Related Issues
- Performance Issues
- Security Issues
Installation Issues
Section titled “Installation Issues”Global Installation Permission Errors
Section titled “Global Installation Permission Errors”Problem: npm ERR! code EACCES
when running npm install -g puppeteer-mcp
Symptoms:
npm ERR! code EACCESnpm ERR! syscall accessnpm ERR! path /usr/local/lib/node_modulesnpm ERR! errno -13
Solutions:
-
Use npx instead (Recommended):
Terminal window # No installation needednpx puppeteer-mcp -
Fix npm permissions:
Terminal window # Create a directory for global packagesmkdir ~/.npm-global# Configure npm to use the new directorynpm config set prefix '~/.npm-global'# Add to PATH (bash)echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrcsource ~/.bashrc# For zsh usersecho 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrcsource ~/.zshrc# Now install without sudonpm install -g puppeteer-mcp -
Alternative: Change npm’s default directory:
Terminal window # Find npm's directorynpm config get prefix# Change ownership (replace USERNAME with your username)sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}# Install normallynpm install -g puppeteer-mcp
Verification:
# Check if installedpuppeteer-mcp --version
# Check installation locationwhich puppeteer-mcp
Missing Dependencies (Chrome/Chromium)
Section titled “Missing Dependencies (Chrome/Chromium)”Problem: Puppeteer can’t find or download Chrome/Chromium
Symptoms:
Error: Could not find expected browser
Failed to launch the browser process
- Download timeouts during installation
Solutions:
-
Let Puppeteer download Chromium automatically:
Terminal window # Clear npm cache firstnpm cache clean --force# Reinstall with fresh downloadnpm install -g puppeteer-mcp -
Install system Chrome/Chromium:
Ubuntu/Debian:
Terminal window sudo apt-get updatesudo apt-get install -y chromium-browser chromium-codecs-ffmpeg# Install additional dependencies# Note: On Ubuntu 24.04+, libasound2 is replaced by libasound2t64sudo apt-get install -y \libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 \libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 \libgbm1 libgtk-3-0 libasound2t64 || \sudo apt-get install -y \libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 \libxkbcommon0 libxcomposite1 libxdamage1 libxrandr2 \libgbm1 libgtk-3-0 libasound2CentOS/RHEL/Fedora:
Terminal window sudo yum install -y chromiumsudo yum install -y \alsa-lib atk cups-libs gtk3 libXcomposite libXdamage \libXrandr libgbm libxkbcommonmacOS:
Terminal window # Using Homebrewbrew install --cask chromiumWindows:
Terminal window # Download Chrome installer# https://www.google.com/chrome/# Or use Chocolateychoco install chromium -
Skip Chromium download and use system Chrome:
Terminal window # Set environment variablesexport PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=trueexport PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser# For Google Chromeexport PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable# Install without downloading Chromiumnpm install -g puppeteer-mcp
Verification:
# Check if Chrome/Chromium is availablechromium-browser --version# orgoogle-chrome --version
# Test puppeteer-mcp browser detectionpuppeteer-mcp --check-browser
Node.js Version Compatibility
Section titled “Node.js Version Compatibility”Problem: Package requires Node.js 20.0.0 or higher
Symptoms:
npm ERR! engine Unsupported enginenpm ERR! engine Not compatible with your version of node/npm
Solutions:
-
Check current Node.js version:
Terminal window node --version# Should output v20.0.0 or higher -
Update Node.js using nvm (Node Version Manager):
Terminal window # Install nvm (if not already installed)curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash# Reload shellsource ~/.bashrc# Install and use Node.js 20nvm install 20nvm use 20nvm alias default 20# Verifynode --version -
Update Node.js using package manager:
Ubuntu/Debian:
Terminal window # Add NodeSource repositorycurl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -sudo apt-get install -y nodejsmacOS:
Terminal window # Using Homebrewbrew updatebrew upgrade node
Verification:
node --version # Should be >= 20.0.0npm --version # Should be >= 8.0.0
npm Cache Issues
Section titled “npm Cache Issues”Problem: Installation fails due to corrupted npm cache
Symptoms:
npm ERR! Unexpected end of JSON input
npm ERR! sha512 integrity checksum failed
- Random installation failures
Solutions:
-
Clear npm cache:
Terminal window npm cache clean --force -
Delete node_modules and package-lock:
Terminal window rm -rf node_modules package-lock.jsonnpm install -
Use different npm registry:
Terminal window # Temporarily use different registrynpm install -g puppeteer-mcp --registry https://registry.npmjs.org/# Or set permanentlynpm config set registry https://registry.npmjs.org/
Verification:
# Check npm cache locationnpm config get cache
# Verify cache is cleannpm cache verify
CLI Command Issues
Section titled “CLI Command Issues”Command Not Found After Global Install
Section titled “Command Not Found After Global Install”Problem: puppeteer-mcp: command not found
after successful installation
Solutions:
-
Check if npm bin is in PATH:
Terminal window # Find npm global bin directorynpm config get prefix# Check if it's in PATHecho $PATH | grep $(npm config get prefix)/bin# If not found, add to PATHexport PATH="$(npm config get prefix)/bin:$PATH"# Make permanent (bash)echo 'export PATH="'$(npm config get prefix)'/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc -
Use full path:
Terminal window # Find installation pathnpm list -g puppeteer-mcp# Use full path to executable$(npm config get prefix)/bin/puppeteer-mcp -
Reinstall with correct prefix:
Terminal window # Set local prefixnpm config set prefix ~/.npm-global# Reinstallnpm install -g puppeteer-mcp# Update PATHexport PATH=~/.npm-global/bin:$PATH
Verification:
# Should show the executable pathwhich puppeteer-mcp
# Should run without errorspuppeteer-mcp --version
PATH Issues
Section titled “PATH Issues”Problem: Terminal can’t find puppeteer-mcp despite installation
Solutions by Platform:
macOS/Linux:
# Add npm global bin to PATHecho 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.bashrcsource ~/.bashrc
# For zsh (macOS default)echo 'export PATH="$(npm config get prefix)/bin:$PATH"' >> ~/.zshrcsource ~/.zshrc
Windows:
# Get npm prefixnpm config get prefix
# Add to PATH (run as Administrator)[Environment]::SetEnvironmentVariable( "Path", $env:Path + ";" + (npm config get prefix), [EnvironmentVariableTarget]::User)
# Restart terminal
Executable Permissions
Section titled “Executable Permissions”Problem: Permission denied when running puppeteer-mcp
Solutions:
-
Fix executable permissions:
Terminal window # Find the executablewhich puppeteer-mcp# Make it executablechmod +x $(which puppeteer-mcp) -
Check file ownership:
Terminal window # Check ownershipls -la $(which puppeteer-mcp)# Fix if neededsudo chown $(whoami) $(which puppeteer-mcp)
Claude Desktop Integration Issues
Section titled “Claude Desktop Integration Issues”Incorrect claude mcp add
Usage
Section titled “Incorrect claude mcp add Usage”Problem: claude mcp add
command fails or doesn’t work as expected
Common Mistakes:
- Using package name instead of executable command
- Missing required arguments
- Incorrect syntax
Correct Usage:
-
Using npx (Recommended):
Terminal window claude mcp add "npx puppeteer-mcp" -
Using global install:
Terminal window # If globally installedclaude mcp add "puppeteer-mcp"# With full path if neededclaude mcp add "/home/user/.npm-global/bin/puppeteer-mcp" -
With environment variables:
Terminal window claude mcp add "PUPPETEER_MCP_AUTH_TOKEN=your-token npx puppeteer-mcp"
Alternative: Manual Configuration:
If claude mcp add
doesn’t work, manually edit the config file:
Configuration File Location Problems
Section titled “Configuration File Location Problems”Problem: Can’t find Claude Desktop configuration file
File Locations by Platform:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Linux:
~/.config/claude/claude_desktop_config.json
Creating the Configuration:
-
Create directory if missing:
Terminal window # macOSmkdir -p ~/Library/Application\ Support/Claude# Windows (PowerShell)New-Item -ItemType Directory -Force -Path "$env:APPDATA\Claude"# Linuxmkdir -p ~/.config/claude -
Create config file:
{"mcpServers": {"puppeteer": {"command": "npx","args": ["puppeteer-mcp"],"env": {"PUPPETEER_MCP_AUTH_TOKEN": "your-secret-token-here"}}}} -
Set correct permissions:
Terminal window # macOS/Linuxchmod 600 ~/Library/Application\ Support/Claude/claude_desktop_config.json
MCP Server Not Starting
Section titled “MCP Server Not Starting”Problem: Claude Desktop doesn’t show puppeteer tools
Diagnostic Steps:
-
Test MCP server manually:
Terminal window # Run in terminal to see outputnpx puppeteer-mcp# Should show:# "MCP server started successfully"# "Transport type: stdio" -
Check Claude Desktop logs:
- macOS:
~/Library/Logs/Claude/
- Windows:
%LOCALAPPDATA%\Claude\logs\
- Linux:
~/.local/share/claude/logs/
- macOS:
-
Common fixes:
{"mcpServers": {"puppeteer": {"command": "npx","args": ["puppeteer-mcp"],"env": {"PUPPETEER_MCP_AUTH_TOKEN": "test-token","NODE_ENV": "production","LOG_LEVEL": "debug"}}}} -
Restart Claude Desktop:
- Completely quit Claude (not just close window)
- Start Claude again
- Check if “puppeteer” appears in available tools
Authentication Token Issues
Section titled “Authentication Token Issues”Problem: MCP server starts but authentication fails
Solutions:
-
Generate secure token:
Terminal window # Generate random tokennode -e "console.log(require('crypto').randomBytes(32).toString('hex'))" -
Set token in config:
{"mcpServers": {"puppeteer": {"command": "npx","args": ["puppeteer-mcp"],"env": {"PUPPETEER_MCP_AUTH_TOKEN": "your-generated-token-here"}}}} -
Test authentication:
Terminal window # Set token and testexport PUPPETEER_MCP_AUTH_TOKEN="your-token"npx puppeteer-mcp# In another terminal, test APIcurl -H "Authorization: Bearer your-token" http://localhost:8443/api/health
Runtime Issues
Section titled “Runtime Issues”Proto File Missing Errors
Section titled “Proto File Missing Errors”Problem: Error: Cannot find proto file
or similar gRPC-related errors
Solutions:
-
Check if proto files are included:
Terminal window # List package contentsnpm list -g puppeteer-mcpls -la $(npm root -g)/puppeteer-mcp/proto/ -
Reinstall to ensure all files:
Terminal window npm uninstall -g puppeteer-mcpnpm install -g puppeteer-mcp -
Use npx to avoid installation issues:
Terminal window npx puppeteer-mcp
Port Conflicts
Section titled “Port Conflicts”Problem: Error: listen EADDRINUSE: address already in use :::3000
Solutions:
-
Find what’s using the port:
Terminal window # macOS/Linuxlsof -i :3000# Windowsnetstat -ano | findstr :3000 -
Kill the process:
Terminal window # macOS/Linuxkill -9 $(lsof -t -i:3000)# Windows (using PID from netstat)taskkill /PID <PID> /F -
Use different ports:
Terminal window # Set custom portsPORT=3001 GRPC_PORT=50052 puppeteer-mcp# Or in configexport PORT=3001export GRPC_PORT=50052export WS_PORT=8081puppeteer-mcp
Browser Launch Failures
Section titled “Browser Launch Failures”Problem: Chrome/Chromium won’t start
Symptoms:
Failed to launch the browser process
No usable sandbox!
- Timeout errors
Solutions:
-
Add browser flags:
Terminal window export PUPPETEER_ARGS='["--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage"]'puppeteer-mcp -
Check system resources:
Terminal window # Check available memoryfree -h# Check disk spacedf -h# Limit browser instancesexport BROWSER_POOL_MAX_SIZE=2 -
Use headless mode:
Terminal window export PUPPETEER_HEADLESS=truepuppeteer-mcp
Memory Issues
Section titled “Memory Issues”Problem: High memory usage or out of memory errors
Solutions:
-
Increase Node.js memory limit:
Terminal window NODE_OPTIONS="--max-old-space-size=4096" puppeteer-mcp -
Reduce concurrent sessions:
Terminal window export MAX_SESSIONS=3export BROWSER_POOL_MAX_SIZE=2 -
Enable aggressive cleanup:
Terminal window export SESSION_TIMEOUT=300000 # 5 minutesexport BROWSER_IDLE_TIMEOUT=60000 # 1 minute
Network Issues
Section titled “Network Issues”Firewall Blocking Connections
Section titled “Firewall Blocking Connections”Problem: Can’t connect to puppeteer-mcp server
Solutions:
-
Check firewall rules:
Terminal window # Linux (ufw)sudo ufw statussudo ufw allow 3000/tcpsudo ufw allow 50051/tcpsudo ufw allow 8080/tcp# Windows Firewallnetsh advfirewall firewall add rule name="Puppeteer MCP" dir=in action=allow protocol=TCP localport=3000 -
Test local connectivity:
Terminal window # Should work locallycurl http://localhost:8443/api/health# Test from another machinecurl http://SERVER_IP:3000/api/health
Corporate Proxy Issues
Section titled “Corporate Proxy Issues”Problem: Can’t download packages or Chrome through corporate proxy
Solutions:
-
Configure npm proxy:
Terminal window npm config set proxy http://proxy.company.com:8080npm config set https-proxy http://proxy.company.com:8080 -
Set system proxy for Chrome download:
Terminal window export HTTP_PROXY=http://proxy.company.com:8080export HTTPS_PROXY=http://proxy.company.com:8080export NO_PROXY=localhost,127.0.0.1 -
Use pre-installed Chrome:
Terminal window export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=trueexport PUPPETEER_EXECUTABLE_PATH=/path/to/chrome
SSL Certificate Problems
Section titled “SSL Certificate Problems”Problem: SSL/TLS errors when downloading or connecting
Solutions:
-
Temporary: Disable strict SSL (not for production):
Terminal window npm config set strict-ssl false -
Add corporate certificates:
Terminal window # Export certificateexport NODE_EXTRA_CA_CERTS=/path/to/company-cert.pem# Or add to npmnpm config set cafile /path/to/company-cert.pem
Browser-Related Issues
Section titled “Browser-Related Issues”Sandbox Errors (Linux)
Section titled “Sandbox Errors (Linux)”Problem: No usable sandbox!
error on Linux
Solutions:
-
Enable user namespaces:
Terminal window # Check current settingcat /proc/sys/kernel/unprivileged_userns_clone# Enable (requires root)sudo sysctl -w kernel.unprivileged_userns_clone=1# Make permanentecho 'kernel.unprivileged_userns_clone=1' | sudo tee /etc/sysctl.d/00-local-userns.conf -
Run without sandbox (development only):
Terminal window export PUPPETEER_ARGS='["--no-sandbox", "--disable-setuid-sandbox"]'
Display Issues (Headless)
Section titled “Display Issues (Headless)”Problem: Screenshots or PDFs are blank or malformed
Solutions:
-
Wait for page load:
{"waitUntil": "networkidle2","timeout": 30000} -
Set viewport:
{"defaultViewport": {"width": 1920,"height": 1080}} -
Force headless mode:
Terminal window export PUPPETEER_HEADLESS=true
Performance Issues
Section titled “Performance Issues”Slow Startup
Section titled “Slow Startup”Problem: Server takes too long to start
Solutions:
-
Pre-install Chrome:
Terminal window export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=trueexport PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser -
Reduce initial pool size:
Terminal window export BROWSER_POOL_MIN_SIZE=0export BROWSER_POOL_MAX_SIZE=3
High CPU Usage
Section titled “High CPU Usage”Problem: Excessive CPU consumption
Solutions:
-
Limit concurrent operations:
Terminal window export MAX_CONCURRENT_SESSIONS=2export RATE_LIMIT_MAX_REQUESTS=50 -
Enable CPU throttling:
Terminal window export PUPPETEER_ARGS='["--disable-gpu", "--disable-software-rasterizer"]'
Security Issues
Section titled “Security Issues”Authentication Failures
Section titled “Authentication Failures”Problem: 401 Unauthorized errors
Solutions:
-
Check token format:
Terminal window # Should include "Bearer " prefixcurl -H "Authorization: Bearer your-token" http://localhost:8443/api/health -
Verify token matches:
Terminal window # Check server tokenecho $PUPPETEER_MCP_AUTH_TOKEN# Should match token in requests
CORS Errors
Section titled “CORS Errors”Problem: Cross-Origin Resource Sharing blocks requests
Solutions:
-
Configure CORS origin:
Terminal window export CORS_ORIGIN=http://localhost:3001# Or multiple originsexport CORS_ORIGIN='["http://localhost:3001", "https://app.example.com"]' -
Enable credentials:
{"cors": {"origin": "http://localhost:3001","credentials": true}}
Getting Further Help
Section titled “Getting Further Help”If these solutions don’t resolve your issue:
-
Check logs:
Terminal window # Enable debug loggingLOG_LEVEL=debug puppeteer-mcp# Check system logsjournalctl -u puppeteer-mcp # Linux with systemd -
Generate diagnostic report:
Terminal window puppeteer-mcp diagnostic --output report.json -
Search existing issues:
-
Create new issue with:
- Error message and stack trace
- Node.js and npm versions
- Operating system and version
- Steps to reproduce
- Diagnostic report
-
Community resources:
Remember to sanitize any sensitive information (tokens, internal URLs) before sharing logs or reports publicly.