Reproducing gh-absent startup behavior
This document contains steps to reproduce the server behavior when the GitHub CLI (gh) is not installed or not present on the process PATH.
Purpose
- Provide reproducible steps for maintainers and CI to validate the server's behavior when
ghis absent. - Provide quick remediation commands for users.
Reproduction (temporary PATH removal)
- Open PowerShell in the repository root.
- Save the current PATH and start a session with
ghremoved from PATH for the session only:
$origPATH = $env:PATH
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -notmatch 'GitHub CLI' -and $_ -notmatch 'GitHub' }) -join ';'
<h1 class="neo-h1" data-record-id="2">Start the MCP stdio server in this session (gh will be hidden)</h1>
node C:/dev/open_source/neo/ai/mcp/server/github-workflow/mcp-server.mjs --debug
<h1 class="neo-h1" data-record-id="3">When finished, restore your PATH</h1>
$env:PATH = $origPATH
- Observe the server startup logs. Expected behavior:
- The server should not crash.
- HealthService should report a clear message indicating
ghis not installed or not available in PATH. - The server should start and continue to run with tools disabled until
ghbecomes available.
Alternative single-command test (no session PATH change)
cmd /C "set PATH=C:\Windows\System32;C:\Windows; & node C:\dev\open_source\neo\ai\mcp\server\github-workflow\mcp-server.mjs --debug"
Runbook / Remediation
- If
ghis missing: install from https://cli.github.com/ - If
ghis installed but unauthenticated: rungh auth loginand follow the prompts.
Acceptance criteria
- Logs contain a clear, actionable message when
ghis absent (e.g., "GitHub CLI is not installed or not available in PATH. Please install it or rungh auth login."). - Server does not exit or crash when
ghis absent.