Skip to content

feat(rmcp): Add authorization header support for the streamable http client - #390

Merged
4t145 merged 1 commit into
modelcontextprotocol:mainfrom
mjcarson:AuthHeaderSupportStreamableHttpClient
Aug 29, 2025
Merged

feat(rmcp): Add authorization header support for the streamable http client#390
4t145 merged 1 commit into
modelcontextprotocol:mainfrom
mjcarson:AuthHeaderSupportStreamableHttpClient

Conversation

@mjcarson

@mjcarsonmjcarson commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

This allows the streamable http client to send an authorization header when making requests.

Closes#387

This simply allows users to specify an auth header to use with the streamable http client.

// build the config to use with this transportlet config = StreamableHttpClientTransportConfig::with_uri("<MCP_SERVER>")// set our auth header.auth_header("<AUTH_HEADER>");// setup our transportlet transport = StreamableHttpClientTransport::from_config(config);// build our client infolet client_info = ClientInfo{protocol_version:Default::default(),capabilities:ClientCapabilities::default(),client_info:Implementation{name:"Example MCP Client".to_string(),version:"0.0.1".to_string(),},};// build our client
client_info.serve(transport).await.unwrap()
```
## Motivation and ContextPrior to this it was not possible for this client to be used with MCP servers that use the authorization header for auth.
## HowHasThisBeenTested?
Yes,I tested this against a local MCP server.
## BreakingChangesNo, this should be a purely additive feature.
## Types of changes
<!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- []Bugfix(non-breaking change which fixes an issue)
- [x]Newfeature(non-breaking change which adds functionality)
- []Breakingchange(fix or feature that would cause existing functionality to change)
- []Documentation update
## Checklist
<!-- Go over all the following points, and put an `x` in all the boxes that apply. -->
- [x]I have read the [MCPDocumentation](https://modelcontextprotocol.io)
- [x]My code follows the repository's style guidelines
- [x]New and existing tests pass locally
- []I have added appropriate error handling
- []I have added or updated documentation asneeded
## Additional context
<!-- Add any other context, implementation notes, or design decisions -->

@github-actionsgithub-actionsBot added T-core Core library changes T-transport Transport layer changes labels Aug 26, 2025
…client
This allows the streamable http client to send an authorization header
when making requests.
Closesmodelcontextprotocol#387
@mjcarson
mjcarsonforce-pushed the AuthHeaderSupportStreamableHttpClient branch from ee0e1e2 to 4c85e8cCompareAugust 29, 2025 04:12

@4t1454t145 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@4t145
4t145 merged commit 6853143 into modelcontextprotocol:mainAug 29, 2025
11 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Aug 29, 2025
takumi-earth pushed a commit to earthlings-dev/rmcp that referenced this pull request Jan 27, 2026
…client (modelcontextprotocol#390)
This allows the streamable http client to send an authorization header
when making requests.
Closesmodelcontextprotocol#387
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-coreCore library changesT-transportTransport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send Authorization header in client

2 participants

@mjcarson@4t145