trackmcp
Back to directory

Puppeteer MCP

0 stars TypeScriptOthers Updated Jan 11, 2026

Documentation

pptr-mcp

MCP server for browser automation via Puppeteer. Unlike other browser MCPs that expose fixed tools (navigate, click, screenshot), this server executes arbitrary JavaScript code with direct access to the Puppeteer Browser instance.

Key Difference

Most browser MCP servers provide a limited set of predefined actions. This approach requires multiple round-trips for complex workflows and can't handle edge cases.

pptr-mcp takes a different approach: it exposes a single `execute` tool that runs your JavaScript code in a Node.js VM with a `browser` global. You write Puppeteer code directly, getting full API access in one call.

code
Traditional MCP (5 round-trips)         pptr-mcp (1 round-trip)
================================        ================================

  Agent           Server                  Agent           Server
    |                |                      |                |
    |-- navigate --->|                      |-- execute ---->|
    ||                      |   | const page = await     |
    ||                      |   | await page.click(s);   |
    ||                      |   |   page.screenshot();   |
    ||                      |= 20

## Installation

npm install -g pptr-mcp

code
## MCP Configuration

Add to your MCP client config (e.g., Claude Desktop):

{

"mcpServers": {

"puppeteer": {

"command": "npx",

"args": ["pptr-mcp"]

}

}

}

code
With CLI options:

{

"mcpServers": {

"puppeteer": {

"command": "npx",

"args": ["pptr-mcp", "--no-headless", "--viewport=1080p"]

}

}

}

code
With custom Chrome flags (after `--`):

{

"mcpServers": {

"puppeteer": {

"command": "npx",

"args": [

"pptr-mcp",

"--viewport=1280x720",

"--",

"--proxy-server=http://proxy:8080"

]

}

}

}

code
## CLI Options

| Option             | Description                                  |
| ------------------ | -------------------------------------------- |
| `--no-headless`    | Run with visible browser window              |
| `--viewport=VALUE` | Set viewport size (e.g., 1920x1080 or 1080p) |
| `--help, -h`       | Show help                                    |
| `-- [args]`        | Pass remaining args to Chrome                |

Unknown options before `--` are also passed to Chrome.

## Claude Code Plugin

Install as a Claude Code plugin:

/plugin marketplace add iatsiuk/pptr-mcp

/plugin install pptr-mcp@pptr-mcp

code
## Environment Variables

| Variable                    | Description                              |
| --------------------------- | ---------------------------------------- |
| `CHROME_PATH`               | Path to Chrome executable                |
| `PUPPETEER_EXECUTABLE_PATH` | Alternative to CHROME_PATH               |
| `PUPPETEER_CACHE_DIR`       | Browser download cache directory         |
| `PPTR_MCP_TIMEOUT`          | Execution timeout in ms (default: 30000) |

## Tool: execute

Executes JavaScript code with access to Puppeteer browser.

### Parameters

| Name         | Type    | Default  | Description                        |
| ------------ | ------- | -------- | ---------------------------------- |
| `code`       | string  | required | JavaScript code to execute         |
| `persistent` | boolean | true     | Reuse browser session across calls |

## Recipes

### Disable headless mode

Show browser window during execution:

{

"mcpServers": {

"puppeteer": {

"command": "npx",

"args": ["pptr-mcp", "--no-headless"]

}

}

}

code
### Custom Chrome profile directory

Use your own Chrome profile with saved logins and cookies:

{

"mcpServers": {

"puppeteer": {

"command": "npx",

"args": ["pptr-mcp", "--", "--user-data-dir=/path/to/profile"]

}

}

}

code
### Use system Chrome instead of downloaded

By default, pptr-mcp downloads Chrome for Testing - a version optimized and tested for the bundled Puppeteer. To use your system Chrome instead:

{

"mcpServers": {

"puppeteer": {

"command": "npx",

"args": ["pptr-mcp"],

"env": {

"CHROME_PATH": "/path/to/chrome"

}

}

}

}

code
## Security

This server is designed for **trusted local development** with LLM assistants (Claude Code, Cursor, etc.). The executing code comes from the LLM at your request.

### What this means

- **Not a sandbox**: The Node.js VM isolates code for convenience, not security. It is not designed to run untrusted code.
- **Full browser control**: Executed code can navigate to any URL, read page content, take screenshots, and interact with web applications.
- **Chrome runs without sandbox**: `--no-sandbox` flag is used for Docker/container compatibility.
- **Persistent sessions**: With `persistent: true` (default), cookies and browser state are preserved across calls. Use `persistent: false` for isolation.

### Not designed for

- Multi-tenant or shared server deployments
- Executing untrusted code from external sources
- Building web services that accept arbitrary user input

## License

[WTFPL](LICENSE.md)

Frequently asked questions

What is pptr-mcp?

pptr-mcp is Puppeteer MCP

How do I install pptr-mcp?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is pptr-mcp open source?

Yes — it is hosted on GitHub at https://github.com/iatsiuk/pptr-mcp.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP