playwright-trace-doctor
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@playwright-trace-doctorTriage the latest Playwright trace and pinpoint the root cause"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π©Ί Playwright Trace Doctor
The Instant MRI for Broken Web Tests.
When Playwright tests fail in CI, donβt waste hours digging through 50MB trace files. Trace Doctor pinpoints whether your UI broke or your backend crashedβand generates the exact self-healing fix code in under a second.
β‘ The Pain It Solves
The Downstream Casualty Trap: In modern web apps, a button click timeout is almost never a button bugβit's usually caused by a silent upstream
HTTP 500on an API route. Standard test runners only reportTimeout 30000ms exceeded, sending developers on wild goose chases.Binary Blindspot for AI Coding Agents: AI coding agents (Antigravity, Cursor, Claude Code) only receive truncated terminal logs. They cannot read Playwrightβs binary
trace.ziparchives, forcing them to hallucinate inaccurate fixes.Tool-Sprawl in Existing Decoders: Existing trace MCP servers force AI agents to make 6β10 consecutive tool roundtrips (
open_traceβlist_actionsβget_actionβget_networkβget_consoleβget_dom), blowing token limits and stalling agent execution.
Related MCP server: deploytest MCP server
π The Solution
playwright-trace-doctor provides one-shot, token-budgeted triage and self-healing recommendations in a single call (< 5ms latency, < 1.5k tokens).
ββββββββββββββββββββββββββββββββββ
β Playwright trace.zip β
β (Actions, DOM, Network, Log) β
βββββββββββββββββ¬βββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββ
β π©Ί Playwright Trace Doctor β
β - In-Memory Streaming Parser β
β - Upstream 5xx/4xx Correlator β
β - Heuristic Root Cause Engine β
β - Self-Healing Fix Generator β
βββββββββββββββββ¬βββββββββββββββββ
β
βββββββββ΄ββββββββ
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β Terminal CLI β β MCP Server β
β (Human PRs) β β (AI Agents) β
ββββββββββββββββ ββββββββββββββββπ Benchmark vs Existing Decoders
Tested across 5 real-world stress scenarios (Strict Mode Violations, Pointer Interceptions, Missing Locators, Downstream 500s, and Web-First Assertion Mismatches):
Metric | Existing Decoders | Playwright Trace Doctor |
Agent Roundtrips | 6β10 fragmented tool calls | 1-Shot Holistic Triage ( |
Upstream Causality | Ignored | Correlates 4xx/5xx network failures to UI timeouts |
Self-Healing Code | None (raw JSON dumps) | Generates resilient Playwright locator replacements |
Trace Auto-Discovery | Requires manual file path | Auto-detects latest trace in |
CLI Mode | MCP-only | Dual-mode: Rich Terminal CLI + Stdio MCP |
Diagnostic Latency | ~500msβ2000ms | ~3.2ms average execution time |
Token Consumption | 20kβ50k tokens | < 1.5k tokens (strict token guard) |
π¦ Quick Start
1. Terminal CLI (Local & CI Usage)
# Auto-discover and triage the latest failed trace in the project
npx playwright-trace-doctor --latest
# Direct path inspection
npx playwright-trace-doctor path/to/trace.zip
# Output clean Markdown (ideal for GitHub Actions / PR comments)
npx playwright-trace-doctor --latest --markdown
# Output structured JSON
npx playwright-trace-doctor --latest --json2. Model Context Protocol (MCP) Setup
Add to your MCP configuration (antigravity.json, .cursor/mcp.json, or claude_desktop_config.json):
{
"mcpServers": {
"trace-doctor": {
"command": "npx",
"args": ["-y", "playwright-trace-doctor", "mcp"]
}
}
}π οΈ MCP Tools Reference
1. triage_failure (Primary Tool)
One-shot diagnostic of a Playwright failure trace. Extracts failing locator, stack trace, classified root cause, correlated network 4xx/5xx requests, console errors, and resilient self-healing fix code. Automatically finds latest trace if tracePath is omitted.
2. find_latest_trace
Scans project subdirectories (test-results/, playwright-report/, .playwright-artifacts/) and returns the newest trace file with file metadata.
3. get_failed_network_calls
Extracts only aborted, 4xx, and 5xx HTTP requests captured during the test run.
4. suggest_locator_fixes
Analyzes a fragile CSS or XPath selector and suggests resilient Playwright locators (getByRole, getByTestId, web-first auto-await assertions).
π§ͺ Comprehensive Stress Testing
Run the built-in 5-suite stress benchmark simulating authentic browser crashes:
# Run the automated stress benchmark
npm run test:stressOutput:
============================================================
π§ͺ RUNNING PLAYWRIGHT TRACE DOCTOR STRESS BENCHMARK (5 SUITES)
============================================================
β
Suite [strict-mode]: Strict Mode Violation (Multiple Elements)
Expected: STRICT_MODE_VIOLATION | Detected: STRICT_MODE_VIOLATION
Perf: Parse 4.19ms, Analysis 0.81ms (Total: 5.00ms)
Fixes Suggested: 2
------------------------------------------------------------
β
Suite [pointer-intercept]: Pointer Events Intercepted (Modal Overlay)
Expected: POINTER_INTERCEPTED | Detected: POINTER_INTERCEPTED
Perf: Parse 2.28ms, Analysis 0.22ms (Total: 2.50ms)
Fixes Suggested: 2
------------------------------------------------------------
β
Suite [locator-timeout]: Locator Timeout (Element Missing in DOM)
Expected: TIMEOUT_LOCATOR_NOT_FOUND | Detected: TIMEOUT_LOCATOR_NOT_FOUND
Perf: Parse 1.88ms, Analysis 0.19ms (Total: 2.07ms)
Fixes Suggested: 3
------------------------------------------------------------
β
Suite [backend-500]: Backend API 500 Failure with Downstream Timeout
Expected: BACKEND_API_FAILURE | Detected: BACKEND_API_FAILURE
Perf: Parse 2.35ms, Analysis 0.15ms (Total: 2.50ms)
Fixes Suggested: 1
------------------------------------------------------------
β
Suite [assertion-failure]: Assertion Mismatch Failure (expect.toHaveText)
Expected: ASSERTION_FAILED | Detected: ASSERTION_FAILED
Perf: Parse 1.89ms, Analysis 0.18ms (Total: 2.07ms)
Fixes Suggested: 2
------------------------------------------------------------
============================================================
π STRESS TEST SUMMARY: 5/5 PASSED (100% Target)
============================================================π License
MIT Β© 2026 Pranav H
This server cannot be deployed
Maintenance
Related MCP Connectors
Diagnose why an AI agent failed and get the verified fix instantly. Free, no token.
Agentic testing: HyperExecute jobs, test failure triage, SmartUI visual diffs, a11y audits
Approved test intent, reviewed Playwright automation and run evidence, inside your editor.
Browser-backed QA with evidence and fix-ready reports for coding agents.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to execute browser automation, perform QA tasks, and generate test code through natural language commands using Playwright.6-
- FlicenseAqualityDmaintenanceEnables AI agents to run reusable Playwright test fixtures against live deployments, providing structured test results, screenshots, and assertions.3-
- AlicenseBqualityCmaintenanceSupercharges AI-assisted debugging of Playwright tests by parsing trace files to extract failures, action history, network logs, screenshots, and suggesting fixes.62 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables AI coding assistants to generate, score, run, and auto-heal Playwright E2E tests while enforcing domain-driven page object architecture and anti-flakiness rules.-