You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No Way to Pass Custom Headers (e.g., Authorization) When Using go-sdk to Connect to MCP Server #616
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.
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.
Activity
findleyr commentedon Nov 7, 2025
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.
NiharDoshi99 commentedon Nov 10, 2025
@findleyr
Could you please share me example on how to do pass custom headers with custom HTTP client ?
Bajahaw commentedon Nov 11, 2025
@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.