Skip to content

Quick Reference

Fast access to essential information for Puppeteer MCP developers and users.

Quick API reference for all protocols:

  • REST endpoints summary
  • WebSocket events
  • gRPC methods
  • Common parameters
  • Response formats

Frequently used code patterns:

  • Authentication flows
  • Session management
  • Error handling
  • Browser automation
  • Resource cleanup

Complete environment configuration:

  • Required variables
  • Optional settings
  • Default values
  • Security considerations
  • Performance tuning

Comprehensive error reference:

  • Error code meanings
  • Common causes
  • Resolution steps
  • Prevention tips
  • Troubleshooting guide

Model Context Protocol tools:

  • Available tools list
  • Parameter reference
  • Usage examples
  • Integration patterns
  • Best practices
// REST
POST /api/sessions
{ "options": { "headless": true } }
// WebSocket
ws.send({ type: 'create_session', options: { headless: true } })
// gRPC
client.createSession({ options: { headless: true } })
// MCP
puppeteer_create_session({ headless: true })
// REST
POST /api/sessions/:id/navigate
{ "url": "https://example.com" }
// WebSocket
ws.send({ type: 'navigate', sessionId, url: 'https://example.com' })
// gRPC
client.navigate({ sessionId, url: 'https://example.com' })
// MCP
puppeteer_navigate({ sessionId, url: 'https://example.com' })
// REST
POST /api/sessions/:id/screenshot
{ "fullPage": true }
// WebSocket
ws.send({ type: 'screenshot', sessionId, fullPage: true })
// gRPC
client.screenshot({ sessionId, fullPage: true })
// MCP
puppeteer_screenshot({ sessionId, fullPage: true })
  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (missing/invalid auth)
  • 404 - Not Found (session/resource not found)
  • 429 - Too Many Requests (rate limited)
  • 500 - Internal Server Error
  • SESSION_NOT_FOUND - Invalid session ID
  • BROWSER_ERROR - Puppeteer operation failed
  • TIMEOUT_ERROR - Operation timed out
  • VALIDATION_ERROR - Invalid input parameters
  • AUTH_ERROR - Authentication failed
Terminal window
# Required
NODE_ENV=production
PORT=3000
JWT_SECRET=your-secret-key
# Recommended
SESSION_TIMEOUT=300000
MAX_SESSIONS=10
RATE_LIMIT=100
Terminal window
# Authentication
JWT_EXPIRES_IN=1h
API_KEY_HEADER=x-api-key
# Security Headers
CORS_ORIGIN=https://example.com
CSP_POLICY=default-src 'self'
  • Keep sessions alive with regular actions
  • Close sessions when done
  • Reuse sessions when possible
  • Monitor resource usage
  • Use headless mode in production
  • Disable unnecessary features
  • Implement proper timeouts
  • Clean up resources
Terminal window
DEBUG=* npm run dev # All debug
DEBUG=puppeteer:* npm run dev # Puppeteer only
DEBUG=mcp:* npm run dev # MCP only
Terminal window
npm run typecheck # Check TypeScript
npm run lint # Run ESLint
npm test # Run tests
npm run build # Build project
FeatureRESTWebSocketgRPCMCP
Real-time
Streaming
Type Safety
Browser Support
AI Integration

Pro Tip: Bookmark this page for quick access to essential information during development!