What is MCP Playwright Test?
MCP Playwright Test is a Model Context Protocol (MCP) server for Playwright test automation. It automatically fetches project code (from Git or local), sets up Playwright environments, generates test cases from requirements, executes UI and API tests, and captures network requests and console logs. It is designed for developers using AI tools like Claude Desktop and Cursor.
How to use MCP Playwright Test?
Install via npm/yarn/pnpm (npm install mcp-playwright-test). Set the required ANTHROPIC_API_KEY environment variable (for test case generation). Start the server with npm run start or npx ts-node src/test-mcp.ts. Configure via .playwright-mcp.json for integration with Claude Desktop and Cursor.
Key features of MCP Playwright Test
- Clones Git repositories or uses local projects for testing
- Launches browsers (Chromium, configurable) with headless mode
- Generates test cases from natural language requirements
- Executes both UI and API test suites
- Captures network requests and console logs
- Supports OpenAPI 3.0, Swagger 2.0, and Apifox API specs
- Provides test execution reports and test case resources
- Configurable via environment variables or
.playwright-mcp.json
Use cases of MCP Playwright Test
- Automatically generate and run UI tests for a frontend project
- Create API tests from an OpenAPI specification document
- Run combined UI and API regression tests with a single MCP server
- Integrate test automation into AI-assisted development workflows
コメント