Skip to content

Support hybrid MCP server serving both stateful legacy clients and session less 2026-07-28 clients simultaneously #1777

Description

@saicharanpardhu

We currently have a stateful MCP server that leverages stateful features like elicitations and are facing the following migration deadlock:

  1. To support our existing clients and legacy elicitation flow, we must keep HttpServerTransportOptions.Stateless = false.
  2. In the C# SDK, a stateful endpoint refuses requests using the latest sessionless protocol revision (2026-07-28) with UnsupportedProtocolVersion (-32022).
  3. Therefore, even after upgrading to the latest C# SDK, our server cannot actually serve clients using the latest MCP protocol revision. Those clients must downgrade to an initialize/session-based revision.
  4. We cannot switch the entire endpoint to stateless mode until all our existing clients support the latest sessionless protocol and our elicitation flows have migrated to the modern multi-round-trip request mechanism.
  5. Waiting for every client to migrate means we cannot progressively adopt the latest protocol. Conversely, switching off statefulness early would break clients and functionality that still depend on sessions.

Could the SDK instead support both protocols on one endpoint?

  • legacy clients: continue using stateful sessions, initialize, Mcp-Session-Id, GET, and DELETE.
  • 2026-07-28+ clients: use a fresh, sessionless server/transport for each POST, without Mcp-Session-Id.
  • 2026-07-28+ GET/DELETE: continue returning 405 Method Not Allowed.

This could be opt-in to preserve the existing fallback behavior. The elicitation API would use MRTR for newer clients or fallback to session based support based on the client protocol version.

Essentially a solution could look like:Add hybrid mode: serve 2026-07-28+ clients statelessly alongside legacy stateful sessions on a single endpoint- #1

A current work around from @halter73 Add hybrid Streamable HTTP sample

Metadata

Metadata

Assignees

Labels

P2Moderate issues, valuable feature requestsenhancementNew feature or requestready for workHas enough information to start

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions