| @modelcontextprotocol/server | minor |
|---|
Add multi-node session hydration support, aligned with the C# SDK pattern:
WebStandardStreamableHTTPServerTransportnow accepts asessionIdconstructor option. When set, the transport validates incomingmcp-session-idheaders against that value and rejects re-initialization, without requiring a fresh initialize handshake on this node.Server.restoreInitializeState(params)restores negotiated client capabilities and version from persistedInitializeRequestparams, so capability-gated server-initiated features (sampling, elicitation, roots) work on hydrated instances.
Internal refactor: the private _initialized flag is removed. Its checks are replaced by equivalent sessionId === undefined checks, so observable behavior (error codes and messages) is unchanged.