Puppeteer MCP Server
The Puppeteer MCP Server provides browser automation capabilities through Puppeteer, allowing you to:
Connect to existing Chrome: Connect to active Chrome instances with remote debugging enabled
Navigate web pages: Automate browser navigation to specific URLs
Capture screenshots: Take screenshots of entire pages or specific elements
Interact with elements: Click, fill input fields, select dropdown options, and hover over elements
Execute JavaScript: Run custom JavaScript code in the browser console
Manage connections: Intelligently handle Chrome tab connections while preserving the browser instance
Detailed logging: Access comprehensive logging and error handling for all operations
The server offers configuration flexibility and can be used globally via npm, through npx, or installed from source.
This is a MCP server implementation that provides browser automation capabilities through Puppeteer, enabling various web interactions including navigation, screenshots, clicking elements, filling forms, and executing JavaScript in browser contexts.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Puppeteer MCP Server take a screenshot of the homepage and save it as screenshot.png"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Puppeteer MCP Server
This MCP server provides browser automation capabilities through Puppeteer, allowing interaction with both new browser instances and existing Chrome windows.
Acknowledgment
This project is an experimental implementation inspired by @modelcontextprotocol/server-puppeteer. While it shares similar goals and concepts, it explores alternative approaches to browser automation through the Model Context Protocol.
Related MCP server: Puppeteer MCP Server
Features
Navigate web pages
Take screenshots
Click elements
Fill forms
Select options
Hover elements
Execute JavaScript
Smart Chrome tab management:
Connect to active Chrome tabs
Preserve existing Chrome instances
Intelligent connection handling
Project Structure
/
├── src/
│ ├── config/ # Configuration modules
│ ├── tools/ # Tool definitions and handlers
│ ├── browser/ # Browser connection management
│ ├── types/ # TypeScript type definitions
│ ├── resources/ # Resource handlers
│ └── server.ts # Server initialization
├── index.ts # Entry point
└── README.md # DocumentationInstallation
Option 1: Install from npm
npm install -g puppeteer-mcp-serverYou can also run it directly without installation using npx:
npx puppeteer-mcp-serverOption 2: Install from source
Clone this repository or download the source code
Install dependencies:
npm installBuild the project:
npm run buildRun the server:
npm startMCP Server Configuration
To use this tool with Claude, you need to add it to your MCP settings configuration file.
For Claude Desktop App
Add the following to your Claude Desktop configuration file (located at %APPDATA%\Claude\claude_desktop_config.json on Windows or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
If installed globally via npm:
{
"mcpServers": {
"puppeteer": {
"command": "puppeteer-mcp-server",
"args": [],
"env": {}
}
}
}Using npx (without installation):
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "puppeteer-mcp-server"],
"env": {}
}
}
}If installed from source:
{
"mcpServers": {
"puppeteer": {
"command": "node",
"args": ["path/to/puppeteer-mcp-server/dist/index.js"],
"env": {
"NODE_OPTIONS": "--experimental-modules"
}
}
}
}For Claude VSCode Extension
Add the following to your Claude VSCode extension MCP settings file (located at %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json on Windows or ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json on macOS):
If installed globally via npm:
{
"mcpServers": {
"puppeteer": {
"command": "puppeteer-mcp-server",
"args": [],
"env": {}
}
}
}Using npx (without installation):
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "puppeteer-mcp-server"],
"env": {}
}
}
}If installed from source:
{
"mcpServers": {
"puppeteer": {
"command": "node",
"args": ["path/to/puppeteer-mcp-server/dist/index.js"],
"env": {
"NODE_OPTIONS": "--experimental-modules"
}
}
}
}For source installation, replace path/to/puppeteer-mcp-server with the actual path to where you installed this tool.
Usage
Standard Mode
The server will launch a new browser instance by default.
Active Tab Mode
To connect to an existing Chrome window:
Close any existing Chrome instances completely
Launch Chrome with remote debugging enabled:
# Windows "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 # macOS /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 # Linux google-chrome --remote-debugging-port=9222Navigate to your desired webpage in Chrome
Connect using the
puppeteer_connect_active_tabtool:{ "targetUrl": "https://example.com", // Optional: specific tab URL "debugPort": 9222 // Optional: defaults to 9222 }
The server will:
Detect and connect to the Chrome instance running with remote debugging enabled
Preserve your Chrome instance (won't close it)
Find and connect to non-extension tabs
Provide clear error messages if connection fails
Available Tools
puppeteer_connect_active_tab
Connect to an existing Chrome instance with remote debugging enabled.
Optional:
targetUrl- URL of the specific tab to connect todebugPort- Chrome debugging port (default: 9222)
puppeteer_navigate
Navigate to a URL.
Required:
url- The URL to navigate to
puppeteer_screenshot
Take a screenshot of the current page or a specific element.
Required:
name- Name for the screenshotOptional:
selector- CSS selector for element to screenshotwidth- Width in pixels (default: 800)height- Height in pixels (default: 600)
puppeteer_click
Click an element on the page.
Required:
selector- CSS selector for element to click
puppeteer_fill
Fill out an input field.
Required:
selector- CSS selector for input fieldvalue- Text to enter
puppeteer_select
Use dropdown menus.
Required:
selector- CSS selector for select elementvalue- Option value to select
puppeteer_hover
Hover over elements.
Required:
selector- CSS selector for element to hover
puppeteer_evaluate
Execute JavaScript in the browser console.
Required:
script- JavaScript code to execute
Security Considerations
When using remote debugging:
Only enable on trusted networks
Use a unique debugging port
Close debugging port when not in use
Never expose debugging port to public networks
Logging and Debugging
File-based Logging
The server implements comprehensive logging using Winston:
Location:
logs/directoryFile Pattern:
mcp-puppeteer-YYYY-MM-DD.logLog Rotation:
Daily rotation
Maximum size: 20MB per file
Retention: 14 days
Automatic compression of old logs
Log Levels
DEBUG: Detailed debugging information
INFO: General operational information
WARN: Warning messages
ERROR: Error events and exceptions
Logged Information
Server startup/shutdown events
Browser operations (launch, connect, close)
Navigation attempts and results
Tool executions and outcomes
Error details with stack traces
Browser console output
Resource usage (screenshots, console logs)
Error Handling
The server provides detailed error messages for:
Connection failures
Missing elements
Invalid selectors
JavaScript execution errors
Screenshot failures
Each tool call returns:
Success/failure status
Detailed error message if failed
Operation result data if successful
All errors are also logged to the log files with:
Timestamp
Error message
Stack trace (when available)
Context information
Contributing
Contributions are welcome! Please read our Contributing Guidelines for details on how to submit pull requests, report issues, and contribute to the project.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Available Tools
8 toolspuppeteer_clickC
Click an element on the page
Inputs: selector (required).
puppeteer_connect_active_tabB
Connect to an existing Chrome instance with remote debugging enabled
Inputs: targetUrl, debugPort.
puppeteer_evaluateB
Execute JavaScript in the browser console
Inputs: script (required).
puppeteer_fillC
Fill out an input field
Inputs: selector (required), value (required).
puppeteer_hoverC
Hover an element on the page
Inputs: selector (required).
puppeteer_screenshotB
Take a screenshot of the current page or a specific element
Inputs: name (required), selector, width, height.
puppeteer_selectC
Select an element on the page with Select tag
Inputs: selector (required), value (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct browser action (click, navigate, fill, hover, etc.) with no overlap, making selection unambiguous.
All tools follow a consistent pattern: 'puppeteer_' prefix followed by a clear action verb, ensuring predictability.
With 8 tools covering essential browser interactions, the count is well-scoped for a focused automation server.
Core operations are covered, but missing explicit waiting or content extraction tools; however, puppeteer_evaluate can compensate.
Maintenance
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Browser agents and stealth cloud browsers for AI: run web tasks, fill forms, extract data.
Stealth web automation for AI agents. Login, signup, navigate, screenshot.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI coding assistants to control and inspect a live Chrome browser through DevTools for automated testing, performance analysis, debugging, and web scraping. Provides reliable browser automation using Puppeteer with comprehensive DevTools access.2,099,626 npm3Apache 2.0
- AlicenseBqualityDmaintenanceEnables AI agents to automate browser interactions including navigation, content extraction, form filling, screenshots, and JavaScript execution across multiple tabs using Puppeteer.2765 npm1MIT
- AlicenseAqualityDmaintenanceEnables browser automation with concurrent tab pool management using Puppeteer. Supports navigation, content extraction, screenshots, element interaction, and JavaScript execution across multiple browser tabs with auto-recovery and idle timeout features.1113 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to perform browser automation including web navigation, element interaction, and screenshot capture using Puppeteer. It provides capabilities for executing JavaScript in the browser and monitoring console logs for debugging and data extraction.28,579 npmMIT