Model Context Protocol project
Python SDK 2.2.0 and 1.30.0 restrict HTTP redirects and expire idle Streamable HTTP sessions
The official Python SDK released v2.2.0 (2.x line) and v1.30.0 (1.x line) on 2026-09-07, shipping matching behavior changes to both lines. In both, the HTTP client now follows a redirect only if it stays within the endpoint's origin, and a stateful Streamable HTTP session idle for 30 minutes is closed, with a server holding at most 10,000 sessions before returning 503 (session_idle_timeout, max_sessions). Both lines also make the OAuth client validate the authorization server's issuer and add AuthSettings.validate_token_resource. v2.2.0 additionally fixes $ref resolution scope in a tool's outputSchema, resolving references within the schema document only.
The official Python SDK released v2.2.0, on the 2.x line, and v1.30.0,
on the 1.x line, both on 2026-09-07. The two release bodies describe
matching behavior changes shipped to both lines. The HTTP client
(Client, streamable_http_client, and sse_client on 2.x;
streamable_http_client and sse_client on 1.x) now follows a
redirect "only if it stays on the same scheme, host and port," or an
http-to-https upgrade on the same host; a redirect elsewhere fails the
request instead (MCPError on 2.x, httpx.HTTPStatusError on 1.x).
The follow_redirects setting on a caller-supplied HTTP client is no
longer used for MCP requests, and the OAuth providers apply the same
origin rule to their own requests.
Both lines now expire idle Streamable HTTP sessions. A stateful session
idle for 30 minutes is closed, and the client's next request gets a 404
and must reinitialize; a server also caps concurrent sessions at
10,000, returning 503 beyond that. session_idle_timeout and
max_sessions turn either limit off (mcp.run() and related entry
points on 2.x, FastMCP(...) on 1.x). The 2.x notes add that clients
holding the GET stream open, and stateless servers or 2026-07-28
connections, are not affected. Both lines also make the OAuth client
validate the authorization server's issuer on discovery: 2.x extends
a check already applied via protected resource metadata since 2.0 to
the legacy path as well (#3398), while 1.x rejects a mismatched issuer
outright and re-registers the client if the server later points at a
different authorization server (#3431). Both add
AuthSettings.validate_token_resource, to accept only tokens the
configured TokenVerifier reports as issued for that server, and an
issuer= parameter on ClientCredentialsOAuthProvider and
PrivateKeyJWTOAuthProvider, alongside two new deprecation warnings for
constructing those without it.
v2.2.0 carries one fix not stated in v1.30.0's release notes: $refs
in a tool's outputSchema now resolve within that schema document
only, and an unresolvable reference surfaces as RuntimeError: Invalid schema for tool ... (#3394). v2.2.0 also closes session-cleanup gaps
where a client DELETE did not free its session immediately and a
refused opening request could leave one behind (#2455, #3228, #3300).
Related spec revisions
- MCP 2026-07-28 - current
Related publishers
How was this verified, and what are the sources?
Published · last verified · confidence 1.00.
- Python SDK v2.2.0 release notes, published 2026-09-07 - redirects followed "only if it stays on the same scheme, host and port"; idle Streamable HTTP sessions expire after 30 minutes, capped at 10,000 sessions, with "stateless servers or 2026-07-28 connections" exempt; OAuth issuer validation extended to the legacy path (#3398); AuthSettings.validate_token_resource (#3447); $ref resolution scoped to the schema document (#3394) - accessed
- Python SDK v1.30.0 release notes, published 2026-09-07 - the same redirect-origin restriction (#3448), idle session expiry with session_idle_timeout/max_sessions (#3426), authorization server issuer validation (#3431), and AuthSettings.validate_token_resource (#3451), backported to the 1.x line - accessed