Skip to content

No Way to Pass Custom Headers (e.g., Authorization) When Using go-sdk to Connect to MCP Server #616

Closed

Description

@NiharDoshi99

When using the go-sdk to communicate with an MCP server that requires authentication, there is currently no documented or supported way to pass custom HTTP headers (e.g., Authorization, x-api-key, etc.) during the connection or request initialization.

Activity

  1. findleyr commented on Nov 7, 2025

    @findleyr
    Contributor

    Right now, this is done with a custom HTTP client. #595 is an in-progress PR with an example, but per @jba's comment, we updated the experimental client-side oauth support to make this example more ergonomic.

    Leaving this open to track documentation.

  2. NiharDoshi99 commented on Nov 10, 2025

    @NiharDoshi99
    Author

    @findleyr
    Could you please share me example on how to do pass custom headers with custom HTTP client ?

  3. Bajahaw commented on Nov 11, 2025

    @Bajahaw

    @NiharDoshi99 I also was wondering the same, I saw an example somewhere but I'm unable to find it again for now.

    But you might find my implementation here helpful. It is not the best though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions