MCP server + Playwright reporter that builds a flakiness knowledge graph from test run history
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A Playwright custom reporter + MCP server that builds a local flakiness knowledge graph from your test run history. Ask your AI agent which tests are unreliable, on which browser, and whether they're getting worse.
A single Playwright trace tells you what failed right now. It doesn't tell you whether this test has been silently flaking for two weeks, or only fails on Firefox in CI, or is getting slower with every release.
This tool fixes that by accumulating run history into a SQLite database and exposing it to AI agents via MCP.
| Tool | Arguments | What it returns |
|---|---|---|
get_flaky_tests | db_path, min_runs?, limit?, since_days? | Tests ranked by flakiness rate (failed+flaky / total runs) |
get_test_history | db_path, test_id, limit? | Full run history for a specific test β status, duration, error, retry, browser, OS |
get_failure_patterns | db_path, since_days? | Failure rates broken down by browser Γ OS combination |
get_slow_tests | db_path, limit? | Tests ranked by average duration |
get_error_groups | db_path, min_failures?, limit?, since_days? | Failures clustered by exact error prefix β surfaces shared root causes across tests |
get_flakiness_trend | db_path, test_id, days? | Daily flakiness rate over the last N days β shows whether a test is getting worse |
cluster_semantic_error_trees | db_path, min_instances?, since_days? | Like get_error_groups but normalises dynamic values (UUIDs, IDs, URLs) first, then fuzzy-merges with Levenshtein |
correlate_git_commit_flakiness | db_path, min_stable_runs?, since_days? | Finds the exact commit SHA where a test transitioned stableβflaky (or back), with branch and author |
Or build from source:
Run your tests normally β the reporter writes every result to flakiness.db automatically.
.cursor/mcp.json or .vscode/mcp.json)No Playwright project yet? Generate 30 days of realistic sample data:
Then point your AI agent at ./demo.db to explore all 8 tools.
get_error_groups clusters by raw string prefix β if the error contains a UUID or element ID it creates separate groups for what is really one root cause. cluster_semantic_error_trees strips dynamic values first:
correlate_git_commit_flakiness uses a state machine β it looks for runs where a test was stable for β₯3 consecutive passes, then failed. The transition record includes the SHA from the CI environment:
The reporter reads GITHUB_SHA / CI_COMMIT_SHA / CIRCLE_SHA1 / GIT_COMMIT automatically β no reporter config changes needed beyond upgrading to v0.2.0.
These two MCP servers are designed to complement each other:
Combined, an AI agent can diagnose whether a CI failure is a known flaky test or a new regression β without you opening a single file.
flakiness-knowledge-graph-mcp uses an in-process write queue to ensure that parallel Playwright workers within a single Node process do not corrupt the database.
However, if you run tests across multiple independent processes (e.g., parallel CI shards or separate machine runners) writing to the same shared network file:
flakiness-shard-1.db, flakiness-shard-2.db).For local development or single-machine CI runs, the default configuration is safe.
sql.js is used instead of better-sqlite3 β pure JavaScript SQLite compiled to WebAssembly, no native compilation needed. The git columns are added via ALTER TABLE migration on first use β existing databases upgrade automatically.
MIT
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/flakiness-knowledge-graph-mcp)<a href="https://allmcps.com/mcp/flakiness-knowledge-graph-mcp"><img src="https://allmcps.com/api/badge/flakiness-knowledge-graph-mcp?style=directory" alt="Flakiness Knowledge Graph MCP on AllMCPs" /></a>