Skip to content

API Reference

Complete API reference documentation for Puppeteer MCP’s multi-protocol interfaces.

RESTful HTTP API for browser automation:

  • Session management endpoints
  • Browser action endpoints
  • Authentication methods
  • Response formats
  • Error codes

High-performance gRPC service:

  • Protocol buffer definitions
  • Service methods
  • Streaming capabilities
  • Client examples
  • Performance considerations

Real-time WebSocket interface:

  • Connection management
  • Message protocols
  • Event subscriptions
  • Bidirectional communication
  • Connection lifecycle

Model Context Protocol tools for AI assistants:

  • Available tools listing
  • Parameter specifications
  • Response formats
  • Integration patterns
  • Claude Desktop usage

Comprehensive Puppeteer action reference:

  • Navigation methods
  • Interaction methods
  • Content methods
  • Wait strategies
  • Advanced options
  • Session Management: Create, list, and close browser sessions
  • Page Navigation: Navigate, reload, and manage history
  • Element Interaction: Click, type, select, and fill forms
  • Content Extraction: Screenshot, PDF, and JavaScript evaluation
  • Synchronization: Wait for elements and navigation
FeatureRESTWebSocketgRPCMCP
Request/Response
Streaming
Binary Data
Easy Integration⚠️
PerformanceGoodGoodBestGood
AI Assistant Support

All APIs use the same authentication token:

Terminal window
# REST API
Authorization: Bearer YOUR_TOKEN
# WebSocket
{ "type": "auth", "token": "YOUR_TOKEN" }
# gRPC (metadata)
authorization: Bearer YOUR_TOKEN
# MCP (environment)
PUPPETEER_MCP_AUTH_TOKEN=YOUR_TOKEN
// 1. Create session
const session = await createSession({ baseUrl: 'https://example.com' });
// 2. Perform actions
await navigate(session.id, { url: '/page' });
await click(session.id, { selector: '#button' });
// 3. Get results
const content = await getContent(session.id);
// 4. Clean up
await closeSession(session.id);
try {
const result = await browserAction(sessionId, params);
} catch (error) {
if (error.code === 'SESSION_NOT_FOUND') {
// Handle missing session
} else if (error.code === 'TIMEOUT') {
// Handle timeout
}
}
{
"success": true,
"data": {
// Response data
},
"metadata": {
"timestamp": "2025-01-05T10:00:00Z",
"duration": 123
}
}
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": {
// Additional error context
}
}
}

Default limits per authentication token:

APILimitWindow
REST100 requests15 minutes
WebSocket1000 messages15 minutes
gRPC1000 calls15 minutes
MCPNo limit-
Terminal window
curl -X POST http://localhost:8443/api/sessions \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"baseUrl": "https://example.com"}'
const ws = new WebSocket('ws://localhost:8443');
ws.send(JSON.stringify({ type: 'auth', token: 'YOUR_TOKEN' }));
const client = new BrowserAutomation('localhost:50051', credentials);
const session = await client.createSession({ baseUrl: 'https://example.com' });
Claude: "Navigate to example.com and take a screenshot"

Choose the right API for your use case:

  • REST API: Best for simple integrations, one-off requests
  • WebSocket: Best for real-time updates, event streaming
  • gRPC: Best for high-performance, microservices
  • MCP: Best for AI assistants, natural language control