
Playwright Trace Decoder Mcp
io.github.vola-treblaPublished by GitHub account vola-treblav0.2.3Updated Oct 24, 2026
MCP server for unpacking and analyzing Playwright trace.zip archives
Overview
Lets an assistant unpack and analyze Playwright trace.zip archives to diagnose failing end-to-end test runs.
- What you can do
- It exposes 16 tools that read a Playwright trace archive and return structured diagnostics instead of raw JSON. Tools cover test metadata, trace summaries, paginated action timelines, filtered network logs, console errors, ARIA accessibility trees, DOM mutation deltas, screenshots at failure, race-condition and DOM/network correlation analysis, causal chains, error signatures, passing-versus-failing trace comparison, locator-to-source mapping, performance anomaly detection, and trace trimming. List results are paginated, and ARIA output is compressed to reduce token use.
- When to use it
- Use it when a Playwright test fails in CI and you have a trace.zip to inspect, especially for root-cause analysis, flakiness comparison between passing and failing runs, grouping duplicate failures by error signature, or checking whether a timeout came from a blocked main thread or network saturation.
- Requirements
- Runs locally as a Node.js process over stdio; the npm package is playwright-trace-decoder-mcp, or it can be built from source with npm install and npm run build. No authentication, environment variables, or headers are declared. A trace_path argument accepts a local absolute path or an HTTPS URL, in which case the server downloads and caches the file.
Installation
In SourceWeft
- Open Playwright Trace Decoder Mcp in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
🎭 playwright-trace-decoder-mcp
[npm version] [npm downloads] [CI] [License: MIT]
An MCP server that unpacks and structures Playwright trace.zip archives so AI agents can perform root-cause analysis on CI failures — without drowning in raw JSON or blowing up the context window.
🤔 The Problem
When a Playwright test fails in CI, you get a trace.zip. It's a binary blob. LLMs can't read it natively, and dumping the raw contents exceeds the context window. Engineers end up copying log snippets into ChatGPT manually like it's 2022.
This MCP server solves that: 16 focused tools that expose exactly the signal an agent needs to diagnose a failure, with pagination and ARIA compression to keep token costs low.
🐸 E2E Failure Investigation Example
Here is a quick look at how an AI agent uses the new tools in v0.3.0 to instantly find and inspect a failure:
-
Locate the exact source code bug via
map_locator_to_source:No more guessing! The agent knows exactly which file, line, and column caused the timeout.
-
Extract critical visual frames around the failure via
extract_critical_frames:Allows the agent to visual-verify page state immediately before/after failure without pulling massive image lists.
-
Trim the trace to save CI storage / transfer costs via
trim_trace_archive:Shrinks large traces by deleting screenshots outside the critical failure window. Saved 79% of disk space!
🛠️ Tools
Tools are grouped by how an agent should sequence them when diagnosing a failure.
Inspection — read trace data
All list-returning tools support limit (1–500, default 50) and offset pagination with a has_more flag.
trace_path accepts either an absolute local path or an HTTPS URL — the server downloads the file automatically and caches it for the session.
DOM / UI analysis
Root-cause analysis
Performance analysis
💬 Suggested agent workflow
🚀 Setup
Build from source
Add to your MCP client
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json)
Cursor (.cursor/mcp.json) or VS Code (.vscode/mcp.json)
Claude Code
Docker
💬 Example usage
Basic failure analysis
Ask your agent:
"The CI run failed. Here's the trace:
/tmp/trace.zip. What went wrong and why?"
The agent calls get_trace_summary → get_causal_chain_for_failure → get_aria_accessibility_tree, drilling deeper as needed — without you copy-pasting anything.
When the page was blank or redirected
"The ARIA tree is empty. Can you show me what was actually on screen when it failed?"
The agent calls get_screenshot_at_failure and gets the JPEG taken closest to the moment of failure — useful for catching captchas, error pages, or unexpected redirects.
Flakiness diagnosis
"This test passes locally but fails in CI. Compare these two traces and tell me what was different."
The agent calls compare_traces, which LCS-aligns both action sequences and surfaces the first structural divergence, timing anomalies, and network requests that only appeared in the failing run.
Grouping duplicate failures across parallel CI runs
"We have 12 failed traces from this pipeline. Are they all the same failure?"
Call generate_error_signature on each — identical signatures mean identical root cause, no need to read every trace.
Diagnosing which API call caused a DOM change
"The modal appeared but I don't know which fetch triggered it."
correlate_dom_and_network joins the HAR log and DOM snapshots automatically. Example output:
Performance timeouts — not just missing elements
"The test times out on
goto, but there's no JS error. What's blocking the page?"
detect_performance_anomalies inspects screencast-frame gaps and flags Long Tasks. Example output:
suspected_cause distinguishes a blocked main thread (main_thread_blocked — frame gaps present), a waterfall of concurrent fetches (network_saturation — ≥5 in-flight), and a navigation/hard timeout (timeout_or_navigation — duration >3 s with no other signals).
Checking what Playwright version and HAR mode a trace uses
"The trace came from an unfamiliar CI configuration. Is the response body data available?"
extract_trace_metadata_strict inspects the archive before you run any other tool:
har_mode: "embed" means body snippets are inline. "attach" means they're in separate resource files. "omit" means headers only — correlate_dom_and_network will return empty response_body_snippet in that case.
🏗️ Architecture
The parser streams each file line-by-line (no full-buffer split) and caches results in-process with an LRU (max 50 entries), keyed by path + mtime. Re-reading the same unmodified trace costs zero I/O.
Frame snapshots store the DOM as nested arrays (["TAG", {attrs}, ...children]). The ARIA translator walks this tree and outputs compact YAML, reducing token cost by ~90% vs raw HTML.
🏗️ Stack
@modelcontextprotocol/sdk— MCP server runtimeadm-zip— zip extractionzodv4 — input schema validation- TypeScript, ESLint, Prettier, Husky, GitHub Actions CI
📋 Scripts
📄 License
MIT
Source: README.md at commit ad56aec
Tools
0Version history
1- v0.2.3LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts