Title: fix(client): surface streamable HTTP 401 as JSON-RPC error by Sehlani042 · Pull Request #3051 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: fix(client): surface streamable HTTP 401 as JSON-RPC error by Sehlani042 · Pull Request #3051 · modelcontextprotocol/python-sdk
X Title: fix(client): surface streamable HTTP 401 as JSON-RPC error by Sehlani042 · Pull Request #3051 · modelcontextprotocol/python-sdk
Description: Summary map bare Streamable HTTP 401 POST responses for JSON-RPC requests to a correlated JSON-RPC error instead of the generic fallback keep existing JSON-RPC error bodies, 404 pre-session, and session-terminated handling unchanged add a regression test for operation-specific authorization failures Fixes #1295. Verification RED: PATH=/tmp/codex-uv-0.9.5/bin:$PATH uv run pytest tests/client/test_streamable_http.py::test_bare_401_request_maps_to_unauthorized_jsonrpc_error -q failed with Server returned an error response vs Unauthorized GREEN: PATH=/tmp/codex-uv-0.9.5/bin:$PATH uv run pytest tests/client/test_streamable_http.py::test_bare_401_request_maps_to_unauthorized_jsonrpc_error tests/client/test_streamable_http.py -q PATH=/tmp/codex-uv-0.9.5/bin:$PATH uv run ruff check src/mcp/client/streamable_http.py tests/client/test_streamable_http.py PATH=/tmp/codex-uv-0.9.5/bin:$PATH uv run ruff format --check src/mcp/client/streamable_http.py tests/client/test_streamable_http.py PATH=/tmp/codex-uv-0.9.5/bin:$PATH uv run pyright src/mcp/client/streamable_http.py tests/client/test_streamable_http.py git diff --check Note: the local Homebrew uv is 0.9.4 while this repo requires >=0.9.5, so verification used an isolated /tmp/codex-uv-0.9.5 binary.
Open Graph Description: Summary map bare Streamable HTTP 401 POST responses for JSON-RPC requests to a correlated JSON-RPC error instead of the generic fallback keep existing JSON-RPC error bodies, 404 pre-session, and s...
X Description: Summary map bare Streamable HTTP 401 POST responses for JSON-RPC requests to a correlated JSON-RPC error instead of the generic fallback keep existing JSON-RPC error bodies, 404 pre-session, and s...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/3051
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:fddb34bc-5d50-35ea-f611-eaf7f9e31c28 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E29A:171EFB:15099F1:1DB92A7:6A61CE10 |
| html-safe-nonce | 331ccb3969159ca598af890e65e6d27b7e74aa22c86d8d82da2c4c4a2ffdd65f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjlBOjE3MUVGQjoxNTA5OUYxOjFEQjkyQTc6NkE2MUNFMTAiLCJ2aXNpdG9yX2lkIjoiNTQ2NzExNTg0MTk2NzQ3NjI0MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 21b0201e7abcd3f0da0969a237dc0291fca86097558f24577b8d66d4ee0e1dc4 |
| hovercard-subject-tag | pull_request:3975537609 |
| 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/3051/files |
| twitter:image | https://avatars.githubusercontent.com/u/257166922?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/257166922?s=400&v=4 |
| og:image:alt | Summary map bare Streamable HTTP 401 POST responses for JSON-RPC requests to a correlated JSON-RPC error instead of the generic fallback keep existing JSON-RPC error bodies, 404 pre-session, and s... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b2de8c74e5e61e893155ba46ee41bc66170c1644cb795adefa8386d490f7781c |
| 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 | d1866027ded575df8a15c731dd8b9986c9483ceb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width