Skip to content

McpTransport

type McpTransport = Omit<Transport, "sessionId"> & {
sessionId?: string;
};

Defined in: src/mcp.ts:19

Widened transport type that accepts MCP transport implementations without requiring explicit casts.

Under exactOptionalPropertyTypes, StreamableHTTPClientTransport is not directly assignable to Transport because its sessionId getter returns string | undefined, while Transport declares sessionId?: string (absent or string, but not explicitly undefined). This type relaxes that constraint so users can pass any MCP transport without as Transport.

NameTypeDefined in
sessionId?stringsrc/mcp.ts:19