Quick Reference
Quick Reference
Section titled “Quick Reference”Fast access to essential information for Puppeteer MCP developers and users.
Reference Sheets
Section titled “Reference Sheets”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
Quick Links
Section titled “Quick Links”Most Used References
Section titled “Most Used References”By Protocol
Section titled “By Protocol”- REST: Endpoints | Authentication
- WebSocket: Events | Connection
- gRPC: Services | Client Setup
- MCP: Tools | Integration
Common Tasks Quick Reference
Section titled “Common Tasks Quick Reference”Starting a Session
Section titled “Starting a Session”// RESTPOST /api/sessions{ "options": { "headless": true } }
// WebSocketws.send({ type: 'create_session', options: { headless: true } })
// gRPCclient.createSession({ options: { headless: true } })
// MCPpuppeteer_create_session({ headless: true })
Navigating to URL
Section titled “Navigating to URL”// RESTPOST /api/sessions/:id/navigate{ "url": "https://example.com" }
// WebSocketws.send({ type: 'navigate', sessionId, url: 'https://example.com' })
// gRPCclient.navigate({ sessionId, url: 'https://example.com' })
// MCPpuppeteer_navigate({ sessionId, url: 'https://example.com' })
Taking Screenshot
Section titled “Taking Screenshot”// RESTPOST /api/sessions/:id/screenshot{ "fullPage": true }
// WebSocketws.send({ type: 'screenshot', sessionId, fullPage: true })
// gRPCclient.screenshot({ sessionId, fullPage: true })
// MCPpuppeteer_screenshot({ sessionId, fullPage: true })
Error Quick Reference
Section titled “Error Quick Reference”Common HTTP Status Codes
Section titled “Common HTTP Status Codes”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
Common Error Codes
Section titled “Common Error Codes”SESSION_NOT_FOUND
- Invalid session IDBROWSER_ERROR
- Puppeteer operation failedTIMEOUT_ERROR
- Operation timed outVALIDATION_ERROR
- Invalid input parametersAUTH_ERROR
- Authentication failed
Environment Variables Quick Reference
Section titled “Environment Variables Quick Reference”Essential Variables
Section titled “Essential Variables”# RequiredNODE_ENV=productionPORT=3000JWT_SECRET=your-secret-key
# RecommendedSESSION_TIMEOUT=300000MAX_SESSIONS=10RATE_LIMIT=100
Security Variables
Section titled “Security Variables”# AuthenticationJWT_EXPIRES_IN=1hAPI_KEY_HEADER=x-api-key
# Security HeadersCORS_ORIGIN=https://example.comCSP_POLICY=default-src 'self'
Performance Quick Tips
Section titled “Performance Quick Tips”Session Management
Section titled “Session Management”- Keep sessions alive with regular actions
- Close sessions when done
- Reuse sessions when possible
- Monitor resource usage
Browser Optimization
Section titled “Browser Optimization”- Use headless mode in production
- Disable unnecessary features
- Implement proper timeouts
- Clean up resources
Debugging Quick Reference
Section titled “Debugging Quick Reference”Enable Debug Logging
Section titled “Enable Debug Logging”DEBUG=* npm run dev # All debugDEBUG=puppeteer:* npm run dev # Puppeteer onlyDEBUG=mcp:* npm run dev # MCP only
Common Debug Commands
Section titled “Common Debug Commands”npm run typecheck # Check TypeScriptnpm run lint # Run ESLintnpm test # Run testsnpm run build # Build project
Protocol Comparison
Section titled “Protocol Comparison”Feature | REST | WebSocket | gRPC | MCP |
---|---|---|---|---|
Real-time | ❌ | ✅ | ❌ | ❌ |
Streaming | ❌ | ✅ | ✅ | ❌ |
Type Safety | ❌ | ❌ | ✅ | ✅ |
Browser Support | ✅ | ✅ | ❌ | ❌ |
AI Integration | ❌ | ❌ | ❌ | ✅ |
Need More Detail?
Section titled “Need More Detail?”Pro Tip: Bookmark this page for quick access to essential information during development!