diff --git a/.github/workflows/daily-team-status.lock.yml b/.github/workflows/daily-team-status.lock.yml index b0a3ad0827d..3fdb0ab7542 100644 --- a/.github/workflows/daily-team-status.lock.yml +++ b/.github/workflows/daily-team-status.lock.yml @@ -753,6 +753,9 @@ jobs: - name: Stop MCP gateway if: always() continue-on-error: true + env: + MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }} + MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} run: | bash /opt/gh-aw/actions/stop_mcp_gateway.sh ${{ steps.start-mcp-gateway.outputs.gateway-pid }} - name: Redact secrets in logs diff --git a/actions/setup/sh/check_mcp_servers.sh b/actions/setup/sh/check_mcp_servers.sh index 4bd4ad11c82..8d118b10302 100755 --- a/actions/setup/sh/check_mcp_servers.sh +++ b/actions/setup/sh/check_mcp_servers.sh @@ -115,11 +115,15 @@ while IFS= read -r SERVER_NAME; do echo "Server URL: $SERVER_URL" - # Extract authentication headers if present + # Extract authentication headers if present in config, otherwise use gateway API key AUTH_HEADER="" if echo "$SERVER_CONFIG" | jq -e '.headers.Authorization' >/dev/null 2>&1; then AUTH_HEADER=$(echo "$SERVER_CONFIG" | jq -r '.headers.Authorization' 2>/dev/null) - echo "Authentication: Configured (${AUTH_HEADER:0:20}...)" + echo "Authentication: From config (${AUTH_HEADER:0:20}...)" + elif [ -n "$GATEWAY_API_KEY" ]; then + # Use gateway API key for all gatewayed servers + AUTH_HEADER="$GATEWAY_API_KEY" + echo "Authentication: Using gateway API key (${AUTH_HEADER:0:8}...)" else echo "Authentication: None" fi diff --git a/actions/setup/sh/check_mcp_servers_test.sh b/actions/setup/sh/check_mcp_servers_test.sh index f7c25a7c029..dceb0a8d088 100755 --- a/actions/setup/sh/check_mcp_servers_test.sh +++ b/actions/setup/sh/check_mcp_servers_test.sh @@ -327,6 +327,13 @@ test_validation_functions_exist() { else print_result "Tool display logic missing" "FAIL" fi + + # Check for gateway API key fallback logic + if grep -q "Using gateway API key" "$SCRIPT_PATH"; then + print_result "Gateway API key fallback logic exists" "PASS" + else + print_result "Gateway API key fallback logic missing" "FAIL" + fi } # Run all tests