[BUG] HTTP MCP server custom headers not being sent to server
Resolved 💬 2 comments Opened Dec 21, 2025 by liransmartlighthouse Closed Dec 21, 2025
Description
Custom headers configured for HTTP MCP servers are not being transmitted to the server, causing authentication failures.
Steps to Reproduce
- Configure an HTTP MCP server with custom headers in
~/.claude.json:
{
"mcpServers": {
"magic-patterns": {
"type": "http",
"url": "https://mcp.magicpatterns.com/mcp",
"headers": {
"X-MCP-KEY": "<api-key>"
}
}
}
}
- Restart Claude Code
- Verify server shows as connected via
claude mcp list:
````
magic-patterns: https://mcp.magicpatterns.com/mcp (HTTP) - ✓ Connected
- Attempt to use any tool from the MCP server
- Receive authentication error:
Error: Authentication failed. Check your MAGIC_PATTERNS_MCP_KEY.
Expected Behavior
The X-MCP-KEY header should be sent with requests to the MCP server, allowing authentication to succeed.
Actual Behavior
The header is not sent. The server returns an authentication error.
Verification
The same request works correctly via curl:
curl -s -X POST "https://mcp.magicpatterns.com/mcp" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "X-MCP-KEY: <api-key>" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
# Returns: {"result":{"tools":[...]}}
This confirms the API key is valid and the issue is with Claude Code's HTTP MCP client not sending the configured headers.
Environment
- Claude Code version: Latest (via VS Code extension)
- Platform: Linux (Ubuntu)
- MCP Server: Magic Patterns (https://mcp.magicpatterns.com/mcp)
Configuration Method
Configured via CLI:
claude mcp add-json magic-patterns '{"type":"http","url":"https://mcp.magicpatterns.com/mcp","headers":{"X-MCP-KEY":"<key>"}}'
Also tried via:
claude mcp add magic-patterns https://mcp.magicpatterns.com/mcp --transport http -H "X-MCP-KEY: <key>"
Both methods produce correct config in ~/.claude.json but headers are not transmitted.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗