v2.1.0
Added 5
- Client accepts StdioServerParameters directly
- Prompt messages accept Image and Audio
- Prompt functions may return bare content blocks
- Message, UserMessage, and AssistantMessage are exported from mcp.server.mcpserver
- SseServerTransport and MCPServer.sse_app() take max_request_body_size parameter
Changed 3
- Handler exceptions from tool, resource or prompt handlers are logged once at ERROR with traceback, and client sees only Error executing message instead of exception text
- Content-block return annotations no longer advertise outputSchema or return structuredContent for tools returning TextContent, EmbeddedResource, Image, Audio, or lists/unions of them
- The 4 MiB request body limit now covers the SSE transport and OAuth endpoints
Fixed 8
- TypedDict tool results with NotRequired keys are omitted instead of serialized as null
- TypedDict tool registration no longer fails on Python 3.10
- Recursive tool return types get an object-rooted outputSchema that pre-2026 clients accept
- POSTed notifications such as notifications/cancelled are acknowledged with 202 instead of 400 on 2026-07-28 HTTP entry
- Pre-2026 sessions ignore cache-hint fields from later revisions instead of failing list_tools()
- Pre-2026 sessions accept boolean sub-schemas in tool schema properties
- mcp install reads and preserves Claude Desktop config containing non-ASCII text on any Windows code page
- SSE message endpoint answers 405 to non-POST requests
From MCP Python SDK
Highlights
ClientacceptsStdioServerParametersdirectly:Client(StdioServerParameters(command="uv", args=["run", "server.py"]))(#3321).- Prompt messages accept
ImageandAudio, prompt functions may return bare content blocks, andMessage/UserMessage/AssistantMessageare exported frommcp.server.mcpserver(#3320). - The 4 MiB request body limit now also covers the SSE transport and the OAuth endpoints;
SseServerTransportandMCPServer.sse_app()takemax_request_body_size, and the SSE message endpoint answers 405 to non-POST requests (#3336).
Behaviour changes to be aware of
- Handler exceptions (#3314): an unexpected exception from a tool, resource or prompt handler is logged once at ERROR with its traceback, and the client now sees only
Error executing tool <name>(or the resource/prompt equivalent) rather than the exception text. RaiseToolError/ResourceErrorwhen the message is meant for the model; those still reach the client and are logged at INFO without a traceback. - Content-block return annotations (#3320): a tool annotated to return
TextContent,EmbeddedResource,Image,Audio, or lists/unions of them no longer advertisesoutputSchemaor returnsstructuredContent; itscontentis unchanged. Passstructured_output=Trueto keep the previous shape.
Fixes
- TypedDict tool results:
NotRequiredkeys are omitted instead of serialized asnull, and registration no longer fails on Python 3.10 (#3224, #3227); recursive return types get an object-rootedoutputSchemathat pre-2026 clients accept (#3337). - 2026-07-28 over HTTP: a POSTed notification such as
notifications/cancelledis acknowledged with 202 instead of rejected with 400 (#3324). - Pre-2026 sessions ignore cache-hint fields from later revisions instead of failing
list_tools()(#3223), and accept boolean sub-schemas in tool schemaproperties(#3353). mcp installreads and preserves a Claude Desktop config containing non-ASCII text on any Windows code page (#3296).
What's Changed
- Retire wording tied to pre-2.0 milestones by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3211
- Describe the maintenance line without hardcoding 1.28 by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3212
- Ask which release line a bug report is on by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3213
- Link the released 2026-07-28 spec and point migrators at /v1/ by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3214
- Bump conformance harness to 0.2.0-alpha.11 by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3282
- Read UTF-8 test fixtures with explicit encoding by @ShuQingDollarVoyager in https://github.com/modelcontextprotocol/python-sdk/pull/3245
- Pin each conformance leg to a spec-revision wire by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3304
- docs: publish translated docs in twelve languages and the tool that maintains them by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3280
- Pin text I/O to UTF-8 and fail CI on locale-dependent reads/writes by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3296
- docs: lead the README client example with a URL, not the server object by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3315
- Publish versioning, roadmap, and dependency policies for v2 by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3215
- Drop later-revision cache-hint fields on pre-2026 sessions by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3223
- Stop framing breaking changes as a workflow in AGENTS.md by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3286
- MCPServer: content-block returns are unstructured, prompt messages take Image/Audio by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3320
- Let Client take StdioServerParameters directly by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3321
- Gate external PRs on an assigned, linked issue by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3291
- docs: cover the remaining Tier 1 audit items by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3325
- Acknowledge notification POSTs with 202 on the 2026-07-28 HTTP entry by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3326
- Shorten stdio test comments by @Kludex in https://github.com/modelcontextprotocol/python-sdk/pull/3329
- Hand TypedDict tool results to pydantic natively by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3331
- Apply the request body limit to the SSE and OAuth endpoints by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3336
- Accept boolean sub-schemas in 2025-11-25 tool schema properties by @pja-ant in https://github.com/modelcontextprotocol/python-sdk/pull/3354
- Log MCPServer handler exceptions by kind and keep crash details off the wire by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3314
- Give recursive tool return types an object-rooted output schema by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3376
- docs: refresh translations for recent English changes by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3379
- Build releases with the pinned hatchling and a publish action that accepts Metadata 2.5 by @maxisbey in https://github.com/modelcontextprotocol/python-sdk/pull/3380
New Contributors
- @ShuQingDollarVoyager made their first contribution in https://github.com/modelcontextprotocol/python-sdk/pull/3245
Full Changelog: https://github.com/modelcontextprotocol/python-sdk/compare/v2.0.0...v2.1.0