MCP Python SDK v2.0.0rc1

v2.0.0rc1Pre-release
Added 1
  • stdio server decides the protocol era from the client's opening request, enabling subscriptions/listen and other 2026-07-28 features over stdio
Changed 9
  • Client(cache=False) is now Client(cache=None); CacheConfig() is the default and None switches the response cache off
  • Client-credentials OAuth providers now take scope= instead of scopes=
  • message_handler receives ServerNotification | Exception only; the RequestResponder arm and mcp.shared.session module are removed
  • FileResource(is_binary=...) is replaced by encoding: str | None
  • Streamable HTTP servers reject request bodies over 4 MiB with HTTP 413; raise max_request_body_size to accept larger messages
  • Request-side clientInfo _meta key is now optional; serverInfo moved out of server/discover result body into every 2026-era result's _meta
Removed 4
  • Context.client_id is removed; read _meta via ctx.request_context.meta or the authenticated client via get_access_token().client_id
  • RFC7523OAuthClientProvider and JWTParameters are removed; use ClientCredentialsOAuthProvider, PrivateKeyJWTOAuthProvider, or IdentityAssertionOAuthProvider
  • OAuthClientProvider(timeout=...) parameter is removed
  • MCP_* environment variables no longer configure MCPServer and pydantic-settings is dropped from runtime dependencies

First v2 release candidate. Pre-releases are opt-in only; pip install mcp still resolves to the stable 1.x line.

pip install mcp==2.0.0rc1
# or
uv add "mcp==2.0.0rc1"

The documentation has the full tutorial and API reference, and the migration guide covers coming from v1. Stable v2 is planned for 2026-07-28 alongside the spec release - keep pinning an exact version until then.

Highlights
API cleanup ahead of stable (breaking for beta users)

The last pre-release pass over the public surface; every item has a migration guide entry.

  • Client(cache=False) is now Client(cache=None): CacheConfig() is the default and None switches the response cache off (#3164).
  • Context.client_id is removed - read _meta via ctx.request_context.meta, or the authenticated client via get_access_token().client_id (#3167).
  • RFC7523OAuthClientProvider and JWTParameters are removed - use ClientCredentialsOAuthProvider, PrivateKeyJWTOAuthProvider, or IdentityAssertionOAuthProvider (#3169).
  • The client-credentials providers take scope=, not scopes= (#3166).
  • OAuthClientProvider(timeout=...) is removed; it never bounded anything (#3165).
  • message_handler receives ServerNotification | Exception only; the dead RequestResponder arm and the mcp.shared.session module are gone (#3168).
  • FileResource(is_binary=...) is replaced by encoding: str | None (#3171).
  • MCP_* environment variables never configured MCPServer and are no longer advertised; pydantic-settings is dropped from the runtime dependencies (#3170).
  • Streamable HTTP servers reject request bodies over 4 MiB with HTTP 413; raise max_request_body_size if you accept larger messages (#3095).
Aligned with the final 2026-07-28 identity shape (#3143)

The request-side clientInfo _meta key is optional (the required pair is protocolVersion + clientCapabilities), and serverInfo moved out of the server/discover result body into every 2026-era result's _meta; client.server_info is now Implementation | None. This tracks spec change #3002 and fixes interop with servers that already omit body serverInfo.

The full 2026-07-28 revision over stdio (#3152)

A stdio (or in-memory) server now decides the protocol era from the client's opening request, so subscriptions/listen and every other 2026-07-28 feature serve over stdio, not only Streamable HTTP.

stdio servers keep handlers off the wire (#3117)

stdio_server() serves from private duplicates of stdin/stdout and points fd 0 at the null device and fd 1 at stderr while it runs, so a stray print() or a chatty child process can no longer corrupt the JSON-RPC stream. This fixes the classic print-corrupts-the-wire class (#409) and the Windows tool-call hang (#671).

Notes
  • Tool results validated against an output schema are much faster: the JSON Schema validator is compiled once and cached (#3134).
  • The tasks extension (SEP-2663) is not in this release, and will not be in v2.0.0.
  • If you install under uv's exclude-newer cooldown: mcp pins mcp-types to the exact same version, so exempt both packages - exclude-newer-package = { mcp = false, mcp-types = false }.
What's Changed
New Contributors

Full Changelog: https://github.com/modelcontextprotocol/python-sdk/compare/v2.0.0b2...v2.0.0rc1

View original

Upgraded? How did it go?

Discussion