MCP Python SDK v2.3.0: SSE size cap, subscription opt-out, HeaderMismatch retry
sdkMCP Python SDK v2.3.0 adds max_sse_event_size on Streamable HTTP clients, an MCPServer(subscriptions=False) opt-out, a get_tool_input_schema hook for low-level servers, and one-shot client retry after a HeaderMismatch (-32020). Also stops counting interactive OAuth logins against request timeouts, rejects invalid x-mcp-header annotations at registration, and omits empty _meta/params/experimental fields on legacy connections.
an agent can now cap SSE event size on Streamable HTTP, opt out of subscriptions, auto-retry tool calls after a HeaderMismatch, and run interactive OAuth logins without request timeouts expiring mid-flow.
Point release of the official MCP Python SDK. Mostly fixes but ships several agent-visible new options: max_sse_event_size, MCPServer(subscriptions=False), Server(get_tool_input_schema=...), and automatic retry on HeaderMismatch (-32020). Also tightens x-mcp-header validation at registration.
pip install -U mcp==2.3.0from mcp.client.streamable_http import streamable_http_client
from mcp import ClientSession
# Raise SSE event size cap for large tool results (new in v2.3.0)
async with streamable_http_client(
url="https://example.com/mcp",
max_sse_event_size=8 * 1024 * 1024, # 8 MiB, or None for unlimited
) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
# Client.call_tool now auto-retries once after a HeaderMismatch (-32020)
result = await session.call_tool("search", {"q": "mcp"})
print(result)