Title: [horizontal scaling] How to actually build session persistence in streamable http MCP server? · Issue #880 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: [horizontal scaling] How to actually build session persistence in streamable http MCP server? · Issue #880 · modelcontextprotocol/python-sdk
X Title: [horizontal scaling] How to actually build session persistence in streamable http MCP server? · Issue #880 · modelcontextprotocol/python-sdk
Description: I have a question here regarding how to build session persistence into an MCP server. I am running my mcp server (FastMCP) in an ecs service with multiple tasks. I have built a redis event store to allow for resumability. The service sit...
Open Graph Description: I have a question here regarding how to build session persistence into an MCP server. I am running my mcp server (FastMCP) in an ecs service with multiple tasks. I have built a redis event store to...
X Description: I have a question here regarding how to build session persistence into an MCP server. I am running my mcp server (FastMCP) in an ecs service with multiple tasks. I have built a redis event store to...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/880
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[horizontal scaling] How to actually build session persistence in streamable http MCP server?","articleBody":"I have a question here regarding how to build session persistence into an MCP server.\n\nI am running my mcp server (FastMCP) in an ecs service with multiple tasks. I have built a redis event store to allow for resumability. The service sits behind an ALB that directs HTTPS traffic to it. Inspite of all of it, Im still observing intermittent `Bad Request: No valid session ID provided` 400 errors when I connect the mcpinspector.\n\nMy suspicion is StreamableHTTPSessionManager doesn't seem to be able to store session-id data in an external data source. Therefore traffic from a client has to always hit the same task since the session id is tied to a server.\n\nIn an AWS architecture, how do I configure my server and client to accomplish this. Is using sticky sessions the only route here? Are streamable http sessions not horizontally scalable?","author":{"url":"https://github.com/karthich","@type":"Person","name":"karthich"},"datePublished":"2025-06-03T18:19:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":22},"url":"https://github.com/880/python-sdk/issues/880"}
| 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:eeefee58-5fe6-a62a-c788-8bb44a624715 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C130:2C7987:464CABC:62C2A14:6A56E34E |
| html-safe-nonce | 7854c9ab3850a6a007ce51fd77cb904ec652d500b54f41065fef8a22dbe125dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTMwOjJDNzk4Nzo0NjRDQUJDOjYyQzJBMTQ6NkE1NkUzNEUiLCJ2aXNpdG9yX2lkIjoiNDE0MDYzMzI2NTgxOTU0MjM1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d92d12f73220c42c0c8f39767c1fb59e6f6bfae2adbbdf96198f8de18b6f9dc4 |
| hovercard-subject-tag | issue:3114980525 |
| 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/python-sdk/880/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b8c433ef5033c04bb51bf31f4ce045aa4969e0fb33ec472ca9f9d43fdaed38f1/modelcontextprotocol/python-sdk/issues/880 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b8c433ef5033c04bb51bf31f4ce045aa4969e0fb33ec472ca9f9d43fdaed38f1/modelcontextprotocol/python-sdk/issues/880 |
| og:image:alt | I have a question here regarding how to build session persistence into an MCP server. I am running my mcp server (FastMCP) in an ecs service with multiple tasks. I have built a redis event store to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | karthich |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5220a278731283038daf0ed00b41f06ef7ff9539020ecc806c5c5a0fb6bda25a |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-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 | 8684ae1a81cd3e4ef219b241179982bbda1a5b1f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width