Skip to content

Version negotiation is skipped for initialization request #834

@eladchen-lusha

Description

@eladchen-lusha

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:

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions