Skip to content

Mcp-Protocol-Version header missing when client Connection is wrapped #1109

Closed

Description

@jan-xyz

streamableClientConn.setMCPHeaders derives the Mcp-Protocol-Version header exclusively from c.initializedResult, which is populated only through the unexported clientConnection.sessionUpdated hook. Client.Connect reaches that hook via a type assertion on the Connection returned by the Transport:

if hc, ok := cs.mcpConn.(clientConnection); ok {
    hc.sessionUpdated(cs.state)
}

That assertion silently fails whenever the Connection is wrapped by another type that exposes only the exported Connection interface. c.initializedResult then stays nil for the life of the session, and every SEP-2575 (>= 2026-07-28) request sent through that connection is missing the Mcp-Protocol-Version header. Servers that validate the header per spec reject the request with 400 Bad Request, closing the connection.

This is currently breaking the GitHub MCP with the 1.7-pre releases.

Activity

  1. added a commit that references this issue on Jul 24, 2026
    2781b8f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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