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
Implement StdioServerTransport.setProtocolVersion to save protocol version for stdio transport #1468
Is your feature request related to a problem? Please describe.
When building MCP clients, it's not possible to externally detect the negotiated MCP protocol version for stdio transports, as it's only stored for HTTP-based transports (as they need to pass it in HTTP headers). But that makes it difficult to debug MCP clients and understand the lower-level behavior.
Describe the solution you'd like
Add StdioServerTransport.setProtocolVersion() and protocolVersion() getter, which would set and get protocol version for use by the external implementation.
Describe alternatives you've considered
No simple workaround exists, except for intercepting the stdio channel which is a massive pain.
The negotiated version is available in the InitializeResult returned by Client.connect(), and the Client stores it internally. For the mcpc debugging use case, does reading it from the Client work?
Context: C#, Go, Rust, and Python SDKs all expose protocolVersion only on HTTP transports (where it's needed for header injection), not on stdio. Adding it to stdio in TypeScript would make us the outlier. The Server._oninitialize() side of #1660 is a real gap worth fixing, but the getter additions may not be needed if the Client-level accessor covers the debugging case.
Activity
feat: expose negotiated protocol version on stdio transports
felixweinberger commentedon Mar 27, 2026
The negotiated version is available in the
InitializeResultreturned byClient.connect(), and theClientstores it internally. For themcpcdebugging use case, does reading it from theClientwork?Context: C#, Go, Rust, and Python SDKs all expose
protocolVersiononly on HTTP transports (where it's needed for header injection), not on stdio. Adding it to stdio in TypeScript would make us the outlier. TheServer._oninitialize()side of #1660 is a real gap worth fixing, but the getter additions may not be needed if theClient-level accessor covers the debugging case.Preserve protocol version on session resumption after crash (#326)