To ensure the github-workflow server is always in a valid state, it should perform a comprehensive health check upon startup and refuse to run if its critical dependencies are not met. This prevents any tool from executing in a broken environment.
This will be achieved by leveraging the existing HealthService.
Acceptance Criteria
- The
main() function in ai/mcp/server/github-workflow/mcp-stdio.mjs is updated.
- It must import the
HealthService.
- Before the server connects to the transport, it must call
HealthService.healthcheck().
- It must inspect the response payload from the health check.
- If
payload.status is 'unhealthy', the server must:
a. Log a clear error message to stderr indicating that the server is aborting.
b. Log the detailed reasons for the failure from payload.githubCli.details.
c. Terminate the process with a non-zero exit code (e.g., process.exit(1)).
Benefits
- Fail-Fast Principle: The server aborts immediately if its dependencies (like
gh CLI) are not correctly installed, authenticated, and versioned.
- Robustness: Prevents any tool from being called when the server is in an invalid state.
- Clear Errors: Provides immediate, actionable feedback to the user if their environment is not configured correctly.
- DRY: Reuses the existing, comprehensive logic in
HealthService instead of duplicating checks.
To ensure the
github-workflowserver is always in a valid state, it should perform a comprehensive health check upon startup and refuse to run if its critical dependencies are not met. This prevents any tool from executing in a broken environment.This will be achieved by leveraging the existing
HealthService.Acceptance Criteria
main()function inai/mcp/server/github-workflow/mcp-stdio.mjsis updated.HealthService.HealthService.healthcheck().payload.statusis'unhealthy', the server must: a. Log a clear error message tostderrindicating that the server is aborting. b. Log the detailed reasons for the failure frompayload.githubCli.details. c. Terminate the process with a non-zero exit code (e.g.,process.exit(1)).Benefits
ghCLI) are not correctly installed, authenticated, and versioned.HealthServiceinstead of duplicating checks.