triagekit-mcp-flaky-test-detective
Part of the TriageKit MCP server suite.
Tells flaky tests from genuinely broken ones using real CI run history — instead of an engineer guessing "probably flaky, re-run it" or a broken test getting rubber-stamped past review because nobody has time to check.
Why
CI red gets treated one of two bad ways: blindly re-run until green (masking a real bug), or dismissed as "that test is always flaky" (hiding a regression). This server pulls a test's actual pass/fail history from GitHub Actions, classifies the pattern deterministically, clusters failures by root cause, and checks for infra correlation — so the decision is based on evidence, not vibes.
Tools
| Tool | What it does |
|---|---|
classify_test_failure |
Classifies a test's recent history as consistently-failing / consistently-passing / intermittent (flaky) / insufficient-data, with run-by-run evidence |
get_flaky_test_leaderboard |
Ranks all tests in a repo's recent CI history by computed flake rate |
diff_failure_stack_traces |
Clusters a test's failures by stack-trace similarity — is "flaky" really 2-3 distinct root causes? |
correlate_flake_with_infra |
Checks whether flake rate correlates with the CI runner — infra contention vs. genuine non-determinism |
suggest_quarantine_candidates |
Returns genuinely intermittent tests above a flake-rate threshold |
file_flaky_test_ticket |
Opens a Jira ticket pre-filled with flake evidence (optional — requires Jira config) |
generate_synthetic_test_data |
Generates synthetic fixtures from a JSON-Schema fragment or example payload |
diff_api_contract |
Diffs two OpenAPI specs and classifies each change as breaking or non-breaking |
Install
Not yet published. This package is not on PyPI or GHCR yet (alpha, pre-release) - the commands below are the intended install path once
triagekit-mcp-coreand this package are published (core must publish first; see CONTRIBUTING.md). Until then, install from a local build:uv build --package triagekit-mcp-core --out-dir dist && uv build --package triagekit-mcp-flaky-test-detective --out-dir dist && uv pip install dist/*.whl.
uvx triagekit-mcp-flaky-test-detective
# or
pip install triagekit-mcp-flaky-test-detective
# or
docker run --rm -i -e TRIAGEKIT_FLAKY_TEST_DETECTIVE_GITHUB_TOKEN ghcr.io/Karthick-dev-cart/triagekit-flaky-test-detective
Quick Start (Claude Desktop / Claude Code)
Add to your mcp.json:
{
"mcpServers": {
"flaky-test-detective": {
"command": "uvx",
"args": ["triagekit-mcp-flaky-test-detective"],
"env": {
"TRIAGEKIT_FLAKY_TEST_DETECTIVE_GITHUB_TOKEN": "ghp_..."
}
}
}
}
Example prompts
- "Is
tests/test_checkout.py::test_apply_discountactually flaky, or just broken? Check the last 30 runs onmyorg/myrepo." - "Give me the flakiest tests in
myorg/myrepoover the last 20 CI runs." - "Are
test_upload_large_file's failures all the same root cause, or several?" - "Does
test_db_connectionfail more often on a specific runner?" - "Which tests in
myorg/myrepoare safe to quarantine right now?" - "Generate 20 synthetic user records matching this example:
{\"id\": 1, \"email\": \"a@b.com\", \"active\": true}." - "Did this OpenAPI spec change introduce any breaking changes vs. the previous version?"
Authentication
| Variable | Required for | Notes |
|---|---|---|
TRIAGEKIT_FLAKY_TEST_DETECTIVE_GITHUB_TOKEN (or native GITHUB_TOKEN) |
All 5 CI-analysis tools | A GitHub PAT (classic or fine-grained) with actions:read on the target repo |
TRIAGEKIT_FLAKY_TEST_DETECTIVE_JIRA_BASE_URL |
file_flaky_test_ticket |
e.g. https://yourteam.atlassian.net |
TRIAGEKIT_FLAKY_TEST_DETECTIVE_JIRA_EMAIL |
file_flaky_test_ticket |
Jira Cloud account email |
TRIAGEKIT_FLAKY_TEST_DETECTIVE_JIRA_API_TOKEN (or native JIRA_API_TOKEN) |
file_flaky_test_ticket |
Create one here |
generate_synthetic_test_data and diff_api_contract need no credentials — they operate
on data you pass directly. See .env.example for a local-dev template.
Credentials are only ever read from the environment at startup — no tool accepts a token as a parameter. See CONTRIBUTING.md for why.
Development
uv sync
uv run pytest packages/flaky-test-detective -v
uv run ruff check packages/flaky-test-detective
uv run pyright packages/flaky-test-detective
License
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file triagekit_mcp_flaky_test_detective-0.1.0.tar.gz.
File metadata
- Download URL: triagekit_mcp_flaky_test_detective-0.1.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7cb417c5e9433f4298debcff54fb7d80b50394f4975e0520a60bc5e0f27cfc14
|
|
| MD5 |
ab24eb932ae585d05f748a536e3be2a3
|
|
| BLAKE2b-256 |
873344b01ddc93492fa8f88559362a087fd05ad29e4d5e0dfad9d970a8007aeb
|
Provenance
The following attestation bundles were made for triagekit_mcp_flaky_test_detective-0.1.0.tar.gz:
Publisher:
release.yml on Karthick-dev-cart/triagekit-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
triagekit_mcp_flaky_test_detective-0.1.0.tar.gz -
Subject digest:
7cb417c5e9433f4298debcff54fb7d80b50394f4975e0520a60bc5e0f27cfc14 - Sigstore transparency entry: 2342100137
- Sigstore integration time:
-
Permalink:
Karthick-dev-cart/triagekit-mcp@38d601edb2ecca46eaba7cff1014c4d342eca16a -
Branch / Tag:
refs/tags/flaky-test-detective-v0.1.0 - Owner: https://github.com/Karthick-dev-cart
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@38d601edb2ecca46eaba7cff1014c4d342eca16a -
Trigger Event:
push
-
Statement type:
File details
Details for the file triagekit_mcp_flaky_test_detective-0.1.0-py3-none-any.whl.
File metadata
- Download URL: triagekit_mcp_flaky_test_detective-0.1.0-py3-none-any.whl
- Upload date:
- Size: 21.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f57d80c81b9677a15db6277d4ba5ba1795ac1054efba5c2fcdb97bb82243221
|
|
| MD5 |
d8939b7b21d74ba6767148c5ff2b4e92
|
|
| BLAKE2b-256 |
0633d9d19c73034a3ebc8bd6a8768ef86042a9f82c040b6c00fcceac9694585f
|
Provenance
The following attestation bundles were made for triagekit_mcp_flaky_test_detective-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Karthick-dev-cart/triagekit-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
triagekit_mcp_flaky_test_detective-0.1.0-py3-none-any.whl -
Subject digest:
9f57d80c81b9677a15db6277d4ba5ba1795ac1054efba5c2fcdb97bb82243221 - Sigstore transparency entry: 2342100164
- Sigstore integration time:
-
Permalink:
Karthick-dev-cart/triagekit-mcp@38d601edb2ecca46eaba7cff1014c4d342eca16a -
Branch / Tag:
refs/tags/flaky-test-detective-v0.1.0 - Owner: https://github.com/Karthick-dev-cart
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@38d601edb2ecca46eaba7cff1014c4d342eca16a -
Trigger Event:
push
-
Statement type: