b8a107d16c
create_mcp_http_client followed every redirect, so everything configured on a client (headers, auth, request bodies) was re-sent to whatever host a Location header named. Clients built by the factory now follow redirects within the same origin (scheme, host, and port), plus http-to-https upgrades of the same host on default ports, and raise the new RedirectError for anything else - before the next request is sent. - transports resolve a refused redirect in-band: requests get a JSON-RPC error naming the target and the remedy, notifications are delivered to the session's message handler; the standalone GET stream stops retrying an endpoint that keeps redirecting - caller-supplied clients that follow no redirects get the same clear error on POST, GET stream, and SSE connect instead of an opaque content-type error - OAuth discovery, registration, token, refresh, and the identity-assertion token exchange fail loudly on redirect responses instead of silently trying the next URL or abandoning the discovery chain - RedirectError and create_mcp_http_client are exported from the top-level mcp package; migration.md documents the behavior change; docs and examples configure clients through the factory, and the general-purpose fetch example uses a browser-like client of its own
Python SDK examples
stories/— the canonical reference. One self-verifying example per protocol feature, each with its own README. Start withstories/tools/; the stories README has the full table and how to run them.snippets/— short extracts that were embedded into the v1 README (now on thev1.xbranch); superseded bydocs_src/, which the docs and README embed today. Retained pending consolidation intostories/.servers/everything-server/— the conformance target for the cross-SDK conformance suite. Exercises every server capability in one process.mcpserver/— single-file v1-era examples retained for the migration guide; superseded bystories/and slated for removal.clients/and the remainingservers/directories (simple-*,sse-polling-demo,structured-output-lowlevel) — standalone v1-era projects retained pending consolidation intostories/(thesimple-authpair is still linked fromdocs/run/authorization.mdanddocs/client/oauth-clients.md).
For real-world servers see the servers repository.