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
StreamableHTTPClientTransport is not implementing Transport properly #861
import{Client}from"@modelcontextprotocol/sdk/client/index.js";import{StreamableHTTPClientTransport}from"@modelcontextprotocol/sdk/client/streamableHttp.js";consttransport=newStreamableHTTPClientTransport(newURL(url),{requestInit: {headers: {'X-Foo': 'bar'}},});constmcpClient=newClient({name: "my-client",version: "1.0.0",},{capabilities: {},});awaitmcpClient.connect(transport);// linter warning on the `transport` parameter to connect()
The type mismatch I'm getting is:
Argument of type 'StreamableHTTPClientTransport' is not assignable to parameter of type 'Transport' with 'exactOptionalPropertyTypes: true'.
Consider adding 'undefined' to the types of the target's properties.
Types of property 'sessionId' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'
Seen with Deno 2.4.5, npm:@modelcontextprotocol/sdk@1.17.4 in deno.json.
src/main.ts(6,22): error TS2379: Argument of type 'StreamableHTTPClientTransport' is not assignable to parameter of type 'Transport' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
Types of property 'sessionId' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
The fix, #2814 (backport of #1766), merged into v1.x on 2026-10-05, after 1.32.1 shipped, so no release carries it yet. The pkg.pr.new build of its merge commit 6919e95 type-checks this file clean.
Could you cut a v1 patch release with it? I can post the tsconfig and commands if useful.
Activity
nicolasff commentedon Aug 27, 2025
I'm seeing this as well. More details:
The type mismatch I'm getting is:
Seen with Deno 2.4.5,
npm:@modelcontextprotocol/sdk@1.17.4indeno.json.alex-feel commentedon Oct 16, 2026
Still reproduces on 1.32.1 (npm latest), TypeScript 7.0.2,
strict+exactOptionalPropertyTypes:The fix, #2814 (backport of #1766), merged into v1.x on 2026-10-05, after 1.32.1 shipped, so no release carries it yet. The pkg.pr.new build of its merge commit 6919e95 type-checks this file clean.
Could you cut a v1 patch release with it? I can post the tsconfig and commands if useful.