Skip to content

[Regression] Stateless Mode renders ClientInfo null, breaking multi-instance cloud deployments #1036

@TianqiZhang

Description

@TianqiZhang

Describe the bug
In the latest SDK (v0.4.0-preview.2+), the McpServer.ClientInfo property is always null when the server is configured in Stateless mode. This is a regression from previous behavior where session context was encoded into the mcp-session-id.

While the release notes mention this as a change, it functionally breaks the ability to host MCP servers on load-balanced platforms (like Azure App Service or AWS Lambda) where:

  1. In-memory state is impossible (due to round-robin routing).
  2. ClientInfo is required for logging.

To Reproduce
As stated in release notes.

Expected behavior
The SDK should preserve a mechanism to retain ClientInfo across requests in Stateless mode.

Logging ClientInfo is critical for many MCP servers. Since standard "Sticky Sessions" are not reliable on many serverless/PaaS platforms, the previous implementation (encoding session state into the Session ID) was the only viable "Cloud Native" solution.

We request that the SDK restores this "round-tripped Session" strategy (or adds a specific flag for it) to preserve basic logging functionality without forcing developers to implement complex workarounds just to read the Client Name/Version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions