-
Notifications
You must be signed in to change notification settings - Fork 20
[compliance] Compliance Gap: Health Monitoring - Server Status Always Reports "running" with Zero Uptime #2914
Description
MCP Gateway Compliance Review - 2026-03-31
Summary
Found 1 compliance issue during daily review of commit 3b4c53f (fix: lower repo-assist min-integrity to unapproved).
Note: Previously tracked issue spec-version-constant (MCPGatewaySpecVersion was 1.8.0) has been resolved — the constant now correctly reports 1.9.0.
Recent Changes Reviewed
- Commit
3b4c53f:fix: lower repo-assist min-integrity to unapproved— workflow configuration change only, no impact on gateway core compliance. - All other specification sections remain compliant (see Compliance Status table below).
Important Issues (Persistent SHOULD Violation)
1. GetServerStatus() Always Reports "running" with Zero Uptime
Specification Section: Section 8 — Health Monitoring
Deep Link: https://github.com/github/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md#8-health-monitoring
Requirement:
Health check includes server uptime and status
Periodic health checks (every 30 seconds recommended)
Automatic restart of failed stdio servers
Current State:
internal/server/unified.go lines 584–604 — GetServerStatus() hardcodes every configured server as "running" and always returns Uptime: 0, regardless of actual connection state:
status[serverID] = ServerStatus{
Status: "running",
Uptime: 0, // Will be properly tracked when servers are actually launched
}The TODO comment ("Will be properly tracked when servers are actually launched") confirms this is a known stub.
Gap:
- Inaccurate status: The
/healthendpoint always reports all servers as"running", even if they have crashed, never been contacted, or encountered errors. TheBuildHealthResponse()logic only transitions to"unhealthy"whenstatus.Status == "error", which can never happen with the current stub. - Zero uptime:
Uptimeis always0— server start times are never tracked. - No periodic health checks: There is no background goroutine performing periodic health checks (only a connection pool cleanup ticker exists in
internal/launcher/connection_pool.go:101). - No automatic restart: Failed stdio servers are not automatically restarted.
Severity: Important (SHOULD violation — spec recommends proactive health tracking and restarts)
File References:
internal/server/unified.go:584–604—GetServerStatus()stubinternal/server/health.go:30–36— Health logic that relies on accurate statusinternal/launcher/launcher.go:206–252— Server launch logic with no state tracking
Suggested Fix:
-
Track server connection state in the launcher — Record whether each server has been successfully launched, its start time, and whether its connection has errored:
type ServerState struct { Status string // "running" | "stopped" | "error" StartedAt time.Time }
-
Return actual status — In
GetServerStatus(), query the launcher for real connection state instead of hardcoding"running". -
Track uptime — Store the
time.Now()when a server is successfully launched; returnint(time.Since(startedAt).Seconds())for uptime. -
Optional (SHOULD): Add a background health-check goroutine that pings each backend every 30 seconds and updates server state accordingly.
Compliance Status
| Section | Status | Notes |
|---|---|---|
| ✅ Configuration Format (§4.1) | Compliant | mcpServers, all fields, error messages with JSONPath |
| ✅ Variable Expansion (§4.2) | Compliant | \$\{VAR_NAME} with fail-fast on undefined |
| ✅ Containerization (§3.2.1) | Compliant | Docker enforced, direct commands blocked |
| ✅ Protocol Behavior (§5) | Compliant | POST /mcp/{server}, GET /health, POST /close, JSON-RPC 2.0 |
| ✅ Server Isolation (§6) | Compliant | Per-session containers, isolated streams |
| ✅ Authentication (§7) | Compliant | API key validation, health exemption, key masking in logs |
| Issue | Status always "running", uptime always 0, no periodic checks | |
| ✅ Error Handling (§9) | Compliant | Exit code 1 on startup failure, standard JSON-RPC error codes |
| ✅ Spec Version | Compliant | MCPGatewaySpecVersion = "1.9.0" |
Resolved Since Last Review
- ✅ spec-version-constant:
MCPGatewaySpecVersionupdated from1.8.0→1.9.0
References
- MCP Gateway Specification
- Commits reviewed:
3b4c53f - Previous review: 2026-03-30
Note
🔒 Integrity filter blocked 1 item
The following item were blocked because they don't meet the GitHub integrity level.
- get_file_contents
get_file_contents: has lower integrity than agent requires. The agent cannot read data with integrity below "unapproved".
To allow these resources, lower min-integrity in your GitHub frontmatter:
tools:
github:
min-integrity: approved # merged | approved | unapproved | noneGenerated by Daily Compliance Checker · ◷