gha-doctor
v0.66.0Diagnose GitHub Actions CI: lint, flaky tests, wasted minutes, health score.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
analyze_repo
Full CI health report for a GitHub repository: static workflow lint, run-history analysis (success/failure rates, flaky jobs, retry waste, superseded PR runs, queue times, duration trends, zombie crons, PR feedback time), cache and artifact checkups, a 0-100 health score, and a ranked, dollar-quantified top-wins list. Makes ~100+ GitHub API calls and typically takes 10-30 seconds. Optionally set flaky_logs to also read N flaky-failure job logs and name the flaky tests (needs a token), or cache_logs to measure the real cache hit rate from N job logs.
| Parameter | Type | Description |
|---|---|---|
repo * | string | Repository as owner/name, e.g. cli/cli |
cache_logs | integer | Sample N job logs to measure the real cache hit/miss rate (1 API request per log; needs a token) |
flaky_logs | integer | Read N flaky-failure job logs to name the flaky tests (1 API request per log; needs a token) |
runs | integer | Number of recent runs to sample (default 100) |
workflow | string | Scope the history analysis to one workflow (file name like ci.yml, or display name); no health score in scoped mode |
lint_repo
Static lint of GitHub Actions workflows and action manifests only (no run history, fast): 21 rules covering missing timeouts, no concurrency cancellation, dead action versions, retired runner labels, deprecated workflow commands, unguarded crons, and more. Pass repo to lint any GitHub repository via the API (no clone needed), or dir for a local checkout (offline). Defaults to the current directory.
| Parameter | Type | Description |
|---|---|---|
dir | string | Local repository directory to lint (default ".") |
repo | string | Repository as owner/name to lint remotely (mutually exclusive with dir) |
preview_fixes
Preview the exact unified diff that gha-doctor --fix would apply for auto-fixable findings (10 of 21 rules), without writing anything. Pass repo for any GitHub repository (no clone needed) or dir for a local checkout. To actually apply fixes, run `gha-doctor --fix` in the repository — this MCP server never writes.
| Parameter | Type | Description |
|---|---|---|
dir | string | Local repository directory (default ".") |
repo | string | Repository as owner/name (mutually exclusive with dir) |
run_deep_dive
Deep-dive one workflow run: why was it slow, or why did it fail? Job waterfall (queue vs execution), every job and step compared against the workflow's own recent medians, named step regressions; failed runs lead with the failing job and step, name the failing tests (30+ test frameworks recognized), and inline the failing step's log tail (needs a token).
| Parameter | Type | Description |
|---|---|---|
repo * | string | Repository as owner/name |
log_tail | integer | Lines of the failing step's log to include per failed job (default 20, 0 = off; needs a token) |
run | string | Run ID, full run URL, or "latest" (default "latest") |
pr_deep_dive
Diagnose a pull request's CI: every workflow run on the PR's head commit, how long the PR waited for a verdict, re-run smells, and a full deep dive into the latest failed run — failing job and step, named failing tests (30+ frameworks recognized), and the failing step's log tail. The natural first call when someone asks why CI is failing or slow on their PR.
| Parameter | Type | Description |
|---|---|---|
pr * | integer | Pull request number |
repo * | string | Repository as owner/name |
log_tail | integer | Lines of the failing step's log to include per failed job (default 20, 0 = off; needs a token) |
org_overview
Fleet triage across an organization's (or user's) most recently pushed repositories: per-repo run counts, failure rates, median duration, compute minutes, last-run age, and fleet-wide zombie crons (scheduled workflows failing on repeat), one API call per repo. Useful for finding which repository's CI to look at first.
| Parameter | Type | Description |
|---|---|---|
org * | string | GitHub organization or user login |
max_repos | integer | Max repositories to scan, most recently pushed first (default 20) |
explain_rule
Print the full documentation for one lint rule: what it flags, why it matters, how to fix it, and how to suppress it. Rule IDs look like D001; every finding cites one.
| Parameter | Type | Description |
|---|---|---|
rule * | string | Rule ID, e.g. D001 |