Skip to content

Conversation

@gpeal
Copy link
Contributor

@gpeal gpeal commented Oct 7, 2025

Motivation and Context

The auth token wasn't passed to all endpoints which causes 401s in some MCP servers such as GitHub's.

I also clarified that the auth header should be just the bearer token rather than the full header value.
It is possible that some clients were passing in the wrong value here (like Codex)
Please confirm that this is the expected behavior.

How Has This Been Tested?

I was able to repro the GitHub MCP 401 and confirm that it works after this change

Codex:
CleanShot 2025-10-06 at 17 36 17

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

I wrote the core code by hand (it also matches #464) but codex wrote the tests.

Fixes #464

@github-actions github-actions bot added T-core Core library changes T-transport Transport layer changes T-documentation Documentation improvements labels Oct 7, 2025
There was an errant typo in the CHANGELOG that is breaking CI
@gpeal gpeal force-pushed the gpeal/add-auth-to-streamable-http-2 branch from 6ddf259 to 79548e2 Compare October 7, 2025 00:44
@alexhancock alexhancock self-requested a review October 7, 2025 19:33
@alexhancock
Copy link
Contributor

alexhancock commented Oct 7, 2025

Aligns with my understanding

Note that authorization MUST be included in every HTTP request from client to server, even if they are part of the same logical session.

per https://modelcontextprotocol.io/specification/draft/basic/authorization#token-requirements

@alexhancock alexhancock merged commit 923145a into modelcontextprotocol:main Oct 7, 2025
11 checks passed
@github-actions github-actions bot mentioned this pull request Oct 7, 2025
@reneklacan
Copy link

@gpeal thank you very much for this fix, our MCP wasn't working properly and was planning to dig into rcmp to to figure out what's up but you beat me to it! Thanks a lot

gpeal added a commit to openai/codex that referenced this pull request Oct 21, 2025
[Release notes](https://github.com/modelcontextprotocol/rust-sdk/releases) Notably, this picks up two of my PRs that have four separate fixes for oauth dynamic client registration and auth modelcontextprotocol/rust-sdk#489 modelcontextprotocol/rust-sdk#476
JeffCarpenter pushed a commit to JeffCarpenter/codex that referenced this pull request Oct 24, 2025
[Release notes](https://github.com/modelcontextprotocol/rust-sdk/releases) Notably, this picks up two of my PRs that have four separate fixes for oauth dynamic client registration and auth modelcontextprotocol/rust-sdk#489 modelcontextprotocol/rust-sdk#476
Holovkat pushed a commit to Holovkat/codex-pro that referenced this pull request Oct 29, 2025
[Release notes](https://github.com/modelcontextprotocol/rust-sdk/releases) Notably, this picks up two of my PRs that have four separate fixes for oauth dynamic client registration and auth modelcontextprotocol/rust-sdk#489 modelcontextprotocol/rust-sdk#476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-documentation Documentation improvements T-transport Transport layer changes

3 participants