Describe the bug
Without o.SessionMode = HttpServerSessionMode.Stateless; or with the line commented out, the connection sometimes succeed and sometimes failed. I don't believe this should cause the connection to fail at all since otherwise, the product won't be able to support the stateful connection as claimed in https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/concepts/transports/transports.md#streamable-http-server-aspnet-core
Set SessionMode = HttpServerSessionMode.Stateful explicitly when your server needs stateful sessions for unsolicited notifications, resource subscriptions, or per-client isolation.
and therefore, it is a BUG.
To Reproduce
Steps to reproduce the behavior:
- Create a streaming HTTP MCP server and deploy to a k8s cluster. Local cluster is fine.
- The server should be created without
o.SessionMode = HttpServerSessionMode.Stateless;. So it is a stateful connection.
- Try to connect to the service either from Postman MCP client OR
npx @modelcontextprotocol/inspector
Expected behavior
Successful connection 100%
Logs
If applicable, add logs to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
Without
o.SessionMode = HttpServerSessionMode.Stateless;or with the line commented out, the connection sometimes succeed and sometimes failed. I don't believe this should cause the connection to fail at all since otherwise, the product won't be able to support the stateful connection as claimed in https://github.com/modelcontextprotocol/csharp-sdk/blob/main/docs/concepts/transports/transports.md#streamable-http-server-aspnet-coreand therefore, it is a BUG.
To Reproduce
Steps to reproduce the behavior:
o.SessionMode = HttpServerSessionMode.Stateless;. So it is a stateful connection.npx @modelcontextprotocol/inspectorExpected behavior
Successful connection 100%
Logs
If applicable, add logs to help explain your problem.
Additional context
Add any other context about the problem here.