Title: Implement SEP-2567: Sessionless MCP via Explicit State Handles · Issue #870 · modelcontextprotocol/rust-sdk · GitHub
Open Graph Title: Implement SEP-2567: Sessionless MCP via Explicit State Handles · Issue #870 · modelcontextprotocol/rust-sdk
X Title: Implement SEP-2567: Sessionless MCP via Explicit State Handles · Issue #870 · modelcontextprotocol/rust-sdk
Description: SEP-2567: Sessionless MCP via Explicit State Handles — rust-sdk implementation Spec PR: modelcontextprotocol/modelcontextprotocol#2567 Track: Specification · Stage: final · Priority: P0 · Theme: Transport Evolution and Scalability Needs ...
Open Graph Description: SEP-2567: Sessionless MCP via Explicit State Handles — rust-sdk implementation Spec PR: modelcontextprotocol/modelcontextprotocol#2567 Track: Specification · Stage: final · Priority: P0 · Theme: Tr...
X Description: SEP-2567: Sessionless MCP via Explicit State Handles — rust-sdk implementation Spec PR: modelcontextprotocol/modelcontextprotocol#2567 Track: Specification · Stage: final · Priority: P0 · Theme: Tr...
Opengraph URL: https://github.com/modelcontextprotocol/rust-sdk/issues/870
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implement SEP-2567: Sessionless MCP via Explicit State Handles","articleBody":"# SEP-2567: Sessionless MCP via Explicit State Handles — rust-sdk implementation\n\n**Spec PR:** https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2567\n**Track:** Specification · **Stage:** final · **Priority:** P0 · **Theme:** Transport Evolution and Scalability\n**Needs code changes:** Yes (Large)\n\n## Summary\nRemoves protocol-level sessions, replacing implicit session-scoped state with explicit,\nserver-minted **state handles**. Builds on SEP-1442 (stateless-by-default) but argues the opt-in\nstateful path should not exist at all.\n\nWhat changes:\n- No `session/create`, `session/destroy`, or `Mcp-Session-Id` header.\n- `tools/list` / `resources/list` / `prompts/list` **MUST NOT** depend on per-connection or prior-tool-call state (so list endpoints become cacheable at `(deployment, auth)` granularity).\n- Stateful workflows use `create_*() -\u003e handle` + threaded parameters (guidance, not a protocol construct).\n\n## Why this needs code changes in rust-sdk\nThe streamable HTTP transport mints and threads a session id today, but a disable path already\nexists:\n- Server: `StreamableHttpServerConfig.stateful_mode` (default `true`); when `false` the server \"disables sessions entirely (stateless mode)\" per the doc comment, backed by the `SessionManager`/`SessionStore` trait (`session.rs`, with `Local…`/`Never…` stores and `RestoreOutcome`/`SessionRestoreMarker`). The session id rides on `HEADER_SESSION_ID`.\n- Client: `streamable_http_client.rs` carries `session_id: Arc\u003cstr\u003e` through requests and SSE reconnects.\n- List handlers live behind `service/server.rs` + `handler/server/router.rs`.\n\nSo \"no sessions\" is partly reachable via `stateful_mode = false`. The remaining work is: making that\npath the default/clean one for `V_2026_07_28`, ensuring list endpoints are state-independent, and\nremoving the client's hard dependency on a session id.\n\n## Proposed work\n- [ ] Ensure the `stateful_mode = false` server path neither requires nor emits `HEADER_SESSION_ID`, and verify the `Never…`-store path is the one selected.\n- [ ] Audit `tools/list` / `resources/list` / `prompts/list` handlers (`handler/server/router.rs`) so results don't depend on per-connection or prior-call state in the sessionless path (precondition for the SEP-2549 caching story).\n- [ ] Make the client's `session_id` optional (`Option\u003cArc\u003cstr\u003e\u003e`) so it can operate without one when the negotiated version is `V_2026_07_28`; keep sending it for older negotiated versions.\n- [ ] Keep `HEADER_SESSION_ID` handling for back-compat behind older protocol versions.\n- [ ] Add an example demonstrating the `create_*() -\u003e handle` pattern (state handles are app-level, not a protocol construct).\n\n## Affected areas\n`transport/streamable_http_server/session.rs`, `transport/streamable_http_server/tower.rs`,\n`transport/streamable_http_client.rs`, `service/server.rs`, `handler/server/router.rs`.\n\n## Notes / risks\n- Overlaps heavily with SEP-2575. Treat as one transport-statelessness workstream; this SEP is the application-state half, 2575 is the handshake half.\n- Making client `session_id` optional touches several `Arc\u003cstr\u003e` call sites in `streamable_http_client.rs` (reconnect/get-stream paths) — mechanical but broad.\n\n---\n## Related existing issues\n- #863 — Expose negotiated `Mcp-Session-Id` (sessionless work changes how session identity is surfaced)\n- #526 — SEP-1442 Make MCP Stateless (same transport-statelessness workstream)\n","author":{"url":"https://github.com/alexhancock","@type":"Person","name":"alexhancock"},"datePublished":"2026-06-02T16:01:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/870/rust-sdk/issues/870"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:294935bb-1728-9881-c10c-ac9616d47a3c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B48:2437B8:18D898E:21D5033:6A652B0F |
| html-safe-nonce | d90687f323012264f4504050f8326e37041455bb1768f55d75af39633f012081 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjQ4OjI0MzdCODoxOEQ4OThFOjIxRDUwMzM6NkE2NTJCMEYiLCJ2aXNpdG9yX2lkIjoiODY1OTM2Mjg4NjE1Mzc0MzExOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | aacab3fdca0935cdd93ecc55882f3f170471af021cb84f84785d4635d94cab2b |
| hovercard-subject-tag | issue:4573024198 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/rust-sdk/870/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b56e1b2ffdc17550dc5630c12335cd53793aa2a1a6c7b76cb5c3e4e9be1cb2f7/modelcontextprotocol/rust-sdk/issues/870 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b56e1b2ffdc17550dc5630c12335cd53793aa2a1a6c7b76cb5c3e4e9be1cb2f7/modelcontextprotocol/rust-sdk/issues/870 |
| og:image:alt | SEP-2567: Sessionless MCP via Explicit State Handles — rust-sdk implementation Spec PR: modelcontextprotocol/modelcontextprotocol#2567 Track: Specification · Stage: final · Priority: P0 · Theme: Tr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | alexhancock |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c76df668885aaff23b50bdca1fa1ea44ac9c1553e888ebc70ff1e4daa4625b |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/rust-sdk git https://github.com/modelcontextprotocol/rust-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 934753959 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/rust-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 934753959 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/rust-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 309153364422b3c499922d1a2a6404910a58ed8e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width