Skip to content

Fix MCP gateway server authentication in connectivity checks#9527

Merged
pelikhan merged 3 commits intomainfrom
copilot/fix-github-actions-workflow-another-one
Jan 10, 2026
Merged

Fix MCP gateway server authentication in connectivity checks#9527
pelikhan merged 3 commits intomainfrom
copilot/fix-github-actions-workflow-another-one

Conversation

Copy link
Contributor

Copilot AI commented Jan 10, 2026

The MCP gateway startup fails when checking server connectivity because the check script doesn't authenticate requests, resulting in 401 errors for all gatewayed servers.

Changes

Modified check_mcp_servers.sh:

  • Added fallback to use gateway API key when server configs lack explicit Authorization headers
  • Maintains backward compatibility for configs with explicit headers

Updated check_mcp_servers_test.sh:

  • Added test coverage for gateway API key fallback behavior

Technical Details

The gateway outputs server configs without Authorization headers in individual server objects. The check script receives the gateway API key as a parameter but wasn't using it as a fallback:

# Before: Only checked config, reported "Authentication: None"
AUTH_HEADER=""
if echo "$SERVER_CONFIG" | jq -e '.headers.Authorization' >/dev/null 2>&1; then
  AUTH_HEADER=$(echo "$SERVER_CONFIG" | jq -r '.headers.Authorization')
fi

# After: Falls back to gateway API key parameter
AUTH_HEADER=""
if echo "$SERVER_CONFIG" | jq -e '.headers.Authorization' >/dev/null 2>&1; then
  AUTH_HEADER=$(echo "$SERVER_CONFIG" | jq -r '.headers.Authorization')
elif [ -n "$GATEWAY_API_KEY" ]; then
  AUTH_HEADER="$GATEWAY_API_KEY"
fi

This allows gatewayed servers to authenticate properly during startup validation.

Original prompt

Fix the failing GitHub Actions workflow agent

Analyze the workflow logs, identify the root cause of the failure, and implement a fix.

Job ID: 59999733473

Job URL: https://github.com/githubnext/gh-aw/actions/runs/20882025812/job/59999733473


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 10, 2026 17:54
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
… headers

Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions workflow agent Fix MCP gateway server authentication in connectivity checks Jan 10, 2026
Copilot AI requested a review from Mossaka January 10, 2026 18:00
@pelikhan pelikhan added the smoke label Jan 10, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2026

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Jan 10, 2026

💀 Blimey! Changeset Generator failed and walked the plank! No treasure today, matey! ☠️

@pelikhan pelikhan marked this pull request as ready for review January 10, 2026 18:28
@pelikhan pelikhan merged commit bfec8a5 into main Jan 10, 2026
32 of 36 checks passed
@pelikhan pelikhan deleted the copilot/fix-github-actions-workflow-another-one branch January 10, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants