Skip to content

Implement StdioServerTransport.setProtocolVersion to save protocol version for stdio transport #1468

Closed

Description

@jancurn

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.

Additional context
We need this for the mcpc MCP CLI client

I'll be happy to prepare a PR.

Activity

  1. added
    enhancementRequest for a new feature that's not currently supported
    on Feb 3, 2026
  2. added a commit that references this issue on Mar 11, 2026
    c769d19
  3. felixweinberger commented on Mar 27, 2026

    @felixweinberger
    Contributor

    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.

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

    enhancementRequest for a new feature that's not currently supported

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions