-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
According to the MCP protocol versioning spec:
“Version negotiation happens during initialization.”
However, in the streamableHttp.ts implementation, version negotiation is explicitly skipped when the method is initialize:
typescript-sdk/src/server/streamableHttp.ts
Lines 467 to 478 in 0551cc5
if (!isInitializationRequest) { | |
// If an Mcp-Session-Id is returned by the server during initialization, | |
// clients using the Streamable HTTP transport MUST include it | |
// in the Mcp-Session-Id header on all of their subsequent HTTP requests. | |
if (!this.validateSession(req, res)) { | |
return; | |
} | |
// Mcp-Protocol-Version header is required for all requests after initialization. | |
if (!this.validateProtocolVersion(req, res)) { | |
return; | |
} | |
} |
Expected behavior:
If the spec is correct, I would expect validateProtocolVersion to be called during an initialize request.
Is this a deliberate design decision or an implementation oversight?
Metadata
Metadata
Assignees
Labels
No labels