Stateful connection is intermittent.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- csharp, kubernetes
- Domain
- api, backend, distributed-systems
Research direction
Read docs/concepts/transports/transports.md at the Streamable HTTP server section, then reproduce the stateful setup in a local Kubernetes cluster using Postman MCP or @modelcontextprotocol/inspector. Compare behavior with and without HttpServerSessionMode.Stateless; done means the stateful server connects successfully and consistently.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/csharp-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
modelcontextprotocol/csharp-sdk#678 · 1 comment ·
-
enhancement needs confirmation P3 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/csharp-sdk#515 · 6 comments · 3 reactions ·
All issues in modelcontextprotocol/csharp-sdk
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·