@probility/mcp-playwright-automation
v1.0.0
Published
Enterprise-grade Playwright MCP server for automated web testing — run AI-powered browser tests from any MCP-compatible client
Maintainers
Readme
Playwright MCP Automation Tool
A generic, AI-powered automation testing tool that allows teams to define web app test scenarios in natural language or structured JSON and execute them using the Model Context Protocol.
Features
- Natural Language Selectors: Click buttons and fill fields using their labels, text, or roles (e.g., "Click Login" or "Fill 'Email' with '[email protected]'").
- Self-Healing Capability: When used with an LLM, the agent can inspect the page state and find alternative ways to complete a step if a selector fails.
- Generic Scenarios: Easily define multiple scenarios with assertions for any web application.
- Screenshots: Automatic or manual full-page screenshots for debugging and reporting.
Setup
Install Dependencies:
npm install npx playwright install chromiumBuild the Server:
npm run buildConfigure with your LLM (e.g., Claude Desktop): Add the following to your
claude_desktop_config.json:{ "mcpServers": { "playwright-automation": { "command": "node", "args": ["/path/to/mcp-playwright-automation/dist/index.js"] } } }
Usage for Organizations
Dev teams can provide a test configuration file like this:
Example test-config.json
{
"baseUrl": "https://example.com",
"scenarios": [
{
"name": "User Login Flow",
"steps": [
"Navigate to /login",
"Fill field 'Username' with 'testuser'",
"Fill field 'Password' with 'password123'",
"Click the 'Sign In' button"
],
"assertions": [
"URL should contain '/dashboard'",
"Page should show text 'Welcome back'"
]
}
]
}Running Tests
Once the MCP server is connected to your AI agent, simply give it the configuration file and say:
"Run these automation scenarios using the playwright-automation tool and provide a report."
The AI will:
- Initialize the session.
- Execute each step sequentially.
- Verify assertions.
- Take screenshots if errors occur.
- Summarize the results.
