Skip to content

Add validation for gatewayed MCP servers in health check - #8550

Merged
pelikhan merged 5 commits into
copilot/enable-sandbox-mcp-gatewayfrom
copilot/validate-mcp-gateway-rewrites
Jan 2, 2026
Merged

pelikhan merged 5 commits into
copilot/enable-sandbox-mcp-gatewayfrom
copilot/validate-mcp-gateway-rewrites

Conversation

Copilot AI commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

Refactored Validation to Use Shell Script

  • Create validate_gatewayed_server.sh in actions/setup/sh/
  • Refactor gateway.go to invoke shell script instead of inline validation
  • Update tests to reflect new implementation
  • Verify shell script works correctly
  • Recompile all workflows

Changes

New Shell Script: actions/setup/sh/validate_gatewayed_server.sh

  • Standalone script that validates a single MCP server is correctly gatewayed
  • Takes 3 arguments: SERVER_NAME, MCP_CONFIG_PATH, GATEWAY_URL
  • Performs all validation checks:
    • Server exists in config
    • Server has HTTP URL
    • Server type is "http"
    • URL points to gateway

Refactored: pkg/workflow/gateway.go

  • Replaced inline validation code (~30 lines per server) with single script invocation
  • Much cleaner and more maintainable
  • Example: /tmp/gh-aw/actions/validate_gatewayed_server.sh "github" "/home/runner/.copilot/mcp-config.json" "http://localhost:8080"

Updated: pkg/workflow/gateway_test.go

  • Tests now validate that the script is invoked correctly
  • All tests pass

Before (inline validation)

# Verify github server is gatewayed (has HTTP URL to gateway)
if ! grep -q '"github"' /home/runner/.copilot/mcp-config.json; then
  echo 'ERROR: github server not found in MCP configuration'
  exit 1
fi
github_config=$(jq -r '.mcpServers."github"' /home/runner/.copilot/mcp-config.json)
if [ "$github_config" = "null" ]; then
  echo 'ERROR: github server configuration is null'
  exit 1
fi
# ... 20 more lines ...
echo '✓ github server is correctly gatewayed'

After (shell script invocation)

# Validate github server
/tmp/gh-aw/actions/validate_gatewayed_server.sh "github" "/home/runner/.copilot/mcp-config.json" "http://localhost:8080"

This makes the generated workflow much cleaner and the validation logic easier to maintain and test independently.

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20649923074/job/59292946013#step:23:1

Validate that the MCP gateway awmg rewrites the MCP config file with the "gatewayed" servers (GitHub,Serena,playwright). It does not look like it .


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 2, 2026 03:32
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

pelikhan commented Jan 2, 2026

Copy link
Copy Markdown
Collaborator

@copilot refactor the validation script as a shell script in the actions/setup/sh folder and invoke with arguments.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Validate MCP gateway rewrites config file with gatewayed servers Add validation for gatewayed MCP servers in health check Jan 2, 2026
Copilot AI requested a review from pelikhan January 2, 2026 03:44
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jan 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot refactor the validation script as a shell script in the actions/setup/sh folder and invoke with arguments.

Refactored the validation to use a shell script in commit 24ab794.

Created actions/setup/sh/validate_gatewayed_server.sh which validates that an MCP server is correctly gatewayed. The script takes 3 arguments (server name, config path, gateway URL) and performs all validation checks.

The generated workflow is now much cleaner - instead of ~30 lines of inline validation per server, it's now a single line:

/tmp/gh-aw/actions/validate_gatewayed_server.sh "github" "/home/runner/.copilot/mcp-config.json" "http://localhost:8080"

@pelikhan
pelikhan marked this pull request as ready for review January 2, 2026 03:59
@pelikhan
pelikhan merged commit d750150 into copilot/enable-sandbox-mcp-gateway Jan 2, 2026
@pelikhan
pelikhan deleted the copilot/validate-mcp-gateway-rewrites branch January 2, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants