Title: [v1.x] fix: return HTTP 404 for unknown session IDs instead of 400 by LucaButBoring · Pull Request #1945 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: [v1.x] fix: return HTTP 404 for unknown session IDs instead of 400 by LucaButBoring · Pull Request #1945 · modelcontextprotocol/python-sdk
X Title: [v1.x] fix: return HTTP 404 for unknown session IDs instead of 400 by LucaButBoring · Pull Request #1945 · modelcontextprotocol/python-sdk
Description: This is a backport of #1808 to the v1.x branch. Original PR 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: This is a backport of #1808 to the v1.x branch. Original PR description: Summary Fixes incorrect HTTP status code returned by StreamableHTTPSessionManager when receiving requests with unknown or e...
X Description: This is a backport of #1808 to the v1.x branch. Original PR description: Summary Fixes incorrect HTTP status code returned by StreamableHTTPSessionManager when receiving requests with unknown or e...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/1945
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:02c34445-e52e-bea2-4b94-d7bc924219d6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B1FC:3DEC57:44DE219:6144A75:6A56D4D1 |
| html-safe-nonce | 318049d6c2407e1c527535bd9879b6b8ccbdd642b45e740984e3d1afb13e4b06 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUZDOjNERUM1Nzo0NERFMjE5OjYxNDRBNzU6NkE1NkQ0RDEiLCJ2aXNpdG9yX2lkIjoiMjkxMDQ4NDYxNTY4ODI3OTI1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 15ecdf3e9df1cdae1b3695ad9a934721a6b3550d1600dbb834b06b841afe6363 |
| hovercard-subject-tag | pull_request:3205245321 |
| 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/1945/files |
| twitter:image | https://avatars.githubusercontent.com/u/131398524?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/131398524?s=400&v=4 |
| og:image:alt | This is a backport of #1808 to the v1.x branch. Original PR description: Summary Fixes incorrect HTTP status code returned by StreamableHTTPSessionManager when receiving requests with unknown or e... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5220a278731283038daf0ed00b41f06ef7ff9539020ecc806c5c5a0fb6bda25a |
| 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 | 952dc124c1d105aa6fc49def04bb458db95747d7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width