Title: fix: log unknown or expired streamable HTTP session IDs by lavish0000 · Pull Request #2218 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: fix: log unknown or expired streamable HTTP session IDs by lavish0000 · Pull Request #2218 · modelcontextprotocol/python-sdk
X Title: fix: log unknown or expired streamable HTTP session IDs by lavish0000 · Pull Request #2218 · modelcontextprotocol/python-sdk
Description: Fixes #2204 Summary add a warning log when StreamableHTTPSessionManager rejects a request with an unknown or expired mcp-session-id extend the existing 404 regression test to assert the warning is emitted Why The 404 behavior is already correct, but today the rejection path is silent. In practice that makes stale session IDs harder to diagnose after restarts or idle-session cleanup. Scope no change to the HTTP response payload or status code no change to session lifecycle behavior only the unknown/expired session ID branch in _handle_stateful_request() is touched Validation uv run pytest tests/server/test_streamable_http_manager.py uv run ruff check src/mcp/server/streamable_http_manager.py tests/server/test_streamable_http_manager.py uv run ruff format --check src/mcp/server/streamable_http_manager.py tests/server/test_streamable_http_manager.py uv run pyright src/mcp/server/streamable_http_manager.py tests/server/test_streamable_http_manager.py Notes the warning message includes the rejected session ID so repeated stale-session failures are visible in server logs
Open Graph Description: Fixes #2204 Summary add a warning log when StreamableHTTPSessionManager rejects a request with an unknown or expired mcp-session-id extend the existing 404 regression test to assert the warning is...
X Description: Fixes #2204 Summary add a warning log when StreamableHTTPSessionManager rejects a request with an unknown or expired mcp-session-id extend the existing 404 regression test to assert the warning is...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2218
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:20d8aa1b-110c-7881-e247-c9559adff469 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8A06:102E1B:5F4738:8950A3:6A58B9C6 |
| html-safe-nonce | 8eb2e398b33913cd8e645ab3242fdae89e116003e4d20d8a3774d9fcc0ee15c4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTA2OjEwMkUxQjo1RjQ3Mzg6ODk1MEEzOjZBNThCOUM2IiwidmlzaXRvcl9pZCI6IjM0MDgxOTg4NDc3MjE2ODMzOTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 49806f32d2e74f96bae007a00f7c22269c5aefe316fecc9b974dabe94b9e3139 |
| hovercard-subject-tag | pull_request:3361095008 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/modelcontextprotocol/python-sdk/pull/2218/files |
| twitter:image | https://avatars.githubusercontent.com/u/46993225?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/46993225?s=400&v=4 |
| og:image:alt | Fixes #2204 Summary add a warning log when StreamableHTTPSessionManager rejects a request with an unknown or expired mcp-session-id extend the existing 404 regression test to assert the warning is... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width