npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

playwright-execute-mcp

v1.0.12

Published

AI-powered Playwright test execution with self-repair capabilities via Model Context Protocol (MCP)

Readme

Playwright Execute MCP Server

AI-Driven Playwright Test Execution powered by the Model Context Protocol (MCP)

An MCP server that empowers AI assistants (Cursor, Claude Code, GitHub Copilot) to execute, debug, and fix Playwright tests automatically using ARIA snapshots and intelligent analysis.


🎯 What It Does

  • Execute tests conversationally ("run the login test")
  • Debug and analyze test failures with live page exploration
  • Fix broken tests using ARIA snapshots from Microsoft Playwright MCP
  • Discover tests by name or pattern
  • Explore pages to create new tests with accessible selectors

The AI makes decisions. This MCP provides the tools.


🚀 Installation

This tool works in combination with the official Microsoft Playwright MCP server for full functionality.

Install Both MCP Servers:

# This server (test execution)
npm install -g playwright-execute-mcp

# Microsoft Playwright MCP (page exploration)
npm install -g @playwright/mcp

Note: Both servers work together. This server executes tests and analyzes failures, while @playwright/mcp provides page exploration and ARIA snapshots.


⚙️ Configuration

⚠️ Important: Configure BOTH servers for full functionality

For Cursor

Add to %APPDATA%\Cursor\User\globalStorage\settings.json (Windows) or ~/.config/Cursor/User/globalStorage/settings.json (Mac/Linux):

{
  "mcpServers": {
    "playwright-execute": {
      "command": "npx",
      "args": ["-y", "playwright-execute-mcp"],
      "description": "Execute and debug Playwright tests"
    },
    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp"],
      "description": "Page exploration and ARIA snapshots"
    }
  }
}

For Claude Desktop

Add to %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (Mac):

{
  "mcpServers": {
    "playwright-execute": {
      "command": "npx",
      "args": ["-y", "playwright-execute-mcp"]
    },
    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp"]
    }
  }
}

Restart your AI assistant after adding the configuration.


💡 Usage Examples

Once configured, talk naturally to your AI assistant:

"Execute the login test"
"Fix the checkout test"
"Create a test for the signup page"
"Find all tests matching 'payment'"
"Run all tests in the auth folder"

The AI will use the MCP tools automatically!


🛠️ MCP Tools Provided

| Tool | Description | |------|-------------| | execute_test | Run a specific test by name with auto-repair | | find_tests | Search for tests by name or pattern | | run_tests | Execute multiple tests with repair loop | | get_test_artifacts | Retrieve test reports and screenshots | | explore_page | Get ARIA snapshot via Microsoft Playwright MCP | | analyze_test_failure | Deep failure analysis with page exploration | | get_test_code | Read test source code |


🔥 Key Features

1. Conversational Test Execution

Talk to your AI naturally - no commands to memorize.

2. ARIA-Driven Fixes

Uses accessible selectors from ARIA snapshots for reliable, maintainable tests.

3. Intelligent Failure Analysis

AI analyzes failures, compares page state, and suggests fixes.

4. Integration with Microsoft Playwright MCP

Works seamlessly with the official Playwright MCP for page exploration.


🏗️ Architecture

AI Assistant (Cursor/Claude)
          ↓
Playwright Execute MCP (This Server)
  ├─ 7 MCP Tools
  ├─ Resources API
  └─ Prompts API
          ↓
    ┌─────────┴──────────┐
    ▼                    ▼
Microsoft              Your
Playwright MCP      Playwright Tests
(ARIA Snapshots)

📖 Complete Workflow Example

User: "The login test is broken, fix it"

AI Workflow:

  1. Calls analyze_test_failure({ testName: "login" })
  2. Server returns:
    • Test code: page.locator('#email').fill(...)
    • Error: locator('#email') not found
    • ARIA snapshot: textbox "Email address"
  3. AI determines the fix: Use accessible selector
  4. AI edits test:
    - await page.locator('#email').fill('[email protected]')
    + await page.getByRole('textbox', { name: 'Email address' }).fill('[email protected]')
  5. AI calls execute_test({ testName: "login" })
  6. ✅ Test passes!

🔗 How The Two Servers Work Together

This tool is designed to work with Microsoft's Playwright MCP:

| Server | Responsibility | Tools Provided | |--------|---------------|----------------| | This Server (playwright-execute-mcp) | Test execution, failure analysis, test discovery | execute_test, find_tests, run_tests, analyze_test_failure | | Microsoft Playwright MCP (@playwright/mcp) | Page exploration, ARIA snapshots, browser control | playwright_navigate, playwright_snapshot, playwright_click |

Together they enable:

  • ✅ AI can execute tests → See failures → Explore live page → Understand what changed → Fix tests
  • ✅ Full test development lifecycle in natural language

🎓 How It Works

NOT Rule-Based Automation

This server doesn't automatically fix tests. Instead, it provides tools and data for AI to make intelligent decisions.

The AI is the Engineer

  • AI decides what to do
  • AI analyzes failures
  • AI writes fixes
  • AI verifies solutions

This Server Provides:

  • Test execution capabilities
  • Page exploration via Playwright MCP
  • Structured failure analysis
  • ARIA snapshots for accessible selectors

📦 What Makes This Different

| Traditional Testing | With This MCP | |-------------------|---------------| | Manual test fixes | AI fixes automatically | | Brittle CSS selectors | ARIA-based accessible selectors | | CLI commands | Natural language | | No intelligence | AI-driven analysis | | Separate tools | Integrated in your IDE |


🛡️ Requirements

  • Node.js 16 or higher
  • Playwright tests in your project
  • AI Assistant with MCP support (Cursor, Claude Desktop, etc.)

📝 License

MIT License - Copyright (c) 2025 QtpSudhakar


🤝 Contributing

Issues and pull requests are welcome!


📞 Support

For issues or questions, please open an issue on the repository.


🔗 Related


Built for AI. Powered by MCP. Ready for production. 🚀