Files
Max Isbey b8a107d16c Scope HTTP client redirect following to the request's origin
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
2026-07-07 19:41:45 +00:00
..

Python SDK examples

  • stories/the canonical reference. One self-verifying example per protocol feature, each with its own README. Start with stories/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 the v1.x branch); superseded by docs_src/, which the docs and README embed today. Retained pending consolidation into stories/.
  • 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 by stories/ and slated for removal.
  • clients/ and the remaining servers/ directories (simple-*, sse-polling-demo, structured-output-lowlevel) — standalone v1-era projects retained pending consolidation into stories/ (the simple-auth pair is still linked from docs/run/authorization.md and docs/client/oauth-clients.md).

For real-world servers see the servers repository.