Fix stateless StreamableHttp connections #806
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When the client sends a request, do not pass on the
mcp-session-id
header for the Client <-> Proxy connection. This causes a problem for stateless http connections.Motivation and Context
The changes in #787 introduced an unexpected side effect for stateless StreamableHttp connections. They don't return an
mcp-session-id
, but the function that forwards headers was passing on themcp-session-id
for the Client <-> Proxy transport. Therefore the server, which does not recognize this session id will return a 404 error according to spec.Researching the headers being sent, it was that the Client <-> Proxy session id was being sent if no
mcp-session-id
was returned from the server.This fixes #804
How Has This Been Tested?
With the server in #804 that was failing before. Works now.

Still works with Everything server, which gets it's proper session id sent on the Proxy <-> Server transport.
Breaking Changes
Nope.
Types of changes
Checklist
Additional context