Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-playwright-cdp

MCP.Pizza Chef: lars-hagen

mcp-playwright-cdp is an MCP server that provides advanced browser automation using Playwright integrated with Chrome DevTools Protocol (CDP). It allows LLMs to interact with real web pages, execute JavaScript, take screenshots, and connect to existing Chrome instances for dynamic web interactions. This server extends Playwright capabilities by supporting CDP, enabling richer control over browser sessions in real-time environments.

Use This MCP server To

Automate web page interactions using Playwright and CDP Execute JavaScript in real browser contexts Take screenshots of web pages programmatically Connect to and control existing Chrome instances via CDP Enable LLMs to perform dynamic web automation tasks Integrate browser automation into AI workflows Test web applications with real browser environments Capture web page states for analysis or reporting

README

MCP Playwright CDP

smithery badge

License: MIT

A Model Context Protocol server that provides browser automation capabilities using Playwright with Chrome DevTools Protocol (CDP) support. This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment, with the ability to connect to existing Chrome instances via CDP.

This is a fork of executeautomation/mcp-playwright v0.2.7, enhanced with CDP support for connecting to running Chrome instances.

Playwright CDP MCP server

Key Features

  • 🔗 Connect to existing Chrome instances via CDP
  • 🌐 Full browser automation capabilities
  • 📸 Screenshot capture of entire pages or specific elements
  • 🖱️ Comprehensive web interactions (navigation, clicking, form filling)
  • 📊 Console log monitoring
  • 🔧 JavaScript execution in browser context
  • 🌍 HTTP API testing support

Installation

You can install the package using either npm or Smithery:

Installing via Smithery

To install MCP Playwright CDP for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @lars-hagen/mcp-playwright-cdp --client claude

Manual Installation

Using npm:

npm install

Configuration

Add this to your Claude Desktop configuration file:

{
  "mcpServers": {
    "playwright": {
      "command": "node",
      "args": ["/path/to/mcp-playwright/dist/index.js"]
    }
  }
}

Replace /path/to/mcp-playwright with your actual path to the repository.

CDP Connection

This fork adds the ability to connect to an existing Chrome instance via CDP. To use this feature:

  1. Launch Chrome with remote debugging enabled:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
  1. The server will automatically attempt to connect to the running Chrome instance first, before launching a new browser.

Credits

This project is a fork of executeautomation/mcp-playwright, enhanced with CDP support for connecting to running Chrome instances.

License

This project is licensed under the MIT License - see the LICENSE file for details.

mcp-playwright-cdp FAQ

How does mcp-playwright-cdp connect to existing Chrome instances?
It uses the Chrome DevTools Protocol (CDP) to attach to running Chrome browsers, enabling real-time control and interaction.
Can mcp-playwright-cdp execute JavaScript on web pages?
Yes, it allows execution of arbitrary JavaScript within the context of the loaded web page.
What advantages does CDP support provide over standard Playwright?
CDP support enables connection to existing browser instances and deeper control over browser internals beyond standard Playwright APIs.
Is mcp-playwright-cdp compatible with all browsers?
It primarily supports Chromium-based browsers that expose the Chrome DevTools Protocol, such as Google Chrome and Microsoft Edge.
How can I capture screenshots using this MCP server?
The server provides APIs to take screenshots of the current web page or specific elements programmatically.
What security considerations are there when using mcp-playwright-cdp?
Since it controls real browsers, ensure secure environments and restrict access to trusted users to prevent misuse.
Can this server be integrated with multiple LLM providers?
Yes, it is provider-agnostic and can work with OpenAI, Anthropic Claude, and Google Gemini models.
How do I start using mcp-playwright-cdp in my MCP client?
You can connect to the server via its API endpoints and send commands to automate browser tasks and retrieve results.