Playwright MCP Server 🎭
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.
Screenshot
Documentation | API reference
Installation
You can install the package using either npm, mcp-get, or Smithery:
Using npm:
1npm install -g @executeautomation/playwright-mcp-server
Using mcp-get:
1npx @michaellatman/mcp-get@latest install @executeautomation/playwright-mcp-server
Using Smithery
To install Playwright MCP for Claude Desktop automatically via Smithery:
1npx -y @smithery/cli install @executeautomation/playwright-mcp-server --client claude
Configuration to use Playwright Server
Here's the Claude Desktop configuration to use the Playwright server:
1{ 2 "mcpServers": { 3 "playwright": { 4 "command": "npx", 5 "args": ["-y", "@executeautomation/playwright-mcp-server"] 6 } 7 } 8}
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:
1# Run tests using the custom script (with coverage) 2node run-tests.cjs 3 4# Run tests using npm scripts 5npm test # Run tests without coverage 6npm run test:coverage # Run tests with coverage 7npm 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.