Automate Browser Interactions with Puppeteer
Official MCP server for browser automation via Puppeteer - navigate, click, fill, screenshot, and run JavaScript in a real browser.
1.0.0Add to Favorites
Why it matters
Leverage the Puppeteer MCP server to automate browser interactions, enabling AI models to navigate websites, extract data, and perform automated testing.
Outcomes
What it gets done
Navigate to specified URLs
Interact with web elements (click, fill, hover)
Capture screenshots of web pages or elements
Execute JavaScript within the browser context
Source
Get it from source
Spark does not host a copy of it.
Open sourceReports
Agent outcome reports
No reports yet
Capabilities
Tools your agent gets
Navigate to a URL in the browser.
Take a screenshot of the current page or specific element.
Click on an element identified by CSS selector.
Fill in a form field with text value.
Select an option from a dropdown menu.
Hover over an element on the page.
Execute JavaScript code in the page context.
Overview
Puppeteer MCP
An official MCP reference server exposing Puppeteer browser automation - navigation, element interaction, screenshots, and JavaScript execution - as MCP tools and resources. Use when an LLM needs to drive a real browser for scraping, testing, or screenshot capture; caution applies since it can reach local files and internal network addresses.
What it does
This official MCP reference server provides browser automation through Puppeteer, letting an LLM navigate web pages, take screenshots, click/fill/select/hover on elements, and execute JavaScript in a real browser environment. It also exposes two resource types: console://logs (browser console output) and screenshot://<name> (PNG images of captured screenshots).
When to use - and when NOT to
Use it when you want Claude to drive a real browser - navigating to a URL, interacting with page elements, capturing a screenshot (whole page or a specific element), or reading console output for debugging. This server can access local files and local/internal IP addresses since it runs a browser on the host machine - exercise caution that it doesn't expose sensitive data. Key features: browser automation, console-log monitoring, screenshot capture, JavaScript execution, and customizable Puppeteer launch options. This server is one of the official Model Context Protocol reference implementations, now maintained in the archived modelcontextprotocol/servers-archived repository and no longer receiving updates.
Capabilities
puppeteer_navigate(url, launchOptions?, allowDangerous?): navigate to a URL;launchOptionsrestarts the browser with custom Puppeteer launch options, andallowDangerous(default false) gates security-reducing args like--no-sandbox.puppeteer_screenshot(name, selector?, width?, height?, encoded?): capture the whole page or an element, at a configurable size (default 800x600), optionally as a base64 data URI instead of binary.puppeteer_click(selector),puppeteer_hover(selector),puppeteer_fill(selector, value),puppeteer_select(selector, value): basic element interaction.puppeteer_evaluate(script): execute JavaScript in the browser console.
How to install
Via npx (opens a visible browser window):
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}
Or via Docker (headless chromium, sets DOCKER_CONTAINER=true):
{
"mcpServers": {
"puppeteer": {
"command": "docker",
"args": ["run", "-i", "--rm", "--init", "-e", "DOCKER_CONTAINER=true", "mcp/puppeteer"]
}
}
}
To customize browser behavior, set PUPPETEER_LAUNCH_OPTIONS (a JSON-encoded Puppeteer launch-options string, e.g. a custom executablePath) and ALLOW_DANGEROUS in the server's env block, or pass launchOptions/allowDangerous directly on a puppeteer_navigate call - for example a custom executablePath pointing at a specific Chrome binary, or a defaultViewport size. The Docker image builds locally with docker build -t mcp/puppeteer -f src/puppeteer/Dockerfile .; the Docker variant always runs headless, while the npx variant opens a visible browser window. VS Code has one-click install buttons for both the npx and Docker variants, or manual setup via .vscode/mcp.json. The server itself is MIT-licensed.
Who it's for
Developers who want Claude to automate real browser interactions conversationally - navigating pages, filling forms, capturing screenshots, and reading console output for debugging.
Source README
Puppeteer
A Model Context Protocol server that provides browser automation capabilities using Puppeteer. This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment.
Components
Tools
puppeteer_navigate
- Navigate to any URL in the browser
- Inputs:
url(string, required): URL to navigate tolaunchOptions(object, optional): PuppeteerJS LaunchOptions. Default null. If changed and not null, browser restarts. Example:{ headless: true, args: ['--user-data-dir="C:/Data"'] }allowDangerous(boolean, optional): Allow dangerous LaunchOptions that reduce security. When false, dangerous args like--no-sandbox,--disable-web-securitywill throw errors. Default false.
puppeteer_screenshot
- Capture screenshots of the entire page or specific elements
- Inputs:
name(string, required): Name for the screenshotselector(string, optional): CSS selector for element to screenshotwidth(number, optional, default: 800): Screenshot widthheight(number, optional, default: 600): Screenshot heightencoded(boolean, optional): If true, capture the screenshot as a base64-encoded data URI (as text) instead of binary image content. Default false.
puppeteer_click
- Click elements on the page
- Input:
selector(string): CSS selector for element to click
puppeteer_hover
- Hover elements on the page
- Input:
selector(string): CSS selector for element to hover
puppeteer_fill
- Fill out input fields
- Inputs:
selector(string): CSS selector for input fieldvalue(string): Value to fill
puppeteer_select
- Select an element with SELECT tag
- Inputs:
selector(string): CSS selector for element to selectvalue(string): Value to select
puppeteer_evaluate
- Execute JavaScript in the browser console
- Input:
script(string): JavaScript code to execute
Resources
The server provides access to two types of resources:
Console Logs (
console://logs)- Browser console output in text format
- Includes all console messages from the browser
Screenshots (
screenshot://<name>)- PNG images of captured screenshots
- Accessible via the screenshot name specified during capture
Key Features
- Browser automation
- Console log monitoring
- Screenshot capabilities
- JavaScript execution
- Basic web interaction (navigation, clicking, form filling)
- Customizable Puppeteer launch options
Configuration to use Puppeteer Server
Usage with Claude Desktop
Here's the Claude Desktop configuration to use the Puppeter server:
Docker
NOTE The docker implementation will use headless chromium, where as the NPX version will open a browser window.
{
"mcpServers": {
"puppeteer": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--init",
"-e",
"DOCKER_CONTAINER=true",
"mcp/puppeteer"
]
}
}
}
NPX
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}
Usage with VS Code
For quick installation, use one of the one-click install buttons below...
For manual installation, add the following JSON block to your User Settings (JSON) file in VS Code. You can do this by pressing Ctrl + Shift + P and typing Preferences: Open User Settings (JSON).
Optionally, you can add it to a file called .vscode/mcp.json in your workspace. This will allow you to share the configuration with others.
Note that the
mcpkey is not needed in the.vscode/mcp.jsonfile.
For NPX installation (opens a browser window):
{
"mcp": {
"servers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}
}
For Docker installation (uses headless chromium):
{
"mcp": {
"servers": {
"puppeteer": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--init",
"-e",
"DOCKER_CONTAINER=true",
"mcp/puppeteer"
]
}
}
}
}
Launch Options
You can customize Puppeteer's browser behavior in two ways:
Environment Variable: Set
PUPPETEER_LAUNCH_OPTIONSwith a JSON-encoded string in the MCP configuration'senvparameter:{ "mcpServers": { "mcp-puppeteer": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-puppeteer"], "env": { "PUPPETEER_LAUNCH_OPTIONS": "{ \"headless\": false, \"executablePath\": \"C:/Program Files/Google/Chrome/Application/chrome.exe\", \"args\": [] }", "ALLOW_DANGEROUS": "true" } } } }Tool Call Arguments: Pass
launchOptionsandallowDangerousparameters to thepuppeteer_navigatetool:{ "url": "https://example.com", "launchOptions": { "headless": false, "defaultViewport": { "width": 1280, "height": 720 } } }
Build
Docker build:
docker build -t mcp/puppeteer -f src/puppeteer/Dockerfile .
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.