Skip to main content
Glama

playwright-e2e-mcp has moved

This repository is no longer maintained. playwright-e2e-mcp now lives at github.com/xsignon-secure/E2E.

The latest release is 0.4.2. To set it up in your project:

npx -y playwright-e2e-mcp init

The npm package name is unchanged, so existing installs keep working; run the command above (or npm install -D playwright-e2e-mcp@latest) to pick up the newest version.

Issues, pull requests, releases and the .mcpb Claude Desktop bundle are all at the new home:

playwright-e2e-mcp is, and stays, fully open source and free under the MIT license.

Available Tools

11 tools
analyze-historyAnalyze run historyA
Read-onlyIdempotent
Inspect

Analyze the local run history (.playwright-e2e-mcp/history.jsonl, written by every run): 'flaky' ranks tests that flip pass/fail and lists broken or regressed ones; 'patterns' groups failures by cause; 'test' shows one test's timeline.

Inputs: test, view, limit, lastRuns, +1 more.

compare-visual-stateCompare visual stateA
DestructiveIdempotent
Inspect

Visual regression check: screenshot a live page (or element), compare it to a stored baseline, and report how many pixels changed, WHERE they changed (bounding regions), and the average color shift ("blue → red"). First call saves the baseline; later calls compare. Writes a red-highlighted diff image for review.

Inputs: url (required), name (required), action, actions, +11 more.

diagnose-flakyDiagnose flaky testA
DestructiveIdempotent
Inspect

Run a failing test multiple times with retries disabled and return an evidence-based verdict: CONSISTENTLY FAILING (real bug), FLAKY (intermittent — includes pass/fail counts and error-signature variance) or NOT REPRODUCING (one-off). Defaults to the tests that failed in the most recent run.

Inputs: runs, config, headed, browser, +4 more.

generate-e2e-testGenerate an E2E testA
Destructive
Inspect

Scaffold a Playwright test from a description using the project's REAL selectors. Scans the agent's recent file changes (git working tree / last commit, mtime fallback), extracts data-testid / role / label / placeholder / id locators with their source locations, optionally cross-checks them against the live page, writes a ready-to-run spec, and returns next steps.

Inputs: description (required), file, write, config, +5 more.

get-failureAnalyze a test failureA
Read-onlyIdempotent
Inspect

Analyze one failure from the most recent run-test execution: full message and code frame, expected vs actual, stack trace, failed network requests (4xx/5xx and dead endpoints), console errors, failure kind (assertion/timeout/browser-crash/syntax/config/server-unreachable) and concrete next steps. Use run-test first.

Inputs: index, projectRoot.

get-run-statusCheck a background runA
Idempotent
Inspect

Progress (tests done/total, failures so far) or the final result of a run-test background run; the result becomes the last run for get-failure. waitSeconds waits; cancel stops it. Default: the latest run.

Inputs: runId, cancel, waitSeconds.

inspect-pageInspect live page DOMA
Read-onlyIdempotent
Inspect

Open a URL headlessly and return its elements with Playwright locators proven unique on the page (role + name first), CSS selectors, visibility, text and console messages. storageState/headers open it signed in; actions click/fill first to reach a state. view 'locators' is the compact map.

Inputs: url (required), view, actions, headers, +9 more.

list-testsList available testsA
Read-onlyIdempotent
Inspect

List the Playwright tests available in the project (file, line, full title, projects), with optional filtering. Uses playwright test --list when Playwright works and falls back to a source scan when the install or config is broken, reporting why.

Inputs: limit, config, filter, testDir, +1 more.

run-testRun E2E testsA
DestructiveIdempotent
Inspect

Run the project's Playwright tests: stats plus each failure's file:line, kind and message. Diagnoses missing installs, dead dev servers, syntax errors, crashes and timeouts (kills the tree, keeps partial results). Reports progress; background: true returns a run id for long suites. Runs are recorded for analyze-history.

Inputs: args, grep, config, headed, +10 more.

suggest-fixSuggest (and apply) a fixA
Destructive
Inspect

Patch a failure from the last run: a drifted locator is matched against the DOM at failure (trace, or live url) and replaced with one proven unique; changed copy gets the new expected text. Returns a diff and confidence; apply: true writes it, re-runs the test and reverts if still red. Refuses when the element is truly missing (app bug).

Inputs: url, apply, index, config, +6 more.

validate-selectorValidate selector or locatorA
Read-onlyIdempotent
Inspect

Check a CSS selector, Playwright selector or locator (getByRole/getByTestId…, .first(), .filter()) on a live page: validity, match count (actions need exactly 1), sample matches and a sturdier verified locator for each. Accepts storageState/headers/actions.

Inputs: url (required), selector (required), actions, headers, +4 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 11 tools

    Disambiguation4/5

    Tools map to distinct stages of the Playwright workflow: listing, running, monitoring, failure analysis, fixing, generation, visual comparison, selector validation, flaky diagnosis, and history. Overlap exists between diagnose-flaky and analyze-history, and between get-failure and get-run-status, but descriptions clarify the boundaries.

    Naming Consistency5/5

    All tool names use kebab-case with a consistent verb-first pattern (run-test, get-failure, list-tests, validate-selector, etc.). Minor variation in noun length does not break the convention.

    Tool Count5/5

    11 tools is well within the ideal 3–15 range. Each tool addresses a distinct aspect of Playwright E2E testing without obvious redundancy.

    Completeness4/5

    The core lifecycle is well covered: list tests, run tests, monitor runs, analyze failures, suggest fixes, generate tests, validate selectors, compare visual state, diagnose flakiness, and analyze history. Minor gaps include running a specific test or reading a single test's code, but agents can work around these.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers