Skip to content

Use current OAuth headers for stateful MCP tool calls - #157

Merged
Ciniesta merged 1 commit into
mainfrom
Use-current-OAuth-headers-for-stateful-MCP-tool-calls
Oct 14, 2026
Merged

Ciniesta merged 1 commit into
mainfrom
Use-current-OAuth-headers-for-stateful-MCP-tool-calls

Conversation

@Ciniesta

Copy link
Copy Markdown
Contributor

Description:

Stateful MCP servers captured the headers from the initialization request and reused them for subsequent tool calls. This caused downstream services to receive an expired bearer token even when the MCP client sent a refreshed token.

This change removes the captured headers and reads them from mcp_server.request_context.request for each tool invocation.

Validation:

Added test

@Ciniesta
Ciniesta requested a review from a team October 14, 2026 09:50
@Ciniesta
Ciniesta added this pull request to the merge queue Oct 14, 2026
Merged via the queue into main with commit 2959108 Oct 14, 2026
8 of 10 checks passed
@Ciniesta
Ciniesta deleted the Use-current-OAuth-headers-for-stateful-MCP-tool-calls branch October 14, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants