You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
error TS2420: Class 'StreamableHTTPServerTransport' incorrectly implements interface 'Transport'. #1314
../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/streamableHttp.d.ts:58:22 - error TS2420: Class 'StreamableHTTPServerTransport' incorrectly implements interface 'Transport'.
Types of property 'onclose' are incompatible.
Type '(() => void) | undefined' is not assignable to type '() => void'.
Type 'undefined' is not assignable to type '() => void'.
58 export declare class StreamableHTTPServerTransport implements Transport {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error.
I suspect this is due to "exactOptionalPropertyTypes": true in my tsconfig.json.
Hi! I'd like to work on this issue.
I'll investigate the type errors caused by enabling exactOptionalPropertyTypes, add the necessary fixes and regression tests, and submit a PR.
Please let me know if there are any constraints or preferred approaches I should follow before I start.
Activity
felixweinberger commentedon Dec 18, 2025
Thanks for reporting! We don't currently support
exactOptionalPropertyTypes- there are other type errors when enabled beyond this one.Workaround: Add
"skipLibCheck": trueto your tsconfig.json. This skips type checking of.d.tsfiles in node_modules (we use this ourselves).Probably won't get to this on the team in the short term but happy to review a PR.
fix: add `| undefined` to optional properties for exactOptionalProper…
fix(core): add | undefined to Transport optional callback types for e…
fix: support exactOptionalPropertyTypes in Transport interface
fix(core): add explicit | undefined to Transport interface optional p…
vultrarex21-dev commentedon Aug 24, 2026
Hi! I'd like to work on this issue.
I'll investigate the type errors caused by enabling
exactOptionalPropertyTypes, add the necessary fixes and regression tests, and submit a PR.Please let me know if there are any constraints or preferred approaches I should follow before I start.