claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] claude mcp add test-mcp http://localhost:8888/endpoint -t sse -H "Authorization: Basic [base64]" ignores the -H header

Open mmaunder opened this issue 6 months ago • 2 comments

Environment

  • Platform (select one):
    • [ X] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.17
  • Operating System: OS X 15.4.1
  • Terminal: Terminal App

Bug Description

See bug title. When using the following command the -H parameter which should cause a HTTP header to be passed to the MCP server, is ignored.

claude mcp add test-mcp http://localhost:8888/endpoint -t sse -H "Authorization: Basic [base64]"

Steps to Reproduce

  1. Run the above command with any HTTP header in the quotes and it won't get sent to the MCP server.

Expected Behavior

I expect the HTTP header to be sent as part of the HTTP request to the MCP server.

Actual Behavior

HTTP header is not sent.

Additional Context

I've tried -H in various positions and either got an error or same result.

mmaunder avatar Jun 07 '25 17:06 mmaunder

I can confirm this issue. When using the SSE transport with Claude Code v1.0.17, custom headers specified with the -H or --header flag are not being sent with the request.

The header appears to be stored correctly in the configuration (shows in the output when adding the server), but isn't included in the actual HTTP request.

skorfmann avatar Jun 07 '25 21:06 skorfmann

up until 1.0.7 it was working - starting from 1.0.8 it breaks.

skorfmann avatar Jun 08 '25 10:06 skorfmann

Fixed in 1.0.18

ashwin-ant avatar Jun 10 '25 18:06 ashwin-ant

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Aug 10 '25 14:08 github-actions[bot]