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
Release files for triagekit-mcp-flaky-test-detective 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| triagekit_mcp_flaky_test_detective-0.1.0.tar.gz | 21.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| triagekit_mcp_flaky_test_detective-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.3 kB
Release files / triagekit_mcp_flaky_test_detective-0.1.0.tar.gz
| Download URL | triagekit_mcp_flaky_test_detective-0.1.0.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cb417c5e9433f4298debcff54fb7d80b50394f4975e0520a60bc5e0f27cfc14
|
|
BLAKE2b-256 checksum How to use checksums |
873344b01ddc93492fa8f88559362a087fd05ad29e4d5e0dfad9d970a8007aeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency logRelease files / triagekit_mcp_flaky_test_detective-0.1.0-py3-none-any.whl
| Download URL | triagekit_mcp_flaky_test_detective-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f57d80c81b9677a15db6277d4ba5ba1795ac1054efba5c2fcdb97bb82243221
|
|
BLAKE2b-256 checksum How to use checksums |
0633d9d19c73034a3ebc8bd6a8768ef86042a9f82c040b6c00fcceac9694585f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency log