
Flakiness Knowledge Graph Mcp
io.github.vola-treblaPublished by GitHub account vola-treblav0.2.2Updated Oct 24, 2026
MCP server + Playwright reporter that builds a flakiness knowledge graph from test run history
Overview
A local MCP server and Playwright reporter that records test run history in SQLite and lets an assistant query flaky tests, failure patterns and trends.
- What you can do
- Rank tests by flakiness rate and average duration, filtered by run count or recent days (get_flaky_tests, get_slow_tests). Retrieve a single test's full run history with status, duration, error, retry, browser and OS (get_test_history). Break failure rates down by browser and OS combination (get_failure_patterns). Cluster failures by raw error prefix, or by normalized and fuzzy-merged messages that strip dynamic values (get_error_groups, cluster_semantic_error_trees). Track a test's daily flakiness rate over time and find the commit where it went stable-to-flaky, with branch and author (get_flakiness_trend, correlate_git_commit_flakiness).
- When to use it
- Use it when a Playwright suite has been running long enough to accumulate history and you want an assistant to tell you which tests are unreliable, on which browser or OS they fail, whether they are getting worse, and which commit introduced the flakiness.
- Requirements
- Runs as a local stdio process installed from npm (flakiness-knowledge-graph-mcp), so Node.js is needed. A SQLite database file must exist; it is produced by adding the bundled Playwright reporter to playwright.config.ts, or generated as demo data with the seed script. Each tool call takes the database path as an argument. No authentication, API keys or environment variables are declared.
Installation
In SourceWeft
- Open Flakiness Knowledge Graph 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
📊 flakiness-knowledge-graph-mcp
[npm version] [npm downloads] [CI] [License: MIT]
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.
🤔 The Problem
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.
🛠️ Tools
🚀 Setup
1. Install
Or build from source:
2. Add the reporter to your Playwright project
Run your tests normally — the reporter writes every result to flakiness.db automatically.
3. Add the MCP server to your editor
Cursor / VS Code (.cursor/mcp.json or .vscode/mcp.json)
Claude Code
4. Try it with demo data
No Playwright project yet? Generate 30 days of realistic sample data:
Then point your AI agent at ./demo.db to explore all 8 tools.
💬 Example usage
Grouping errors that look different but aren't
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:
Finding the commit that broke a test
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.
🔗 Works great with playwright-trace-decoder-mcp
These two MCP servers are designed to complement each other:
- flakiness-knowledge-graph-mcp answers "is this test flaky historically, and which commit caused it?"
- playwright-trace-decoder-mcp answers "what exactly failed in this specific run?"
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.
⚖️ Parallel Execution & CI Sharding
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:
- Race Conditions: Standard file systems do not guarantee atomic writes for SQLite files across processes without OS-level locking.
- Recommended Approach: Each CI shard should write to its own database file (e.g.,
flakiness-shard-1.db,flakiness-shard-2.db). - Merging: At the end of the CI pipeline, you can merge these files into a single master database using standard SQLite tools or by running a script that reads from one and inserts into the other.
For local development or single-machine CI runs, the default configuration is safe.
🏗️ Architecture
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.
📋 Scripts
📄 License
MIT
Source: README.md at commit 096ace2
Tools
0Version history
1- v0.2.2LatestSep 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