MCP Servers

ๆจกๅž‹ไธŠไธ‹ๆ–‡ๅ่ฎฎๆœๅŠกๅ™จใ€ๆก†ๆžถใ€SDK ๅ’Œๆจกๆฟ็š„็ปผๅˆ็›ฎๅฝ•ใ€‚

P
Playwright MCP Enterprise Kit Plus
ไฝœ่€… @akash-rathod01

AI-Powered Testing - **๐Ÿ”Œ MCP Server Integration** - Execute tests programmatically via Model Context Protocol - **๐Ÿ’ฌ AI Assistant Ready** - Claude Desktop, VS Code Copilot, and other MCP clients supported - **โšก Smart Test Execution** - Intelligent test selection and execution via MCP tools

ๅˆ›ๅปบไบŽ 4/2/2026
ๆ›ดๆ–ฐไบŽ about 3 hours ago
Repository documentation and setup instructions

๐ŸŽญ Playwright + MCP Enterprise Kit Plus

Enterprise-grade E2E Testing Framework with AI-Powered Test Execution

Playwright TypeScript MCP License PRs Welcome

Production-ready testing framework combining Playwright's power with MCP server integration for AI-driven test execution, comprehensive reporting, and enterprise integrations.

Features โ€ข Quick Start โ€ข MCP Integration โ€ข Documentation โ€ข Contributing


โœจ Features

๐Ÿค– AI-Powered Testing

  • ๐Ÿ”Œ MCP Server Integration - Execute tests programmatically via Model Context Protocol
  • ๐Ÿ’ฌ AI Assistant Ready - Claude Desktop, VS Code Copilot, and other MCP clients supported
  • โšก Smart Test Execution - Intelligent test selection and execution via MCP tools

๐Ÿ“Š Enterprise Reporting

  • ๐Ÿ“ˆ Allure Reports - Beautiful, comprehensive test analytics and history
  • ๐Ÿ“ธ Visual Evidence - Automatic screenshots, videos, and traces on failures
  • ๐ŸŽฏ JUnit/HTML Reports - Multi-format reporting for CI/CD pipelines

๐Ÿ”— Integration Ecosystem

  • ๐Ÿ™ GitHub Issues - Auto-create issues from test failures with full context
  • ๐Ÿ“‹ Jira Integration - Automatic ticket creation in Jira for failed tests
  • ๐Ÿ›ก๏ธ OWASP ZAP - Security vulnerability scanning integration
  • ๐Ÿšฆ Lighthouse CI - Automated performance and accessibility audits

๐ŸŽญ Testing Capabilities

  • ๐ŸŒ Multi-Browser - Chromium, Firefox, and WebKit support
  • โ™ฟ Accessibility - Built-in aXe-core accessibility testing
  • ๐Ÿ” Enterprise Ready - Extensible framework for testing enterprise applications
  • ๐Ÿงช Smoke & Regression - Organized test suites for different testing levels

๐Ÿš€ Developer Experience

  • ๐Ÿ“ฆ TypeScript First - Full type safety and IntelliSense support
  • ๐Ÿ—๏ธ Page Object Model - Maintainable test architecture
  • โš™๏ธ CI/CD Ready - GitHub Actions workflows included
  • ๐Ÿ”„ Auto-Setup - One-command browser installation

๐Ÿ“‹ Prerequisites

Before you begin, ensure you have the following installed:

Optional (for specific features):

  • Allure commandline for local report viewing
  • Docker for ZAP security scanning
  • Claude Desktop or other MCP client for AI-powered testing

๐Ÿš€ Quick Start

1๏ธโƒฃ Clone & Install

# Clone the repository
git clone https://github.com/YOUR-USERNAME/playwright-mcp-enterprise-kit-plus.git
cd playwright-mcp-enterprise-kit-plus

# Install dependencies
npm install

# Install Playwright browsers
npm run prepare

2๏ธโƒฃ Configure Environment

# Copy environment template
cp .env.example .env

# Edit .env with your credentials (use your favorite editor)
notepad .env  # Windows
# or
nano .env     # macOS/Linux

Minimal configuration (for basic testing):

BASE_URL=https://your-app.com
# Add your application-specific configuration here

3๏ธโƒฃ Run Your First Test

# Run all tests
npm test

# Run tests in interactive UI mode (recommended for first-time)
npm run test:ui

# Run specific test suite
npx playwright test src/tests/web

# Run in headed mode to watch tests execute
npx playwright test --headed

4๏ธโƒฃ View Results

# View Playwright HTML report
npm run test:report

# Generate and view Allure report
npm run allure:generate
npm run allure:open

๐Ÿ”Œ MCP Server Integration

What is MCP?

The Model Context Protocol (MCP) enables AI assistants to execute your tests programmatically. This allows tools like Claude Desktop, VS Code Copilot, or custom AI agents to run, debug, and analyze your test suite.

๐ŸŽฏ Quick Setup with Claude Desktop

๐ŸŽฏ Quick Setup with Claude Desktop

Step 1: Add to your Claude Desktop config:

{
  "mcpServers": {
    "playwright-enterprise": {
      "command": "npm",
      "args": ["run", "mcp:server"],
      "cwd": "D:\\Plywright_MCP Server_Project\\playwright-mcp-enterprise-kit-plus"
    }
  }
}

Config location:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Step 2: Restart Claude Desktop

Step 3: Ask Claude to run your tests:

"Run the smoke tests"
"Execute all accessibility tests and show me the results"
"Run tests matching 'homepage' and create a report"

๐Ÿ› ๏ธ Available MCP Tools

| Tool | Description | Example Use | |------|-------------|-------------| | run_playwright_tests | Execute tests with full configuration options | Run specific browsers, projects, or grep patterns | | run_smoke_tests | Quick smoke test execution | Fast validation before deployments | | get_test_config | Retrieve current configuration | Debug setup issues |

๐Ÿ’ก Usage Examples

๐Ÿ’ก Usage Examples

Run specific tests:

// Ask Claude: "Run tests matching 'login' in Chromium browser"
{
  "grep": "login",
  "project": "chromium"
}

Run tests and generate report:

// Ask Claude: "Run smoke tests and generate Allure report"
// MCP tool handles execution + reporting automatically

Standalone server mode:

# Start MCP server manually (for custom integrations)
npm run mcp:server

# Server listens on stdio for MCP protocol messages

๐Ÿ“– Full MCP documentation: MCP_USAGE.md



๐Ÿ“Š Reporting & Analytics

๐Ÿ“ˆ Allure Reports

Generate beautiful, interactive reports with historical trends and analytics:

# Generate report from latest test results
npm run allure:generate

# Open report in browser
npm run allure:open

Allure features:

  • ๐Ÿ“Š Historical trends and statistics
  • ๐Ÿ“ธ Screenshots and video attachments
  • ๐Ÿ” Detailed step-by-step execution
  • ๐Ÿ“‰ Flaky test detection
  • ๐Ÿท๏ธ Test categorization and tagging

๐Ÿ› Auto-Create Issues from Failures

Automatically create detailed tickets when tests fail:

GitHub Issues Integration

# Set environment variables
export GH_TOKEN=ghp_xxxxxxxxxxxxx
export GH_OWNER=your-username
export GH_REPO=playwright-mcp-enterprise-kit-plus

# Create issues from failures
npm run issues:github

Created issues include:

  • Test name and failure reason
  • Screenshots and error traces
  • Browser and environment details
  • Direct links to test files

Jira Integration

# Configure Jira credentials
export JIRA_HOST=https://your-domain.atlassian.net
export JIRA_EMAIL=you@example.com
export JIRA_TOKEN=your-api-token
export JIRA_PROJECT_KEY=PROJ

# Create Jira tickets
npm run issues:jira

๐Ÿ” Security & Performance Scans

# Run OWASP ZAP baseline security scan
npm run zap:baseline

# Run full ZAP scan (longer, more thorough)
npm run zap:full

# Run Lighthouse CI performance audit
npm run lhci:autorun


๐Ÿ”ง Available Scripts

| Category | Script | Description | |----------|--------|-------------| | Testing | npm test | Run all Playwright tests | | | npm run test:ui | Run tests in interactive UI mode | | | npm run test:report | View Playwright HTML report | | | npm run test:a11y | Run accessibility tests only | | MCP | npm run mcp:server | Start MCP server for AI-powered execution | | Reports | npm run allure:generate | Generate Allure report from results | | | npm run allure:open | Open Allure report in browser | | Integrations | npm run issues:github | Create GitHub issues from test failures | | | npm run issues:jira | Create Jira tickets from test failures | | Security | npm run zap:baseline | Run OWASP ZAP baseline security scan | | | npm run zap:full | Run comprehensive ZAP security scan | | | npm run lhci:autorun | Run Lighthouse CI performance audit | | Setup | npm run prepare | Install Playwright browsers (auto-runs on install) |

๐Ÿ’ป Direct Playwright Commands

# Run specific test file
npx playwright test src/tests/web/example.spec.ts

# Run tests matching pattern
npx playwright test --grep "dashboard"

# Run in headed mode (see browser)
npx playwright test --headed

# Run in debug mode
npx playwright test --debug

# Run specific browser
npx playwright test --project=chromium

# Run with UI mode (interactive)
npx playwright test --ui

# Update snapshots
npx playwright test --update-snapshots


๐Ÿ“ Project Structure

playwright-mcp-enterprise-kit-plus/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ src/
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ mcp/                      # MCP Server Implementation
โ”‚   โ”‚   โ”œโ”€โ”€ server.ts               # Main MCP server entry point
โ”‚   โ”‚   โ”œโ”€โ”€ types.ts                # TypeScript interfaces and types
โ”‚   โ”‚   โ””โ”€โ”€ tools/
โ”‚   โ”‚       โ””โ”€โ”€ runPlaywright.ts    # Test execution MCP tool
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‚ tests/                   # Core Test Suites
โ”‚   โ”‚   โ”œโ”€โ”€ web/                    # Web application tests
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ accessibility.spec.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”‚   โ””โ”€โ”€ api/                    # API tests
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ๐Ÿ“‚ framework/               # Test Framework
โ”‚       โ”œโ”€โ”€ pages/                  # Page Object Models
โ”‚       โ””โ”€โ”€ utils/                  # Utility functions
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ integrations/                # External Integrations
โ”‚   โ”œโ”€โ”€ common/                     # Shared utilities
โ”‚   โ”‚   โ””โ”€โ”€ parseJunitXml.ts       # Test result parsing
โ”‚   โ”œโ”€โ”€ github/                     # GitHub Issues
โ”‚   โ”‚   โ””โ”€โ”€ reportFailuresToIssues.ts
โ”‚   โ””โ”€โ”€ jira/                       # Jira Integration
โ”‚       โ””โ”€โ”€ reportFailuresToIssues.ts
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ security/                    # Security Testing
โ”‚   โ””โ”€โ”€ zap/                        # OWASP ZAP integration
โ”‚       โ””โ”€โ”€ scripts/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“‚ allure-results/              # Allure test results (generated)
โ”œโ”€โ”€ ๐Ÿ“‚ allure-report/               # Allure HTML reports (generated)
โ”œโ”€โ”€ ๐Ÿ“‚ playwright-report/           # Playwright HTML report (generated)
โ”œโ”€โ”€ ๐Ÿ“‚ reports/                     # JUnit XML reports (generated)
โ”œโ”€โ”€ ๐Ÿ“‚ test-results/                # Test artifacts (generated)
โ”‚
โ”œโ”€โ”€ ๐Ÿ“„ playwright.config.ts         # Playwright configuration
โ”œโ”€โ”€ ๐Ÿ“„ tsconfig.json                # TypeScript configuration
โ”œโ”€โ”€ ๐Ÿ“„ package.json                 # Dependencies and scripts
โ”œโ”€โ”€ ๐Ÿ“„ .env.example                 # Environment variables template
โ”œโ”€โ”€ ๐Ÿ“„ MCP_USAGE.md                 # MCP server documentation
โ”œโ”€โ”€ ๐Ÿ“„ QUICKSTART.md                # Quick start guide
โ””โ”€โ”€ ๐Ÿ“„ README.md                    # This file

๐Ÿ“š Documentation

| Document | Description | |----------|-------------| | README.md | Main documentation (you are here) | | QUICKSTART.md | Fast-track setup guide | | MCP_USAGE.md | Complete MCP server documentation | | PULL_REQUEST_TEMPLATE.md | PR guidelines and checklist |



โš™๏ธ Environment Configuration

๐Ÿ“ Setting Up .env File

Copy the example and customize for your environment:

cp .env.example .env

๐Ÿ”‘ Required Variables

Application Configuration

BASE_URL=https://your-app.com
# Add your application-specific variables here

GitHub Integration (Optional)

GH_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
GH_OWNER=your-github-username
GH_REPO=playwright-mcp-enterprise-kit-plus

Jira Integration (Optional)

JIRA_HOST=https://your-company.atlassian.net
JIRA_EMAIL=your-email@company.com
JIRA_TOKEN=ATATTxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
JIRA_PROJECT_KEY=TEST

Playwright Configuration (Optional)

BASE_URL=https://your-app.com
PW_SLOWMO=100                    # Slow down execution (ms)
PLAYWRIGHT_SLOWMO=100            # Alternative slowmo variable
CI=true                          # CI mode (enables retries)

๐Ÿ”’ Security Best Practices

  • โœ… Never commit .env file to Git (already in .gitignore)
  • โœ… Use environment-specific .env files (.env.dev, .env.staging, .env.prod)
  • โœ… Store production secrets in CI/CD secret vaults (GitHub Secrets, Azure Key Vault, etc.)
  • โœ… Rotate credentials regularly
  • โœ… Use service accounts with minimal permissions for testing

๐Ÿšฆ CI/CD Integration

GitHub Actions Workflow

This project includes a ready-to-use GitHub Actions workflow that:

  • โœ… Runs tests on every push and pull request
  • โœ… Tests across multiple browsers (Chromium, Firefox, WebKit)
  • โœ… Generates and uploads Allure reports
  • โœ… Creates test artifacts (screenshots, videos, traces)
  • โœ… Optionally deploys reports to GitHub Pages
  • โœ… Runs on Ubuntu, Windows, and macOS (configurable)

๐Ÿ”ง Setup GitHub Actions

  1. Enable GitHub Actions in your repository

  2. Add secrets in repository settings:

    Settings โ†’ Secrets and variables โ†’ Actions โ†’ New repository secret
    

    Add your application-specific secrets as needed.

  3. Push to trigger workflow:

    git push origin main
    
  4. View results in the Actions tab

๐Ÿ“Š Sample Workflow Output

โœ“ Install dependencies
โœ“ Install Playwright browsers
โœ“ Run Playwright tests (chromium)
โœ“ Run Playwright tests (firefox)
โœ“ Run Playwright tests (webkit)
โœ“ Generate Allure report
โœ“ Upload test artifacts
โœ“ Deploy to GitHub Pages (optional)

๐ŸŽฏ Best Practices

โœ… Test Organization

  • Group tests by feature/module in logical folders
  • Use descriptive test names: should display error when login fails
  • Tag tests appropriately: @smoke, @regression, @critical
  • Keep test files focused (one feature per file)

โœ… Page Object Model

  • Create page objects for all major pages/components
  • Use selectors that are stable (data-testid preferred)
  • Encapsulate page interactions in methods
  • Return page objects for method chaining

โœ… Test Data Management

  • Use environment variables for configuration
  • Keep test data separate from test logic
  • Use fixtures for complex test setup
  • Avoid hard-coded values

โœ… Assertions

  • Use specific, meaningful assertions
  • Add custom error messages: expect(value, 'User should be logged in').toBeTruthy()
  • Test both positive and negative scenarios
  • Avoid flaky assertions (use toBeVisible() with timeouts)

โœ… Performance

  • Run tests in parallel (fullyParallel: true in config)
  • Use test.describe.configure({ mode: 'parallel' }) for test groups
  • Share authentication state across tests
  • Clean up test data after execution


๐Ÿค Contributing

We welcome contributions! Here's how you can help:

๐Ÿ› Bug Reports

  1. Check if the bug is already reported in Issues
  2. Create a new issue with:
    • Clear description of the problem
    • Steps to reproduce
    • Expected vs actual behavior
    • Screenshots/logs if applicable
    • Environment details (OS, Node version, browser)

โœจ Feature Requests

  1. Search existing feature requests
  2. Open a new issue describing:
    • The problem you're trying to solve
    • Proposed solution
    • Alternative solutions considered
    • Additional context

๐Ÿ”ง Pull Requests

Quick contribution workflow:

# 1. Fork and clone
git clone https://github.com/YOUR-USERNAME/playwright-mcp-enterprise-kit-plus.git
cd playwright-mcp-enterprise-kit-plus

# 2. Create a feature branch
git checkout -b feature/amazing-feature

# 3. Make your changes
# ... code, code, code ...

# 4. Test your changes
npm test

# 5. Commit with clear message
git commit -m "feat: add amazing new feature"

# 6. Push to your fork
git push origin feature/amazing-feature

# 7. Open a Pull Request

PR Checklist:

  • โœ… Tests pass locally (npm test)
  • โœ… Code follows existing style
  • โœ… Added tests for new features
  • โœ… Updated documentation if needed
  • โœ… Commit messages are clear
  • โœ… No sensitive data (credentials, tokens) in code

๐Ÿ“– Documentation Improvements

  • Fix typos, improve clarity
  • Add examples and use cases
  • Improve code comments
  • Update outdated information

โ“ FAQ & Troubleshooting

General Issues

Q: Tests are failing with "Browser not found" error

# Solution: Install Playwright browsers
npm run prepare
# or
npx playwright install --with-deps

Q: Getting "ECONNREFUSED" or timeout errors

# Check your application is running
# Verify BASE_URL in .env or playwright.config.ts
# Check network/firewall settings

Q: Tests are flaky (pass sometimes, fail sometimes)

// Solution: Add proper waits
await page.waitForLoadState('networkidle');
await expect(element).toBeVisible({ timeout: 10000 });

// Avoid hard waits
// โŒ await page.waitForTimeout(5000);
// โœ… await page.waitForSelector('.my-element');

MCP Server Issues

Q: MCP server not connecting in Claude Desktop

# 1. Verify config location
# Windows: %APPDATA%\Claude\claude_desktop_config.json
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

# 2. Check cwd path is correct (absolute path)
# 3. Restart Claude Desktop completely
# 4. Check logs in Claude Desktop developer tools

Q: MCP tools not showing up

# Verify server starts without errors
npm run mcp:server

# Check TypeScript compilation
npx tsc --noEmit

# Ensure all dependencies installed
npm install

Integration Issues

Q: GitHub issue creation fails

# Verify token has correct permissions (repo scope)
# Check GH_TOKEN, GH_OWNER, GH_REPO are set
# Run manually to see detailed error:
npm run issues:github

Q: Allure report is empty

# Make sure tests have run first
npm test

# Then generate report
npm run allure:generate
npm run allure:open

Performance Issues

Q: Tests are running slowly

// Enable parallel execution in playwright.config.ts
fullyParallel: true,

// Or in specific test file
test.describe.configure({ mode: 'parallel' });

Q: Need to debug a specific test

# Run in debug mode (opens inspector)
npx playwright test --debug

# Run in headed mode (see browser)
npx playwright test --headed

# Run specific test only
npx playwright test -g "test name"

๐Ÿ™ Acknowledgments

Built with these amazing technologies:


๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ’ฌ Support & Contact


Made with โค๏ธ for the testing community

If this project helps you, please consider giving it a โญ!

Report Bug ยท Request Feature ยท View Examples

Test Execution Issues

  • Install browsers: npm run prepare
  • Check environment variables in .env
  • Verify network connectivity
  • Review logs in test-results/ directory

Integration Issues

  • Verify API tokens are valid and have proper permissions
  • Check network connectivity to GitHub/Jira
  • Ensure JUnit report exists: reports/junit.xml

๐Ÿ“š Additional Resources

ๅฟซ้€Ÿ่ฎพ็ฝฎ
ๆญคๆœๅŠกๅ™จ็š„ๅฎ‰่ฃ…ๆŒ‡ๅ—

ๅฎ‰่ฃ…ๅŒ… ๏ผˆๅฆ‚ๆžœ้œ€่ฆ๏ผ‰

npx @modelcontextprotocol/server-playwright-mcp-enterprise-kit-plus

Cursor ้…็ฝฎ (mcp.json)

{ "mcpServers": { "akash-rathod01-playwright-mcp-enterprise-kit-plus": { "command": "npx", "args": [ "akash-rathod01-playwright-mcp-enterprise-kit-plus" ] } } }