This MCP server provides browser automation capabilities through Puppeteer, allowing you to interact with both new browser instances and existing Chrome windows. It enables web navigation, taking screenshots, interacting with page elements, and executing JavaScript through the Model Context Protocol.
You can install the server globally:
npm install -g puppeteer-mcp-server
Or run it directly without installation:
npx puppeteer-mcp-server
npm install
npm run build
npm start
To use this server with Claude, add it to your MCP settings configuration file.
Add to your Claude Desktop configuration file:
{
"mcpServers": {
"puppeteer": {
"command": "puppeteer-mcp-server",
"args": [],
"env": {}
}
}
}
{
"mcpServers": {
"puppeteer": {
"command": "npx",
"args": ["-y", "puppeteer-mcp-server"],
"env": {}
}
}
}
{
"mcpServers": {
"puppeteer": {
"command": "node",
"args": ["path/to/puppeteer-mcp-server/dist/index.js"],
"env": {
"NODE_OPTIONS": "--experimental-modules"
}
}
}
}
Add similar configuration to your Claude VSCode extension MCP settings file, adjusting the command path as needed.
By default, the server launches a new browser instance for each session.
To connect to an existing Chrome window:
Close any existing Chrome instances completely
Launch Chrome with remote debugging enabled:
# Windows
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
# macOS
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
# Linux
google-chrome --remote-debugging-port=9222
Navigate to your desired webpage in Chrome
Connect using the puppeteer_connect_active_tab
tool:
{
"targetUrl": "https://example.com",
"debugPort": 9222
}
Connect to an existing Chrome instance with remote debugging enabled.
targetUrl
- URL of the specific tab to connect todebugPort
- Chrome debugging port (default: 9222)Navigate to a URL.
url
- The URL to navigate toTake a screenshot of the current page or a specific element.
name
- Name for the screenshotselector
- CSS selector for element to screenshotwidth
- Width in pixels (default: 800)height
- Height in pixels (default: 600)Click an element on the page.
selector
- CSS selector for element to clickFill out an input field.
selector
- CSS selector for input fieldvalue
- Text to enterUse dropdown menus.
selector
- CSS selector for select elementvalue
- Option value to selectHover over elements.
selector
- CSS selector for element to hoverExecute JavaScript in the browser console.
script
- JavaScript code to executeWhen using remote debugging:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.