triagekit-mcp-flaky-test-detective

v0.1.0
triagekit-mcp-flaky-test-detective Checked 3 days ago Published 4 months ago

MCP server that tells flaky tests from genuinely broken ones using real CI run history, and generates synthetic test data / API contract diffs for QA…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

classify_test_failure

Classify a test's recent pass/fail history as consistently-failing, consistently-passing, intermittent (flaky), or insufficient-data, with the supporting run-by-run evidence attached.

ParameterTypeDescription
repo *stringGitHub repo as "owner/name".
test_name *stringFull test name (e.g. "tests.test_foo.test_bar") or bare test name.
lookback_runsintegerHow many recent workflow runs to pull history from.

get_flaky_test_leaderboard

Rank all tests in a repo's recent CI history by computed flake rate.

ParameterTypeDescription
repo *stringGitHub repo as "owner/name".
lookback_runsintegerHow many recent workflow runs to pull history from.
min_runsintegerMinimum observed runs required for a test to be ranked.

diff_failure_stack_traces

Cluster a test's failures by stack-trace/message similarity, surfacing whether "flaky" is really one root cause or several distinct ones.

ParameterTypeDescription
repo *stringGitHub repo as "owner/name".
test_name *stringFull or bare test name to analyze.
lookback_runsintegerHow many recent workflow runs to pull history from.

correlate_flake_with_infra

Check whether a test's flake rate correlates with the CI runner it executed on - a signal of runner/shard-specific contention rather than genuine non-determinism.

ParameterTypeDescription
repo *stringGitHub repo as "owner/name".
test_name *stringFull or bare test name to analyze.
lookback_runsintegerHow many recent workflow runs to pull history from.

suggest_quarantine_candidates

Return tests whose flake rate is above the threshold and whose pattern is genuinely intermittent (not just consistently broken) - the set worth quarantining.

ParameterTypeDescription
repo *stringGitHub repo as "owner/name".
flake_thresholdnumberMinimum flake rate (0-1) to be considered a quarantine candidate.
lookback_runsintegerHow many recent workflow runs to pull history from.

file_flaky_test_ticket

Open a Jira ticket for a flaky test, pre-filled with flake-rate evidence (typically the dict returned by classify_test_failure or diff_failure_stack_traces). Requires Jira credentials: TRIAGEKIT_FLAKY_TEST_DETECTIVE_JIRA_BASE_URL, _JIRA_EMAIL, and _JIRA_API_TOKEN (or the native JIRA_API_TOKEN env var) - see the README Authentication section. Returns created=False with setup guidance if not configured.

ParameterTypeDescription
evidence *objectStructured findings to include in the ticket description.
project_key *stringJira project key to file the ticket under (e.g. "QA").
repo *stringGitHub repo as "owner/name".
test_name *stringFull or bare test name the ticket is about.

generate_synthetic_test_data

Generate synthetic test fixtures from a JSON-Schema fragment or an example payload.

ParameterTypeDescription
schema_or_example *objectA JSON-Schema-like dict (type/properties/items/...), or - when is_example=True - a realistic example payload to infer a schema from.
countintegerNumber of records to generate (1-1000).
is_examplebooleanSet True when schema_or_example is an example payload rather than a schema.

diff_api_contract

Diff two OpenAPI specs (spec_a = old/baseline, spec_b = new/candidate) and classify each change as breaking or non-breaking - e.g. for a CI contract-testing gate.

ParameterTypeDescription
spec_a *objectThe baseline OpenAPI spec, as a parsed dict (paths/components/...).
spec_b *objectThe candidate OpenAPI spec to compare against the baseline.