Skip to content

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

@jancurn

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.

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