Provides browser automation capabilities with tab pool management, enabling navigation, content extraction, screenshots, element interaction (clicking, typing), JavaScript evaluation, and selector waiting across multiple concurrent browser tabs.
Puppeteer Swarm MCP
MCP server for browser automation with tab pool support using Puppeteer.
Features
Explicit Browser Control: Launch and close browser on demand via
launch/closetoolsTab Pool: Manage multiple browser tabs concurrently
Auto-release: Automatically release tabs after idle timeout (default: 5 minutes)
Auto-recovery: Automatically recover crashed tabs
Configurable: Set tab count and headless mode via CLI arguments
Installation
Option 1: Install from npm
Or run directly using npx:
Option 2: Install from source
Usage
Environment Variables
MCP Client Integration
Puppeteer Swarm MCP can be integrated with various AI coding assistants and IDEs that support the Model Context Protocol (MCP).
Requirements
Node.js >= v18.0.0
An MCP-compatible client (Claude Code, Cursor, VS Code, Windsurf, etc.)
Run this command:
Or with custom options:
Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server
Add the following configuration to your ~/.cursor/mcp.json file:
Add the following to your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add this to your VS Code MCP config file. See VS Code MCP docs for more info.
Add this to your Windsurf MCP config file:
Open Cline
Click the hamburger menu icon (☰) to enter the MCP Servers section
Choose Remote Servers tab
Click the Edit Configuration button
Add puppeteer-swarm to
mcpServers:
Add this to your Zed settings.json:
Available Tools
launch
Initialize the browser and tab pool. Must be called before using any other browser tools.
Parameters: None
Returns:
close
Close the browser and all tabs.
Parameters: None
Returns:
get_pool_status
Get the current status of the tab pool. Can be called before launch to check initialization status.
Parameters: None
Returns (after launch):
Returns (before launch):
navigate
Allocate an idle tab and navigate to a URL.
Parameters:
Name | Type | Required | Description |
| string | Yes | URL to navigate to |
| string | No | Wait condition ( |
Returns:
get_content
Extract HTML or text content from a page.
Parameters:
Name | Type | Required | Description |
| string | Yes | Target tab ID |
| string | No | Extract format ( |
Returns:
screenshot
Capture a page screenshot.
Parameters:
Name | Type | Required | Description |
| string | Yes | Target tab ID |
| boolean | No | Capture full page. Default: |
Returns: Image content (base64 PNG)
click
Click an element by CSS selector.
Parameters:
Name | Type | Required | Description |
| string | Yes | Target tab ID |
| string | Yes | CSS selector |
Returns:
type
Type text into an input field.
Parameters:
Name | Type | Required | Description |
| string | Yes | Target tab ID |
| string | Yes | CSS selector |
| string | Yes | Text to type |
Returns:
evaluate
Execute JavaScript in the page context.
Parameters:
Name | Type | Required | Description |
| string | Yes | Target tab ID |
| string | Yes | JavaScript code to execute |
Returns:
wait_for_selector
Wait for an element to appear in the DOM.
Parameters:
Name | Type | Required | Description |
| string | Yes | Target tab ID |
| string | Yes | CSS selector |
| number | No | Timeout in ms. Default: |
Returns:
release_tab
Release a tab back to idle state.
Parameters:
Name | Type | Required | Description |
| string | Yes | Tab ID to release |
Returns:
Workflow Example
Note: The browser does not start automatically. You must call
launchbefore using any browser tools.
Logging
Logs are stored in the logs/ directory:
File Pattern:
mcp-puppeteer-YYYY-MM-DD.logDaily rotation, max 20MB per file
14 days retention with auto-compression
License
MIT License - see the LICENSE file for details.
Author
Choi Sumin - GitHub