mcp-playwright

MCP.Pizza Chef: executeautomation

The Playwright MCP Server is a Model Context Protocol server that integrates Playwright's powerful browser automation capabilities with LLM environments such as Claude Desktop, Cline, and Cursor IDE. It allows language models to interact with web pages in real-time, perform automated browsing tasks, take screenshots, generate test code, and scrape web content. This server facilitates seamless automation of browsers and APIs, enhancing AI-driven workflows by providing structured, actionable web context to models. It supports multi-platform usage and is ideal for developers looking to embed browser automation into AI-enhanced applications.

Use This MCP server To

Automate web browsing and navigation tasks Capture screenshots of web pages programmatically Generate automated test scripts from web interactions Scrape structured data from websites for analysis Integrate browser automation into AI workflows Control APIs and web services via automated scripts Enhance LLMs with real-time web context and interaction

README


Playwright MCP Server 🎭

smithery badge

A Model Context Protocol server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages, take screenshots, generate test code, web scraps the page and execute JavaScript in a real browser environment.

mcp-playwright MCP server

Screenshot

Playwright + Claude

Installation

You can install the package using either npm, mcp-get, or Smithery:

Using npm:

npm install -g @executeautomation/playwright-mcp-server

Using mcp-get:

npx @michaellatman/mcp-get@latest install @executeautomation/playwright-mcp-server

Using Smithery

To install Playwright MCP for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @executeautomation/playwright-mcp-server --client claude

Installation in VS Code

Install the Playwright MCP server in VS Code using one of these buttons:

Install in VS Code Insiders

Alternatively, you can install the Playwright MCP server using the VS Code CLI:

# For VS Code
code --add-mcp '{"name":"playwright","command":"npx","args":["@executeautomation/playwright-mcp-server"]}'
# For VS Code Insiders
code-insiders --add-mcp '{"name":"playwright","command":"npx","args":["@executeautomation/playwright-mcp-server"]}'

After installation, the ExecuteAutomation Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.

Configuration to use Playwright Server

Here's the Claude Desktop configuration to use the Playwright server:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "@executeautomation/playwright-mcp-server"]
    }
  }
}

Testing

This project uses Jest for testing. The tests are located in the src/__tests__ directory.

Running Tests

You can run the tests using one of the following commands:

# Run tests using the custom script (with coverage)
node run-tests.cjs

# Run tests using npm scripts
npm test           # Run tests without coverage
npm run test:coverage  # Run tests with coverage
npm run test:custom    # Run tests with custom script (same as node run-tests.cjs)

The test coverage report will be generated in the coverage directory.

Star History

Star History Chart

mcp-playwright FAQ

How do I install the Playwright MCP Server?
You can install it via npm or yarn from the official repository. Follow the GitHub README for detailed setup instructions.
Can the Playwright MCP Server work with multiple LLM platforms?
Yes, it is designed to integrate with various LLM hosts like Claude Desktop, Cline, and Cursor IDE, providing cross-platform browser automation.
Does the server support headless and headed browser modes?
Yes, Playwright MCP Server supports both headless and headed modes, allowing flexible automation depending on your needs.
How does the server handle authentication on websites?
It supports automated login flows by scripting interactions with login forms, cookies, and session management.
Can I customize the browser automation scripts?
Yes, you can extend and customize scripts to fit specific workflows or testing scenarios using Playwright's API.
Is it possible to capture screenshots and videos of browser sessions?
Yes, the server can capture screenshots and record videos during automated sessions for debugging or documentation.
How secure is the Playwright MCP Server when interacting with web content?
The server runs locally or in controlled environments, ensuring secure handling of credentials and data. It follows best practices for scoped and observable model interactions.
Does it support API automation alongside browser tasks?
Yes, it can automate API calls and integrate them with browser automation workflows for comprehensive testing and data extraction.