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

Abierto Apto para principiantes
#2,031 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
88/100
Tipo de issue
Documentación
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, markdown

Línea de trabajo

Lee docs/concepts/stateless/stateless.md alrededor de la línea 231 (tabla de comparación) y la línea 686 (párrafo sobre el modo Stateful), luego compara con docs/concepts/tasks/tasks.md líneas 340-342, que ya indica el comportamiento down-level correcto. Confirma el gating revisando por encima McpTasksBuilderExtensions.GateToJuly2026OrLaterProtocol y StreamableHttpHandler.GetOrCreateSessionAsync, y luego reformula solo las celdas/el párrafo de Stateful; la columna Stateless se queda como está. Hecho significa que la tabla y el párrafo digan que las tasks requieren la revisión 2026-07-28 y no están disponibles en modo Stateful estricto.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C#
Estrellas
4.6k
Forks
849
Merge medio
1 d 16 h
PR fusionados (30 d)
24

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de modelcontextprotocol/csharp-sdk

Todos los issues de modelcontextprotocol/csharp-sdk

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.