Fix missing Authorization header and add type field in MCP gateway converters#9502
Conversation
The Claude and Copilot MCP gateway configuration converters were only adding the Authorization header if it already existed in the gateway output. This caused the converted configurations to be missing the required API key authentication headers. Updated both converters to always create the headers object with the Authorization field set to the MCP_GATEWAY_API_KEY value. Fixes the issue where Claude configuration was missing authorization headers for MCP servers (github, playwright, safeoutputs, serena). Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
@copilot add type http to the servers |
Updated convert_gateway_config_claude.sh to include "type": "http" for all MCP servers instead of removing it. This ensures Claude configuration properly specifies HTTP-based server transport. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
@copilot merge main and recompile |
- Merged origin/main branch into copilot/add-authorization-header - Ran make recompile to update all workflow lock files - Added parse_mcp_gateway_log step to workflows from main branch Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges... |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤 |
|
PR titles unavailable (safeinputs-gh down)
|
Fix: Add Missing Authorization Header and Type Field in MCP Gateway Converters ✅
Problem
The MCP gateway configuration converters for Claude and Copilot were only adding the
Authorizationheader if it already existed in the gateway output. This caused the converted configurations to be missing the required API key authentication headers.The issue was reported in the smoke-claude workflow where the converted configuration was lacking the authorization header:
{ "mcpServers": { "github": { "url": "http://0.0.0.0:8080/mcp/github" }, "playwright": { "url": "http://0.0.0.0:8080/mcp/playwright" }, "safeoutputs": { "url": "http://0.0.0.0:8080/mcp/safeoutputs" }, "serena": { "url": "http://0.0.0.0:8080/mcp/serena" } } }Solution
convert_gateway_config_claude.shto always add headers.Authorizationconvert_gateway_config_copilot.shto always add headers.Authorizationconvert_gateway_config_claude.shto include"type": "http"for MCP serversChanges Made
Modified
actions/setup/sh/convert_gateway_config_claude.sh:"type": "http"for HTTP-based MCP serversModified
actions/setup/sh/convert_gateway_config_copilot.sh:Merged main branch:
Test Results
Comprehensive tests confirmed the fix works correctly for both converters:
Claude Output (Updated):
{ "mcpServers": { "github": { "type": "http", "url": "http://0.0.0.0:8080/mcp/github", "headers": { "Authorization": "test-api-key-12345" } }, "playwright": { "type": "http", "url": "http://0.0.0.0:8080/mcp/playwright", "headers": { "Authorization": "test-api-key-12345" } }, ... } }Copilot Output:
{ "mcpServers": { "github": { "type": "http", "url": "http://0.0.0.0:8080/mcp/github", "tools": ["*"], "headers": { "Authorization": "test-copilot-key-67890" } }, ... } }All MCP servers now include the required Authorization header with the API key and proper type specification. ✅
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.