Docs: stateless.md says the stateful task store is "scoped per session", but Tasks are unavailable in strict Stateful mode

Open Beginner friendly
#2,031 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, markdown
Domain
documentation

Research direction

Read docs/concepts/stateless/stateless.md around line 231 (comparison table) and line 686 (Stateful mode paragraph), then compare with docs/concepts/tasks/tasks.md lines 340-342, which already states the correct down-level behavior. Confirm the gating by skimming McpTasksBuilderExtensions.GateToJuly2026OrLaterProtocol and StreamableHttpHandler.GetOrCreateSessionAsync, then reword only the Stateful cells/paragraph; the Stateless column stays as is. Done means the table and paragraph say tasks require the 2026-07-28 revision and are not available in strict Stateful mode.

Written by the indexing model from the issue text.

Description

The comparison table in docs/concepts/stateless/stateless.md (line 231) describes Tasks support as:

| Tasks | Supported — shared task store, no per-session isolation | Supported — task store scoped per session |

and the "Stateful mode" section (line 686) says:

In stateful mode, the IMcpTaskStore tracks tasks created for that server instance.

Both statements describe a stateful task store that the current implementation does not provide:

  • The tasks/get, tasks/update, and tasks/cancel handlers, and task creation in the call-tool filter, are all gated on the 2026-07-28 protocol revision and throw MethodNotFound for any earlier version (McpTasksBuilderExtensions.GateToJuly2026OrLaterProtocol).
  • A Streamable HTTP server running in strict Stateful session mode refuses 2026-07-28 (per-request-metadata) requests before dispatch (StreamableHttpHandler.GetOrCreateSessionAsync), and a session established through the initialize handshake can only negotiate a pre-2026-07-28 version. So in strict Stateful mode no task can be created or accessed at all. (In StatefulForInitializeClients mode, modern requests are instead served statelessly, and tasks work there exactly as in Stateless mode — with the shared, non-isolated store the Stateless column describes.)
  • WithTasks registers the supplied IMcpTaskStore as a single shared instance; there is no per-session scoping mechanism.

docs/concepts/tasks/tasks.md (lines 340-342) already documents the correct behavior for down-level connections ("the v2 server does not create Tasks on a down-level connection, and its tasks/get endpoint rejects the legacy request with a method-not-found error"), so this looks like the stateless.md text simply was not updated when the protocol gating landed.

Suggested fix: change the Stateful cell to reflect that Tasks are not available in strict Stateful mode (they require the 2026-07-28 revision and run on the sessionless path — which is also how they are served under StatefulForInitializeClients), and adjust the "Stateful mode" paragraph accordingly. The Stateless column ("shared task store, no per-session isolation") matches the implementation and needs no change.

Dominant language
C#
Stars
4.6k
Forks
849
Avg merge
1d 16h
Merged PRs (30d)
24

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelcontextprotocol/csharp-sdk

All issues in modelcontextprotocol/csharp-sdk

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.