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
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StreamableHttpClientTransport fails to send auth header in SSE stream requests causing 401 errors

2 participants