MCP Playwright Test
@w1561778301
About MCP Playwright Test
A Model Context Protocol (MCP) server for automating Playwright tests
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-playwright-test": {
"command": "npx",
"args": [
"ts-node",
"src/test-mcp.ts"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
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
FAQ from MCP Playwright Test
What environment variables are required?
At minimum, ANTHROPIC_API_KEY must be set to generate test cases. Optional variables include MCP_PORT (default 8931), CODE_PATH, SIMPLE_GIT_* (for remote repos), API_URL, API_KEY, BROWSER_TYPE (default chromium), BROWSER_HEADLESS (default true), and TEST_STORAGE_DIR (default ./test-results).
What testing modes are supported?
Three modes: UI testing only, API testing only, or both UI and API testing simultaneously. Configure the relevant environment variables accordingly.
How to configure for Claude Desktop or Cursor?
Create a .playwright-mcp.json file in your project root with the MCP server definition. Then add the configuration in Claude Desktop or Cursor’s MCP settings, selecting the server name as defined in the file.
Which API specification formats are supported?
OpenAPI 3.0, Swagger 2.0, and Apifox. The server automatically detects the format, or you can specify it via the format parameter.
What are the dependencies and runtime requirements?
Requires Node.js and Playwright. For test case generation, an Anthropic API key is needed. No other external services are mandatory; Git files can be cloned locally or used from an existing directory.
More Browser Automation MCP servers
mcp-browser-use: MCP server for browser-use
vinayak-mehtaMCP server for browser-use
Puppeteer MCP Server
merajmehrabiThis MCP server provides browser automation capabilities through Puppeteer, allowing interaction with both new browser instances and existing Chrome windows.
Yoyo
firecrawl🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
Fastcrw
usFast, lightweight Firecrawl/Tavily alternative in Rust. Web scraper, crawler & search API with MCP server for AI agents. Drop-in Firecrawl-compatible API (/scrape, /crawl, /search). 2.3x faster than Tavily, 1.5x faster than Firecrawl in 1K-URL benchmarks. 6 MB RAM, single binary.
BrowserTools MCP
AgentDeskAIMonitor browser logs directly from Cursor and other MCP compatible IDEs.
Comments