Skip to content

feat: expose streamable HTTP session ID#893

Open
0xWeakSheep wants to merge 1 commit into
modelcontextprotocol:mainfrom
0xWeakSheep:issue-863-session-id
Open

feat: expose streamable HTTP session ID#893
0xWeakSheep wants to merge 1 commit into
modelcontextprotocol:mainfrom
0xWeakSheep:issue-863-session-id

Conversation

@0xWeakSheep
Copy link
Copy Markdown

Closes #863.

This adds a way to read the negotiated Mcp-Session-Id from streamable HTTP clients.

The session ID is now available from:

  • StreamableHttpClientTransport::session_id()
  • StreamableHttpClientTransport::session_id_handle()
  • RunningService::session_id()

The value is set after initialize, updated if the client transparently re-initializes after an expired session, and cleared when the worker exits.

I also added test coverage that checks the exposed session ID matches the session stored by the server.

Checks run:

cargo +nightly fmt --all --check
git diff --check

@0xWeakSheep 0xWeakSheep requested a review from a team as a code owner June 6, 2026 15:58
@github-actions github-actions Bot added T-test Testing related changes T-core Core library changes T-transport Transport layer changes labels Jun 6, 2026
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-test Testing related changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose negotiated Mcp-Session-Id on StreamableHttpClientTransport / RunningService

1 participant