Getting the session ID can be helpful to allow resuming previous sessions.
HttpTransport captures the Mcp-Session-Id response header into a private property and there is no public accessor on the transport or on Client:
https://github.com/modelcontextprotocol/php-sdk/blob/v0.8.1/src/Client/Transport/HttpTransport.php#L41
While the BaseTransport has a protected $sessionId, the HttpTransport rescopes it to private.
Proposal
Add a public getter, e.g.:
public function getSessionId(): ?string;
on HttpTransport (optionally surfaced via Client), so callers can persist the ID after a request and feed it back via the existing $headers mechanism in a later PHP request.
Getting the session ID can be helpful to allow resuming previous sessions.
HttpTransportcaptures theMcp-Session-Idresponse header into a private property and there is no public accessor on the transport or onClient:https://github.com/modelcontextprotocol/php-sdk/blob/v0.8.1/src/Client/Transport/HttpTransport.php#L41
While the BaseTransport has a
protected $sessionId, the HttpTransport rescopes it toprivate.Proposal
Add a public getter, e.g.:
on
HttpTransport(optionally surfaced viaClient), so callers can persist the ID after a request and feed it back via the existing$headersmechanism in a later PHP request.