You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add MCP/Context7 connectivity assertion to daily-pr-review-health #903
MCP health is currently only observable as a fail-loud ::warning::[mcp] on real PR reviews (by design, _emit_mcp_failure_warning in scripts/engine.sh — it never logs success). There is no durable, affirmative monitor that Context7 (the configured review-mcp.json server) is actually reachable; a silent outage would only surface when a review happens to run.
Ask
Add an explicit MCP-connectivity assertion to .github/workflows/daily-pr-review-health.yml (and/or scripts/pr_review_health.sh):
When .github/review-mcp.json is present, run the configured server(s) through the same flags engine.sh uses (--mcp-config .github/review-mcp.json --strict-mcp-config --debug mcp) and assert the handshake (MCP server "…": Successfully connected).
Fail the health check if MCP is configured but unreachable; skip/no-op when MCP isn't configured (no behavior change for non-MCP repos).
Issue:#903 — Add MCP/Context7 connectivity assertion to daily-pr-review-health
Scope
Add a durable, affirmative MCP-connectivity assertion to the daily PR-review health check: when .github/review-mcp.json is present, run the configured server(s) through the same flags engine.sh uses (--mcp-config … --strict-mcp-config --debug mcp), assert the MCP server "…": Successfully connected handshake, and fail the health check if MCP is configured but unreachable. No-op when MCP isn't configured.
Implementation Checklist
scripts/mcp_connectivity_check.sh — new script following the pure-helper + main() pattern (mirrors scripts/initiative_canary.sh):
pure classify_mcp_output (CONNECTED / FAILED / NO_HANDSHAKE), mcp_check_is_failure, mcp_check_report
main(): resolve config path (default .github/review-mcp.json), skip/no-op when absent; else derive mcp__<server>__* allowlist from the config, invoke claude --print --debug mcp --mcp-config … --strict-mcp-config --allowed-tools …, classify, emit ::notice::[mcp] on success / ::error:: + exit 1 on failure
reuse the REVIEW_MCP_DEBUG knob so the affirmative ::notice::[mcp] is the success signal
.github/workflows/daily-pr-review-health.yml — add an additive final step that runs the assertion, guarded by hashFiles('.github/review-mcp.json') so non-MCP repos are unaffected; sets REVIEW_MCP_DEBUG: '1'
.github/workflows/lint.yml — register the new bats test file in the bats job list
Added scripts/mcp_connectivity_check.sh — pure helpers (classify_mcp_output, mcp_check_is_failure, derive_allowed_tools, mcp_check_report) + main() that probes the configured server(s) through the same flags engine.sh threads (--mcp-config … --strict-mcp-config --debug mcp) and asserts the MCP server "…": Successfully connected handshake
Skips/no-ops (exit 0) when MCP isn't configured; fails (exit 1) when MCP is configured but unreachable — and treats no handshake at all as a failure (a durable monitor must not pass on the mere absence of an error)
Wired into .github/workflows/daily-pr-review-health.yml as an additive final step, guarded by hashFiles('.github/review-mcp.json') so non-MCP repos are unaffected
Registered tests/test_mcp_connectivity_check.bats in the lint.ymlbats job
Repo lint (.dev-lead/scripts/dev-lead-lint.sh) + shellcheck clean; both workflow YAMLs validated
Test Results
20 new tests — tests/test_mcp_connectivity_check.bats:
ok 1..7 classify_mcp_output (CONNECTED / FAILED / NO_HANDSHAKE; case-insensitive; empty→NO_HANDSHAKE)
ok 8..10 mcp_check_is_failure (only CONNECTED is non-failure)
ok 11..13 derive_allowed_tools (single/multi server, no-server→empty)
ok 14..15 mcp_check_report (CONNECTED / FAILED rendering)
ok 16 main: healthy handshake → exit 0, ::notice::[mcp], engine.sh flags passed
ok 17 main: connection failure → exit 1, ::error::, MCP_FAILED set
ok 18 main: no handshake at all → exit 1 (silent outage = failure)
ok 19 main: MCP not configured → skip/no-op, exit 0
ok 20 main: REVIEW_MCP_ALLOWED_TOOLS overrides the derived allowlist
dev-lead-lint.sh: shellcheck (75 files) + agent profiles → all checks passed
shellcheck --severity=warning -x scripts/mcp_connectivity_check.sh → clean
.github/workflows/lint.yml: registered the new bats file in the bats job
Notes
The probe relies on the fact that with --debug mcp --strict-mcp-config the CLI connects to the configured servers at session start (to enumerate tools), so a trivial prompt is enough to force the handshake — matching the feat(pr-review): add REVIEW_MCP_DEBUG knob to surface the MCP handshake #892 verification reference. The allowlist is derived from the config's mcpServers keys (mcp__<server>__*), overridable via REVIEW_MCP_ALLOWED_TOOLS.
The assertion is the last step in the workflow so it is purely additive: the existing log-analysis report still runs/posts; the job conclusion now also reflects MCP health.
Activity
don-petry commentedon Jun 22, 2026
Dev-Lead Implementation Plan
Issue: #903 — Add MCP/Context7 connectivity assertion to daily-pr-review-health
Scope
Add a durable, affirmative MCP-connectivity assertion to the daily PR-review health check: when
.github/review-mcp.jsonis present, run the configured server(s) through the same flagsengine.shuses (--mcp-config … --strict-mcp-config --debug mcp), assert theMCP server "…": Successfully connectedhandshake, and fail the health check if MCP is configured but unreachable. No-op when MCP isn't configured.Implementation Checklist
scripts/mcp_connectivity_check.sh— new script following the pure-helper +main()pattern (mirrorsscripts/initiative_canary.sh):classify_mcp_output(CONNECTED / FAILED / NO_HANDSHAKE),mcp_check_is_failure,mcp_check_reportmain(): resolve config path (default.github/review-mcp.json), skip/no-op when absent; else derivemcp__<server>__*allowlist from the config, invokeclaude --print --debug mcp --mcp-config … --strict-mcp-config --allowed-tools …, classify, emit::notice::[mcp]on success /::error::+ exit 1 on failureREVIEW_MCP_DEBUGknob so the affirmative::notice::[mcp]is the success signal.github/workflows/daily-pr-review-health.yml— add an additive final step that runs the assertion, guarded byhashFiles('.github/review-mcp.json')so non-MCP repos are unaffected; setsREVIEW_MCP_DEBUG: '1'.github/workflows/lint.yml— register the new bats test file in thebatsjob listTests to Write
tests/test_mcp_connectivity_check.bats:classify_mcp_output: success handshake → CONNECTED; explicit failure marker → FAILED; neither → NO_HANDSHAKEmcp_check_is_failure: only CONNECTED is non-failuremain()with a mockedclaudeon PATH: healthy handshake → exit 0 +::notice::[mcp]; failure/no-handshake → exit 1 +::error::; missing config → skip/no-op exit 0; passes the engine.sh flags (--mcp-config,--strict-mcp-config,--debug mcp)Test Command
bats tests/test_mcp_connectivity_check.bats(full suite viascripts/run-bats.sh …), plusbash .dev-lead/scripts/dev-lead-lint.shdon-petry commentedon Jun 22, 2026
Dev-Lead: Implementation Complete
Plan Execution
scripts/mcp_connectivity_check.sh— pure helpers (classify_mcp_output,mcp_check_is_failure,derive_allowed_tools,mcp_check_report) +main()that probes the configured server(s) through the same flagsengine.shthreads (--mcp-config … --strict-mcp-config --debug mcp) and asserts theMCP server "…": Successfully connectedhandshakeREVIEW_MCP_DEBUGknob (feat(pr-review): add REVIEW_MCP_DEBUG knob to surface the MCP handshake #892): emits the affirmative::notice::[mcp]inengine.sh's exact format as the success signal.github/workflows/daily-pr-review-health.ymlas an additive final step, guarded byhashFiles('.github/review-mcp.json')so non-MCP repos are unaffectedtests/test_mcp_connectivity_check.batsin thelint.ymlbatsjob.dev-lead/scripts/dev-lead-lint.sh) + shellcheck clean; both workflow YAMLs validatedTest Results
Files Changed
scripts/mcp_connectivity_check.sh(new): the connectivity assertion (pure helpers +main()), layout mirrorsscripts/initiative_canary.shtests/test_mcp_connectivity_check.bats(new): 20 unit/integration tests (pure helpers + mocked-claudemain()).github/workflows/daily-pr-review-health.yml: added theAssert MCP connectivitystep (additive,hashFiles-guarded,REVIEW_MCP_DEBUG: '1').github/workflows/lint.yml: registered the new bats file in thebatsjobNotes
--debug mcp --strict-mcp-configthe CLI connects to the configured servers at session start (to enumerate tools), so a trivial prompt is enough to force the handshake — matching the feat(pr-review): add REVIEW_MCP_DEBUG knob to surface the MCP handshake #892 verification reference. The allowlist is derived from the config'smcpServerskeys (mcp__<server>__*), overridable viaREVIEW_MCP_ALLOWED_TOOLS.tests/dev-lead/unit/test_engine_mcp.batstest Compliance: claude-missing-check-run-trigger #64 ("debug: REVIEW_MCP_DEBUG set + healthy handshake → ::notice:: surfaced") fails in this environment even on a clean branch (verified by stashing all of my changes). It is unrelated to Add MCP/Context7 connectivity assertion to daily-pr-review-health #903 and was left untouched per the "do not modify unrelated files" constraint.Harden MCP connectivity check per review feedback (#903)
Add MCP/Context7 connectivity assertion to daily PR-review health che…
feat: implement issue #903 — Add MCP/Context7 connectivity assertion …
feat: implement issue #903 — Add MCP/Context7 connectivity assertion …
Add MCP/Context7 connectivity assertion to daily PR-review health che…
feat: implement issue #903 — Add MCP/Context7 connectivity assertion …