Skip to content

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

Open

Description

@reservoir-cmyk

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions