Puppeteer MCP Server

Puppeteer MCP Server

Enables AI agents to automate browser interactions including navigation, content extraction, form filling, screenshots, and JavaScript execution across multiple tabs using Puppeteer.

Category
Visit Server

README

Puppeteer MCP Server

A Model Context Protocol (MCP) server that provides browser automation capabilities through Puppeteer. This server enables AI agents to interact with web pages, take screenshots, execute JavaScript, and perform various browser operations.

Features

  • Multi-tab Support: Manage multiple browser tabs with unique IDs
  • Comprehensive Tools: 27 tools for navigation, interaction, content extraction, and more
  • Dual Transport: Supports both stdio (for Claude Desktop/Code) and HTTP transports
  • Result Types: Consistent error handling with structured Result types

Installation

npm install
npm run build

Usage

Stdio Mode (Default)

For use with Claude Desktop or Claude Code:

npm start
# or
node dist/index.js

HTTP Mode

For remote or containerized deployments:

npm start -- --http
# or
node dist/index.js --http --port=3000

Claude Desktop Configuration

Add to your Claude Desktop config:

{
  "mcpServers": {
    "puppeteer": {
      "command": "node",
      "args": ["/path/to/puppeteer-mcp/dist/index.js"]
    }
  }
}

Available Tools

Tab Management

Tool Description
list_tabs List all open browser tabs
new_tab Create a new tab (optionally with URL)
close_tab Close a tab
switch_tab Switch to a different tab

Navigation

Tool Description
navigate Navigate to a URL
reload Reload the current page
go_back Navigate back in history
go_forward Navigate forward in history

Interaction

Tool Description
click Click an element
fill Fill a text input
select Select dropdown option(s)
hover Hover over an element
focus Focus an element

Input

Tool Description
keyboard Press keyboard keys
mouse Perform mouse actions
scroll Scroll the page or element

Content

Tool Description
evaluate Execute JavaScript
get_content Get page/element HTML or text
query_selector Get element information

Waiting

Tool Description
wait_for_selector Wait for element to appear
wait_for_navigation Wait for navigation
wait Wait for specified time

Media

Tool Description
screenshot Capture screenshot
pdf Generate PDF

Cookies

Tool Description
get_cookies Get cookies
set_cookies Set cookies
delete_cookies Delete cookies

Tool Parameters

All tools that operate on pages accept an optional tabId parameter. If not specified, the active tab is used.

Example: Navigate and Take Screenshot

// Navigate
{ "name": "navigate", "arguments": { "url": "https://example.com" } }

// Take screenshot
{ "name": "screenshot", "arguments": { "fullPage": true, "format": "png" } }

Example: Multi-tab Workflow

// Create new tab
{ "name": "new_tab", "arguments": { "url": "https://site-a.com" } }
// Returns: { "id": "tab_abc123", "url": "https://site-a.com", ... }

// Create another tab
{ "name": "new_tab", "arguments": { "url": "https://site-b.com" } }
// Returns: { "id": "tab_def456", "url": "https://site-b.com", ... }

// List all tabs
{ "name": "list_tabs", "arguments": {} }

// Interact with specific tab
{ "name": "click", "arguments": { "selector": "button", "tabId": "tab_abc123" } }

Environment Variables

Variable Description Default
PORT HTTP server port 3000
HEADLESS Run browser headless true
TIMEOUT Default operation timeout (ms) 30000

Development

# Install dependencies
npm install

# Run in development mode
npm run dev

# Type check
npm run typecheck

# Run tests
npm test

# Build
npm run build

Architecture

src/
├── index.ts          # Entry point, transport setup
├── server.ts         # MCP server configuration
├── browser.ts        # Browser lifecycle management
├── tabs.ts           # Multi-tab state management
├── types.ts          # TypeScript interfaces
├── errors.ts         # Result types and error handling
├── schemas.ts        # Zod validation schemas
└── tools/
    ├── tab-tools.ts      # Tab management tools
    ├── navigation.ts     # Navigation tools
    ├── interaction.ts    # Click, fill, select, etc.
    ├── content.ts        # Evaluate, get content
    ├── waiting.ts        # Wait tools
    ├── media.ts          # Screenshot, PDF
    ├── cookies.ts        # Cookie management
    └── input.ts          # Keyboard, mouse, scroll

License

MIT

puppeteer-mcp

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured