MCP ConfigsApr 7, 2026·2 min read

Puppeteer MCP — Headless Chrome Server for AI Agents

MCP server wrapping Google Puppeteer for headless Chrome automation. Navigate pages, screenshot, generate PDFs, scrape SPAs, and test web apps through AI agent commands. 2,000+ stars.

TL;DR
MCP server that gives AI agents headless Chrome control via Puppeteer for screenshots, scraping, PDFs, and web testing.
§01

What it is

Puppeteer MCP is a Model Context Protocol server that wraps Google's Puppeteer library for headless Chrome automation. It gives AI agents the ability to navigate web pages, take screenshots, generate PDFs, scrape single-page applications, and run web tests through natural language commands. The agent controls a real Chrome browser instance programmatically.

The server targets developers who want their AI coding assistant to interact with web pages during development. Use cases include visual regression testing, data extraction from SPAs, PDF generation, and automated form testing.

§02

How it saves time or tokens

Puppeteer MCP removes the need to write Puppeteer scripts for one-off browser tasks. Instead of coding navigation sequences, element selectors, and screenshot logic, you describe the task to your AI agent. The agent translates your request into Puppeteer API calls, executes them, and returns the results. For visual QA and scraping tasks, this reduces a 20-line script to a single sentence.

§03

How to use

  1. Add the Puppeteer MCP server to your .mcp.json:
{
  "mcpServers": {
    "puppeteer": {
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-puppeteer"]
    }
  }
}
  1. Restart Claude Code to load the server.
  1. Ask the agent to perform browser tasks: 'Take a screenshot of https://tokrepo.com and describe the layout.'
§04

Example

Common automation tasks with Puppeteer MCP:

# Screenshot a page
'Take a full-page screenshot of https://example.com'

# Generate a PDF
'Generate a PDF of the pricing page at https://example.com/pricing'

# Scrape dynamic content
'Extract all product names and prices from https://store.example.com'

# Test a form
'Fill out the contact form at https://example.com/contact with test data and submit'

# Visual comparison
'Take screenshots of the homepage on mobile and desktop viewports'

The agent manages the browser lifecycle, element selection, and data extraction automatically.

§05

Related on TokRepo

§06

Common pitfalls

  • Headless Chrome requires Chromium to be installed. The npx command downloads it automatically, but this adds a significant first-run delay.
  • SPAs with lazy loading need explicit scroll or wait commands before content extraction. Tell the agent to 'scroll to the bottom and wait for all content to load.'
  • Some websites block headless browsers with bot detection. Puppeteer's headless mode can be detected by sophisticated anti-bot systems.
  • Always check the official documentation for the latest version-specific changes and migration guides before upgrading in production environments.

Frequently Asked Questions

What is the difference between Puppeteer MCP and Playwright MCP?+

Puppeteer MCP uses Google's Puppeteer library and is Chromium-only. Playwright MCP uses Microsoft's Playwright and supports Chromium, Firefox, and WebKit. Puppeteer is lighter weight; Playwright provides better cross-browser coverage.

Can Puppeteer MCP generate PDFs?+

Yes. The server can generate PDFs from any web page. This is useful for creating PDF exports of dashboards, reports, or documentation pages rendered in the browser.

Does Puppeteer MCP support mobile viewport emulation?+

Yes. You can ask the agent to emulate specific device viewports for responsive testing. This lets you take screenshots at mobile, tablet, and desktop sizes from a single command.

Can I scrape JavaScript-rendered content?+

Yes. Puppeteer runs a real Chrome browser, so it executes JavaScript fully. This makes it effective for scraping SPAs, dynamic content, and pages that require JavaScript for rendering.

Is the browser visible during automation?+

By default, Puppeteer runs in headless mode (no visible browser window). This is suitable for server environments and CI/CD. Headed mode can be configured for debugging if you need to see the browser.

Citations (3)
🙏

Source & Thanks

Built on Puppeteer by Google. Licensed under Apache 2.0.

puppeteer — stars 90,000+

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.