playwright-report-mcp

v3.4.0
io.github.hubertgajewski/playwright-report-mcp Checked 2 days ago Published 2 months ago

Run Playwright tests and surface structured results for AI agents doing test failure analysis.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

run_tests

Run Playwright tests and return structured results.

ParameterTypeDescription
browserstring
envobjectEnvironment variable overrides for the Playwright child process. Each key must be listed in PW_ALLOWED_ENV. Dangerous names (NODE_*, NPM_CONFIG_*, PATH, proxies, secrets) are always rejected. Values a…
headedbooleanRun with a visible browser window. Omitting or setting false leaves playwright.config.ts intact — Playwright has no --no-headed flag, so false does not force headless when the config sets headed.
maxFailuresintegerStop the run after this many failures.
retriesintegerMaximum retry count for flaky tests; 0 disables retries.
specstringSpec file path, e.g. tests/navigation.spec.ts
tagstringTag filter, e.g. @smoke or @regression
timeoutintegerTimeout in milliseconds for the whole test run. Defaults to 300000.
tracestringForce Playwright tracing mode, overriding playwright.config.ts.
updateSnapshotsstringUpdate snapshot baselines. Playwright default is "missing"; "changed" updates differing + missing.
waitbooleanWait for completion before returning. Defaults to true. Set false to start a background run and poll it with get_run_status.
workersintegerNumber of parallel workers (positive integer).
workingDirectorystringPlaywright project directory. Absolute or relative to the MCP server launch directory. Defaults to ".". Must be under PW_ALLOWED_DIRS.

get_run_status

Return status for a tracked Playwright run. Pass runId for a specific background run, or omit it to inspect the latest tracked run for a workingDirectory. If no tracked run exists, returns idle with current results.json metadata; it does not inspect unrelated OS processes.

ParameterTypeDescription
runIdstringRun identifier returned by run_tests with wait=false.
workingDirectorystringPlaywright project directory. Absolute or relative to the MCP server launch directory. Defaults to ".". Must be under PW_ALLOWED_DIRS. Used to find the latest tracked run when runId is omitted; when s…

get_failed_tests

Return failed tests from the last run with error messages and attachment paths.

ParameterTypeDescription
workingDirectorystringPlaywright project directory. Absolute or relative to the MCP server launch directory. Defaults to ".". Must be under PW_ALLOWED_DIRS.

get_test_attachment

Read the content of a named attachment for a specific test from the last run.

ParameterTypeDescription
attachmentName *stringAttachment name, e.g. "AI diagnosis", "DOM"
testTitle *stringExact test title as shown in the report
workingDirectorystringPlaywright project directory. Absolute or relative to the MCP server launch directory. Defaults to ".". Must be under PW_ALLOWED_DIRS.

list_tests

List all tests with their spec file and tags without running them.

ParameterTypeDescription
envobjectEnvironment variable overrides for the Playwright child process. Each key must be listed in PW_ALLOWED_ENV. Dangerous names (NODE_*, NPM_CONFIG_*, PATH, proxies, secrets) are always rejected. Values a…
tagstringFilter by tag, e.g. @smoke
workingDirectorystringPlaywright project directory. Absolute or relative to the MCP server launch directory. Defaults to ".". Must be under PW_ALLOWED_DIRS.