Title: fix: return HTTP 404 for unknown session IDs instead of 400 by max-rousseau · Pull Request #1808 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: fix: return HTTP 404 for unknown session IDs instead of 400 by max-rousseau · Pull Request #1808 · modelcontextprotocol/python-sdk
X Title: fix: return HTTP 404 for unknown session IDs instead of 400 by max-rousseau · Pull Request #1808 · modelcontextprotocol/python-sdk
Description: Summary Fixes incorrect HTTP status code returned by StreamableHTTPSessionManager when receiving requests with unknown or expired session IDs. Per the MCP Streamable HTTP transport specification, servers MUST respond with HTTP 404 (Not Found) when the session ID is not recognized. The previous implementation returned HTTP 400 (Bad Request), which incorrectly signals a malformed request rather than a missing resource. This change aligns the Python SDK behavior with: The MCP specification requirements The TypeScript SDK implementation Changes Return HTTP 404 instead of 400 for unknown session IDs Use JSON-RPC error format in the response body, matching TypeScript SDK behavior Fixes #1727
Open Graph Description: Summary Fixes incorrect HTTP status code returned by StreamableHTTPSessionManager when receiving requests with unknown or expired session IDs. Per the MCP Streamable HTTP transport specification, s...
X Description: Summary Fixes incorrect HTTP status code returned by StreamableHTTPSessionManager when receiving requests with unknown or expired session IDs. Per the MCP Streamable HTTP transport specification, s...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/1808
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5c85c272-ca2d-00ae-c6f5-a924a67e8758 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D37E:33E8D:63575B8:8C104B0:6A5754AD |
| html-safe-nonce | 050526fdcea6cc27b49f1aaf1ae2ace1f6a750e68cecb90fb1a724a30259c69d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzdFOjMzRThEOjYzNTc1Qjg6OEMxMDRCMDo2QTU3NTRBRCIsInZpc2l0b3JfaWQiOiI3OTg3MzM3NjQyNjM0NTk3NTQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 23a94c0cb81a83e8db61efa45f3fec19f57d882b7b5591a3bd81d2da7d64fbba |
| hovercard-subject-tag | pull_request:3119223283 |
| 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/1808/files |
| twitter:image | https://avatars.githubusercontent.com/u/67350340?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/67350340?s=400&v=4 |
| og:image:alt | Summary Fixes incorrect HTTP status code returned by StreamableHTTPSessionManager when receiving requests with unknown or expired session IDs. Per the MCP Streamable HTTP transport specification, s... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | 602250ea3b6dd8302a7220ef98adb828dbc807e4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width