typescript-sdk/.changeset/gentle-planets-rest.md
Christian Sidak 2c0c481cb9
fix: add | undefined to transport option callbacks for exactOptionalPropertyTypes (#1855)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-04 02:12:25 +01:00

479 B

@modelcontextprotocol/server
patch

Add | undefined to optional callback and function properties on WebStandardStreamableHTTPServerTransportOptions (sessionIdGenerator, onsessioninitialized, onsessionclosed) and corresponding private fields.

This fixes TS2430 errors for consumers using exactOptionalPropertyTypes: true without skipLibCheck, where optional properties with function types need explicit | undefined to match their emitted declarations.