This repository hosts a Model Context Protocol (MCP) server leveraging Playwright for browser automation, enabling LLMs to interact with web pages and execute JavaScript. It supports tasks like screenshot capture
The Playwright MCP Server empowers Large Language Models (LLMs) with browser automation capabilities using Playwright. It enables LLMs to interact with web pages, capture screenshots, generate test code, scrape web content, and execute JavaScript within a real browser environment.
<a href="https://glama.ai/mcp/servers/yh4lgtwgbe"><img width="380" height="200" src="https://glama.ai/mcp/servers/yh4lgtwgbe/badge" alt="mcp-playwright MCP server" /></a>
Installation is supported via 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
Configuration example for Claude Desktop:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@executeautomation/playwright-mcp-server"]
}
}
}
Jest is used for testing, with tests located in the src/__tests__
directory.
Tests can be executed using:
# 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)
Coverage reports are generated in the coverage
directory.
executeautomation/mcp-playwright
December 3, 2024
March 28, 2025
TypeScript