Fix health endpoint to comply with MCP Gateway Spec v1.3.0 Section 8.1.1#150
Merged
Conversation
- Add MCPGatewaySpecVersion constant (1.3.0) - Add ServerStatus struct for server health tracking - Add GetServerStatus() method to UnifiedServer - Update health endpoint response in routed.go, transport.go - Change status from "ok" to "healthy"/"unhealthy" - Add specVersion, gatewayVersion, and servers fields - Remove protocolVersion field (not in spec) - Update health_test.go to verify new response format - All health endpoint tests passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- make agent-finished: ALL PASSED - Unit tests: ALL PASSED (100+ tests) - Integration tests: ALL PASSED - Format, build, lint: ALL PASSED - Manual verification: CONFIRMED - Spec compliance: VERIFIED Health endpoint now returns spec-compliant response per MCP Gateway Spec v1.3.0 Section 8.1.1 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix health endpoint non-compliance with specification
Fix health endpoint to comply with MCP Gateway Spec v1.3.0 Section 8.1.1
Jan 11, 2026
pelikhan
approved these changes
Jan 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
/healthendpoint returned a non-compliant response format withstatus: "ok",protocolVersion, andversionfields instead of the spec-requiredstatus: "healthy|unhealthy",specVersion,gatewayVersion, andserversfields.Changes
internal/server/unified.go:MCPGatewaySpecVersion = "1.3.0"constantServerStatusstruct withstatusanduptimefieldsGetServerStatus()method returning server health mapStartTimefield toSessionfor uptime trackinginternal/server/routed.goandinternal/server/transport.go:"ok"to"healthy"(or"unhealthy"when servers error)protocolVersionwithspecVersion: "1.3.0"versiontogatewayVersionserversfield with server status mapinternal/server/health_test.go:map[string]stringtomap[string]interface{}Response Format
Before:
{ "status": "ok", "protocolVersion": "2024-11-05", "version": "dev" }After:
{ "status": "healthy", "specVersion": "1.3.0", "gatewayVersion": "dev", "servers": { "github": { "status": "running", "uptime": 0 } } }Original prompt
This section details on the original issue you should resolve
<issue_title>[compliance] Health Endpoint Non-Compliance with Specification Section 8.1.1</issue_title>
<issue_description>## Summary
The
/healthendpoint does not conform to the MCP Gateway Specification v1.3.0, Section 8.1.1. Despite PR #140 titled "update-health-endpoint", the endpoint response format does not match the required specification.Specification Version: 1.3.0
Commit Reviewed: 2e8c29f
Severity: Critical (MUST violation)
Critical Issue: Incorrect Health Endpoint Response Format
Specification Requirement (Section 8.1.1)
Deep Link: https://github.com/githubnext/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md#811-general-health-health
The specification REQUIRES the following response format:
{ "status": "healthy" | "unhealthy", "specVersion": "string", "gatewayVersion": "string", "servers": { "server-name": { "status": "running" | "stopped" | "error", "uptime": 12345 } } }Required Fields (per spec):
status(string, Yes) - Overall gateway health status: "healthy" or "unhealthy"specVersion(string, Yes) - MCP Gateway Specification version (e.g., "1.3.0")gatewayVersion(string, Yes) - Gateway implementation version (e.g., "0.1.0")servers(object, Yes) - Map of server names to their health statusCurrent Implementation
Files:
internal/server/routed.go:114-120internal/server/transport.go:162-168internal/server/server.go:53-58Current Response:
{ "status": "ok", "protocolVersion": "2024-11-05", "version": "dev" }Problems:
"status": "ok"instead of"status": "healthy"or"status": "unhealthy"specVersion(specification version like "1.3.0")versioninstead of required field:gatewayVersionservers(server health status map)protocolVersionwhich is not part of the specSpecification Quote
Deep Link: https://github.com/githubnext/gh-aw/blob/main/docs/src/content/docs/reference/mcp-gateway.md#L680-L692
Impact
This non-compliance affects:
Related Test Requirements:
Root Cause
PR #140 was titled "update-health-endpoint" but appears to have not actually updated the response format to match specification v1.3.0. The endpoint implementation in
routed.go,transport.go, andserver.goall use the old response format.Remediation Tasks
Task 1: Update Health Endpoint Response Format
Description: Modify all health endpoint handlers to return spec-compliant response
Files to Modify:
internal/server/routed.go(lines 114-120)internal/server/transport.go(lines 162-168)internal/server/server.go(lines 53-58)Required Changes:
specVersionfield: Return the specification version (e.g., "1.3.0")versiontogatewayVersion: Use the gateway implementation versionprotocolVersionfield: Not part of the specstatusvalues: Use "healthy" or "unhealthy" instead of "ok"serversfield: Include map of server health statusExample Implementation: