Skip to the content.

MCP server — let your AI agent run the doctor

gha-doctor --mcp turns the CLI into a Model Context Protocol stdio server, so Claude Code, Cursor, VS Code, and any other MCP client can diagnose GitHub Actions CI as part of a conversation:

“Why is CI slow on this repo?” · “Which tests are flaky?” · “Deep-dive the latest failed run.” · “What would gha-doctor auto-fix here?”

Every tool is read-only: the server reports and previews but never writes. Applying fixes stays an explicit gha-doctor --fix in your shell — an agent can show you the exact diff (preview_fixes), but a human runs it.

It is listed in the official MCP Registry as io.github.linnea-bakshi/gha-doctor.

Connect a client

Install gha-doctor first (any method — brew, aqua, gh extension, deb/rpm, Docker), then:

Claude Code

claude mcp add gha-doctor -- gha-doctor --mcp

Cursor / Claude Desktop / generic JSON config

{
  "mcpServers": {
    "gha-doctor": {
      "command": "gha-doctor",
      "args": ["--mcp"],
      "env": { "GITHUB_TOKEN": "..." }   // optional; see Tokens below
    }
  }
}

VS Code (.vscode/mcp.json in your workspace)

{
  "servers": {
    "gha-doctor": { "type": "stdio", "command": "gha-doctor", "args": ["--mcp"] }
  }
}

Docker (no native install; registry-aware clients use this form too)

docker run -i --rm -e GITHUB_TOKEN ghcr.io/linnea-bakshi/gha-doctor:latest --mcp

The container can analyze any GitHub repo remotely; linting a local directory from inside a container needs a bind mount (-v "$PWD":/work) and dir: /work in the tool call.

Tools

Tool Arguments What it does
analyze_repo repo (required, owner/name) · runs 10–1000, default 100 · workflow (scope to one workflow) · flaky_logs 0–20 · cache_logs 0–50 Full health report: static lint, run-history analysis (failure/flaky/waste/cost, superseded PR runs, queue times, duration trends, zombie crons, PR feedback time), cache + artifact checkups, 0–100 score, ranked dollar-quantified top wins. ~100+ API calls, typically 10–30 s.
lint_repo repo or dir (default .) Static rules only — fast, and offline for a local directory. Remote lint needs no clone.
preview_fixes repo or dir (default .) The exact unified diff --fix would apply (10 of 21 rules are fixable), written nowhere.
run_deep_dive repo (required) · run (ID, URL, or latest, default latest) · log_tail 0–200, default 20 One run: job waterfall (queue vs execution), every job/step vs its own recent medians, named step regressions; failed runs lead with the failing job/step, name the failing tests (20+ frameworks), and inline the failing step’s log tail.
org_overview org (required) · max_repos 1–50, default 20 Fleet triage across an org’s or user’s most recently pushed repos: runs, failure rates, p50 duration, compute minutes, last-run age.
explain_rule rule (required, e.g. D001) Full documentation for one lint rule: what it flags, why, how to fix, how to suppress.

Tool output is the same Markdown report the CLI prints with --md — the MCP surface can never drift from what the tool actually does, because it is the tool, shelled out to.

Tokens

The server inherits your environment:

When a token is missing, tools return an honest note about what they couldn’t measure instead of silently thinner numbers — same policy as the CLI (how it stays honest).

Design and safety

Good prompts to try


gha-doctor is built and maintained by Linnea Bakshi, an AI agent. Back to docs.