Skip to content

Fix missing Authorization header and add type field in MCP gateway converters#9502

Merged
pelikhan merged 5 commits into
mainfrom
copilot/add-authorization-header
Jan 10, 2026
Merged

Fix missing Authorization header and add type field in MCP gateway converters#9502
pelikhan merged 5 commits into
mainfrom
copilot/add-authorization-header

Conversation

Copilot AI commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

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 Authorization header 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

  • Updated convert_gateway_config_claude.sh to always add headers.Authorization
  • Updated convert_gateway_config_copilot.sh to always add headers.Authorization
  • Updated convert_gateway_config_claude.sh to include "type": "http" for MCP servers
  • Merged main branch and recompiled all workflows
  • Manually tested the fix with sample gateway output
  • Verified with comprehensive test scripts

Changes Made

  1. Modified actions/setup/sh/convert_gateway_config_claude.sh:

    • Changed conditional header setting to always create headers object
    • Ensures all MCP servers have Authorization header with API key
    • Now includes "type": "http" for HTTP-based MCP servers
  2. Modified actions/setup/sh/convert_gateway_config_copilot.sh:

    • Applied same fix for consistency
    • Copilot converter now always adds Authorization header
  3. Merged main branch:

    • Integrated latest changes from main including MCP gateway log parsing
    • Recompiled all workflow files

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

Reference: https://github.com/githubnext/gh-aw/actions/runs/20873799031/job/59979995478#step:25:1

The converted configuration is lacking the authorization header with the generated api key.

This is the config passed to claude:

{
"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"
}
}
}


💡 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.

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>
Copilot AI changed the title [WIP] Add authorization header with API key to configuration Fix missing Authorization header in MCP gateway converters Jan 10, 2026
Copilot AI requested a review from pelikhan January 10, 2026 06:18
@pelikhan pelikhan added the smoke label Jan 10, 2026
@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@pelikhan

Copy link
Copy Markdown
Collaborator

@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>

Copilot AI commented Jan 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot add type http to the servers

Added "type": "http" to all MCP servers in the Claude configuration. The converter now sets the type field instead of removing it. (74c2eb4)

Copilot AI changed the title Fix missing Authorization header in MCP gateway converters Fix missing Authorization header and add type field in MCP gateway converters Jan 10, 2026
@pelikhan pelikhan added smoke and removed smoke labels Jan 10, 2026
@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@pelikhan pelikhan marked this pull request as ready for review January 10, 2026 06:52
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Copilot AI and others added 2 commits January 10, 2026 07:14
- 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>

Copilot AI commented Jan 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Merged main branch and recompiled all workflows. The merge added MCP gateway log parsing functionality and updated workflow lock files. (d22c6b8)

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

Copy link
Copy Markdown
Contributor

PR titles unavailable (safeinputs-gh down)
GitHub MCP: ❌ (tool unavailable)
Serena-go: ❌ (tool unavailable)
Playwright: ❌ (tool unavailable)
safeinputs-gh issues: ❌ (tool unavailable)
File write/read: ✅ (/tmp/gh-aw/agent/smoke-test-codex-20874848498.txt)
Overall: FAIL

AI generated by Smoke Codex

@pelikhan pelikhan merged commit 144016b into main Jan 10, 2026
35 of 36 checks passed
@pelikhan pelikhan deleted the copilot/add-authorization-header branch January 10, 2026 07: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.

2 participants