LearnNewsExamplesServices

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 gh is absent.
  • Provide quick remediation commands for users.

Reproduction (temporary PATH removal)

  1. Open PowerShell in the repository root.
  2. Save the current PATH and start a session with gh removed 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
  1. Observe the server startup logs. Expected behavior:
    • The server should not crash.
    • HealthService should report a clear message indicating gh is not installed or not available in PATH.
    • The server should start and continue to run with tools disabled until gh becomes 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 gh is missing: install from https://cli.github.com/
  • If gh is installed but unauthenticated: run gh auth login and follow the prompts.

Acceptance criteria

  • Logs contain a clear, actionable message when gh is absent (e.g., "GitHub CLI is not installed or not available in PATH. Please install it or run gh auth login.").
  • Server does not exit or crash when gh is absent.