Puppeteer

Browser automation

This MCP server provides browser automation capabilities through Puppeteer, allowing interaction with both new browser instances and existing Chrome windows.

Your AI app calls the Puppeteer MCP server, which does the browser automation work and sends the result back to the chat.

About Puppeteer

Puppeteer is a community MCP server from merajmehrabi, filed in our directory under browser automation. This MCP server provides browser automation capabilities through Puppeteer, allowing interaction with both new browser instances and existing Chrome windows.

Puppeteer runs on your own machine: your AI app starts it with the command npx -y puppeteer-mcp-server and talks to it over standard input and output.

The README for Puppeteer lists tools such as targetUrl, debugPort, selector and width, which your AI app can call once the server is connected.

At a glance

Publisher
merajmehrabi (community)
Runs
Locally on your machine
Install from
Node.js package on npm: puppeteer-mcp-server
Written in
TypeScript
License
MIT
GitHub stars
492

Tools Puppeteer gives your AI app

  • targetUrlURL of the specific tab to connect to.
  • debugPortChrome debugging port (default: 9222).
  • selectorCSS selector for element to screenshot.
  • widthWidth in pixels (default: 800).
  • heightHeight in pixels (default: 600).
  • valueText to enter.

Tool names as the Puppeteer README lists them. Your AI app shows the live list once Puppeteer is connected.

How to set up Puppeteer

  1. Install Node.js on the machine that runs your AI app, because Puppeteer starts with npx and downloads its package on first run.
  2. Check the Puppeteer README for keys or settings; the registry lists none that Puppeteer requires.
  3. Add Puppeteer to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Puppeteer tools to confirm the connection.
  5. Run one read-only task with Puppeteer first, such as a call to targetUrl, before you allow anything that writes or sends.

Puppeteer compared with similar servers

  • DrissionPage by jumodada has fewer GitHub stars than Puppeteer (483 against 492); both are community servers, and both run locally. The DrissionPage README lists 30 tools to Puppeteer's 6.
  • Web Agent Protocol by OTA-Tech-AI has more GitHub stars than Puppeteer (508 against 492); both are community servers, and both run locally.
  • Wexin Read by Bwkyd has fewer GitHub stars than Puppeteer (469 against 492); both are community servers, and both run locally.

Before you connect Puppeteer

  • Give Puppeteer its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Puppeteer tool call until you trust what it does with them.
  • Treat text that Puppeteer fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Puppeteer on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Puppeteer

How marketing and sales teams put Puppeteer to work, by company size. Pick the size closest to yours and start Puppeteer on one use case.

Small business

  • A small business can use Puppeteer to check its own site after every change: forms submit, links work and checkout still loads.
  • Owners can have Puppeteer collect competitor prices or offers from public pages once a week, instead of doing it by hand.
  • Puppeteer runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing teams can run Puppeteer to test landing pages and signup flows on every release, catching a broken form before paid traffic hits it.
  • Growth teams can use Puppeteer to capture screenshots of ads and pages across markets for reviews and audits.
  • Start with targetUrl and debugPort, the tools Puppeteer lists first, and add more once the team trusts the results.

Enterprise

  • Enterprises can run Puppeteer in isolated environments with allow-listed sites, so browsing agents never reach internal or unknown pages.
  • Large web teams can use Puppeteer for regression checks across many locales and devices, feeding results into release gates.
  • Puppeteer is a community server, so have security review the code and pin a version before Puppeteer touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Puppeteer README

From merajmehrabi/puppeteer-mcp-server on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

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.

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        # Documentation

Installation

Option 1: Install from npm
npm install -g puppeteer-mcp-server

You can also run it directly without installation using npx:

npx puppeteer-mcp-server
Option 2: Install from source
  1. Clone this repository or download the source code
  2. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Run the server:
npm start

MCP 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:

  1. Close any existing Chrome instances completely

  2. 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=9222
    
  3. Navigate to your desired webpage in Chrome

  4. Connect using the puppeteer_connect_active_tab tool:

    {
      "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 to
    • debugPort - 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 screenshot
  • Optional:
    • selector - CSS selector for element to screenshot
    • width - 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 field
    • value - Text to enter
puppeteer_select

Use dropdown menus.

  • Required:
    • selector - CSS selector for select element
    • value - 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/ directory
  • File Pattern: mcp-puppeteer-YYYY-MM-DD.log
  • Log 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.

Questions about Puppeteer

What is the Puppeteer MCP server?

This MCP server provides browser automation capabilities through Puppeteer, allowing interaction with both new browser instances and existing Chrome windows. Puppeteer is maintained by merajmehrabi on GitHub at merajmehrabi/puppeteer-mcp-server, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Puppeteer MCP server?

Add Puppeteer to your AI app's MCP config with the command npx -y puppeteer-mcp-server. In Claude Code, run claude mcp add --transport stdio puppeteer -- npx -y puppeteer-mcp-server. To run Puppeteer this way you need Node.js installed.

Does Puppeteer need an API key?

The registry lists no required keys for Puppeteer. Check the Puppeteer README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Puppeteer an official MCP server?

No. Puppeteer is a community server maintained by merajmehrabi. Community servers can be excellent; read the code and the open issues before you give Puppeteer access to company data.

What license is Puppeteer under?

Puppeteer is released under the MIT license, according to its GitHub repository. The license covers the code of Puppeteer; the service it connects to has its own terms.