Sandbox
@jaenster/puppeteer-mcp-claude

Puppeteer MCP server for Claude and other clients

This repo packages a browser automation MCP server around Puppeteer. Once connected, your agent can open pages, click, type, read text, run page JavaScript, capture screenshots, manage cookies, and block requests.

48 stars5 forksTypeScriptUpdated 4mo ago
Who it's for

Builders who want their agent to use a real browser for web tasks.

What it delivers

You can ask your agent to browse, scrape, test, and interact with websites without doing the browser work yourself.

What it does

Browser control tools

Provides `puppeteer_launch`, `puppeteer_new_page`, `puppeteer_navigate`, `puppeteer_click`, `puppeteer_type`, and `puppeteer_close_page`.

Page inspection and screenshots

Lets the agent read element text, run JavaScript in page context, wait for selectors, and capture PNG screenshots inline or on disk.

Session and cookie management

Includes tools to set, get, and delete cookies so login state can be reused across sessions.

Request interception

Can block resource types or inject headers before requests reach the page.

CLI install and runtime commands

Includes `install`, `uninstall`, `status`, `serve`, and `chrome` commands for setup and local use.

How to get it

  1. 1macOS / Linux
    curl -fsSL https://raw.githubusercontent.com/jaenster/puppeteer-mcp-claude/main/install.sh | bash
  2. 2Windows (PowerShell)
    iwr -useb https://raw.githubusercontent.com/jaenster/puppeteer-mcp-claude/main/install.ps1 | iex
  3. 3Manual — if you'd rather not run a remote script
    npm install -g puppeteer-mcp-claude
    claude mcp add puppeteer-mcp-claude -- npx -y puppeteer-mcp-claude serve

README

puppeteer-mcp-claude

puppeteer-mcp-claude — browser automation MCP server for Claude

npm version npm downloads CI Node License: MIT

A Model Context Protocol server that gives Claude Code (and any other MCP-aware client) a real browser via Puppeteer — navigate pages, click and type, run JavaScript, capture screenshots, manage cookies, intercept requests.

Requirements

  • Node.js ≥ 18
  • An MCP-aware client (Claude Code, Claude Desktop, Cursor, Codex CLI, …)
  • Chromium is downloaded automatically by Puppeteer on first install (~170 MB)

Install

macOS / Linux

curl -fsSL https://raw.githubusercontent.com/jaenster/puppeteer-mcp-claude/main/install.sh | bash

Windows (PowerShell)

iwr -useb https://raw.githubusercontent.com/jaenster/puppeteer-mcp-claude/main/install.ps1 | iex

Both scripts verify Node ≥ 18, install the package globally via npm, and register it with Claude Code at user scope. Override scope with SCOPE=project (bash) or $env:SCOPE='project' (PowerShell).

Manual — if you'd rather not run a remote script:

npm install -g puppeteer-mcp-claude
claude mcp add puppeteer-mcp-claude -- npx -y puppeteer-mcp-claude serve

Then restart Claude Code and ask: "Take a screenshot of example.com".

Tools

You don't have to call puppeteer_launch first — the browser auto-launches with defaults the moment any other tool runs. Page ids default to "default", so single-tab flows can omit pageId entirely.

ToolWhat it does
puppeteer_launch(Optional) launch a browser or connect to an existing Chrome via browserWSEndpoint. Use this for stealth mode, proxies, custom viewport, etc.
puppeteer_new_pageOpen a new tab.
puppeteer_navigateGo to a URL.
puppeteer_clickClick a CSS selector.
puppeteer_typeType into an input.
puppeteer_get_textRead textContent of an element.
puppeteer_screenshotCapture a PNG — returned inline as an MCP image block, optionally also saved to disk.
puppeteer_evaluateRun a JS expression in page context, returns the value.
puppeteer_wait_for_selectorWait until an element appears.
puppeteer_close_pageClose a tab.
puppeteer_close_browserClose the whole browser.
puppeteer_set_cookies / puppeteer_get_cookies / puppeteer_delete_cookiesCookie jar management.
puppeteer_set_request_interceptionBlock resources by type or inject request headers.

Response format

Every tool returns its result in two parallel forms:

  • content[0].textTOON (Token-Oriented Object Notation), a compact, schema-aware JSON alternative. Good for hosts that pipe the text body straight into the model's context.
  • structuredContent — the same data as a typed JSON object, for MCP clients that prefer machine-readable output.

Which one your host uses is up to the host — both are MCP-spec-compliant. Typed clients that want the object without depending on structuredContent can import { decode } from '@toon-format/toon' and parse content[0].text.

Examples

How an LLM would typically drive this server — each example shows the prompt you'd give Claude and the tool sequence it produces.

Take a screenshot of a site

"Take a screenshot of news.ycombinator.com."

puppeteer_navigate { url: "https://news.ycombinator.com" }
puppeteer_screenshot { fullPage: true }

Returns the PNG as an inline image block (Claude sees it directly), plus structured { bytes, path: null, fullPage: true }.

Scrape article titles

"Give me the titles of the top 10 stories on Hacker News as a markdown list."

puppeteer_navigate { url: "https://news.ycombinator.com" }
puppeteer_evaluate { script: "[...document.querySelectorAll('.titleline > a')].slice(0,10).map(a => a.textContent)" }

Claude formats the resulting array into the requested markdown list.

Fill a form

"On example.com, fill the search box with 'TOON' and submit."

puppeteer_navigate { url: "https://example.com" }
puppeteer_type   { selector: "input[name=q]", text: "TOON" }
puppeteer_click  { selector: "button[type=submit]" }
puppeteer_wait_for_selector { selector: ".results" }
puppeteer_get_text { selector: ".results h1" }

Reuse an existing logged-in browser

"Connect to my running Chrome and take a screenshot of the GitHub dashboard."

# In one terminal
puppeteer-mcp-claude chrome 9222
# Sign in to GitHub once in the launched Chrome window.
puppeteer_launch { browserWSEndpoint: "ws://localhost:9222" }
puppeteer_navigate { url: "https://github.com" }
puppeteer_screenshot {}

Avoids re-doing login flows in every session.

Block images for faster scraping

"Scrape the article text from as quickly as possible."

puppeteer_set_request_interception { enable: true, blockResources: ["image","media","font","stylesheet"] }
puppeteer_navigate { url: "<url>" }
puppeteer_get_text { selector: "article" }

CLI

puppeteer-mcp-claude install [--scope user|project|local]   Register with Claude Code
puppeteer-mcp-claude uninstall [--scope ...]                Remove from Claude Code
puppeteer-mcp-claude status                                 Show "claude mcp list"
puppeteer-mcp-claude serve                                  Run the MCP server on stdio
puppeteer-mcp-claude chrome [port] [userDataDir]            Launch Chrome with remote debugging
puppeteer-mcp-claude help                                   Show help

Development

pnpm install
pnpm build
pnpm test           # node:test via tsx, ~165 tests
pnpm dev            # run the server directly from src/

Other MCP servers I maintain

  • remote-shell-mcp — persistent SSH, SFTP, port forwarding, and Docker over MCP. Long-running daemon so sessions, tunnels, and PTY shells survive across Claude Code / Claude Desktop / Cursor / Codex CLI restarts.
  • node-debugger-mcp — real Node.js debugger over MCP. Breakpoints, stepping, scope inspection, eval, source-map-aware BPs, child-process and worker-thread auto-attach. Speaks the V8 Inspector Protocol.

Links

License

MIT

Files in the repo

Repository payload19 top-level entries
  • .github
  • bin
  • src
  • test-site
  • tests
  • .gitignore
  • .npmignore
  • CHANGELOG.md
  • CODE_OF_CONDUCT.md
  • CONTRIBUTING.md
  • install.ps1
  • install.sh
  • LICENSE
  • package.json
  • pnpm-lock.yaml
  • pnpm-workspace.yaml
  • README.md
  • SECURITY.md
  • tsconfig.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k