You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A server using the Streamable HTTP transport MAY assign a session ID at initialization time, by including it in an Mcp-Session-Id header on the HTTP response containing the InitializeResult.
I'm not familiar enough to know how the sdk exposes the response headers, sorry.
Activity
hesreallyhim commentedon Jun 12, 2025
Check out the spec, I think it belongs in the header:
https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#session-management
I'm not familiar enough to know how the sdk exposes the response headers, sorry.
zhenjunMa commentedon Jun 15, 2025
You can retrieve the raw request from the request context and then access any data you want.
Sunrisea commentedon Jun 17, 2025
I tried it, but I cant get session_id in this way
feat: propagate session_id from transport to tool context
maxisbey commentedon Feb 19, 2026
Now tracked in #2098.