Skip to content

[Client] Expose session ID from HttpTransport - #497

Merged
chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
RobLoach:expose-http-session-id
Sep 4, 2026
Merged

[Client] Expose session ID from HttpTransport#497
chr-hertel merged 2 commits into
modelcontextprotocol:mainfrom
RobLoach:expose-http-session-id

Conversation

@RobLoach

@RobLoach RobLoach commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Adds HttpTransport::getSessionId() so request-scoped callers can persist the server-minted session ID and re-inject it later via the constructor's $headers parameter. Fixes #496.

chr-hertel
chr-hertel previously approved these changes Sep 4, 2026

@chr-hertel chr-hertel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair with that disclaimer in the comment - won't be there for long with modern era discontinuing the session, but makes sense for now.

Thanks @RobLoach!

That revision removed protocol-level sessions (SEP-2567), so the getter is always null there. Adds the changelog entry.
@chr-hertel chr-hertel added Client Issues & PRs related to the Client component enhancement Request for a new feature that's not currently supported labels Sep 4, 2026
@chr-hertel
chr-hertel merged commit 418034f into modelcontextprotocol:main Sep 4, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Client Issues & PRs related to the Client component enhancement Request for a new feature that's not currently supported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Client] Expose the Mcp-Session-Id from HttpTransport for cross-request session resumption

2 participants