MCP Python SDK v2.3.0
MCP Python SDK v2.3.0 is out with bug fixes, stricter tool header registration validation, omitted empty meta/params on older protocol connections, pause handling during OAuth login, and new configurable SSE size limits.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
The Model Context Protocol Python SDK released version 2.3.0, focusing primarily on bug fixes alongside new configuration options. Key behavioral changes include: - Dependency update: Requires httpx2 =2.10.0 (previously =2.5.0) to support configurable SSE event sizing. - Strict header validation: Tools with invalid x-mcp-header annotations now fail registration immediately with InvalidSignature rather than being silently ignored. Only plain str , int , and bool parameters are allowed directly; optional header parameters must specify schemas explicitly via WithJsonSchema . - Payload cleanliness: Empty meta and params fields are no longer sent on 2025-11-25 and earlier protocol versions. Receiving middleware will see ctx.meta and ctx.params as None instead of empty dictionaries on those requests. - Tool lookup optimization: Validation for Mcp-Param- headers now looks up registered schemas directly by tool name rather than querying tools/list on every tools/call invocation. - OAuth timeout adjustment: Request timeouts are paused while awaiting redirect and callback handlers during interactive OAuth flows. - New configurations: Added max sse event size parameter on streamable HTTP clients, MCPServer(subscriptions=False) to disable subscription handling, and automatic retry for Client.call tool upon HeaderMismatch (-32020) errors.
可执行摘要
MCP Python SDK v2.3.0 introduces behavior adjustments: raises InvalidSignature on invalid x-mcp-header tool annotations at registration, omits empty meta/params on legacy connections, eliminates automatic tools/list calls on tool execution, pauses request timeouts during interactive OAuth login, bumps minimum httpx2 to =2.10.0, and exposes max sse event size.
- Agent 实用度
- 77/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Upgrade to mcp v2.3.0 ( pip install -U mcp ) and ensure httpx2 is not pinned below 2.10.0.
- Audit @mcp.tool definitions using x-mcp-header to verify parameter types conform to plain str , int , or bool , and convert optional headers to explicit WithJsonSchema declarations to avoid InvalidSignature errors.
- Update middleware and client logic relying on legacy connections to handle ctx.meta or ctx.params being None rather than empty {} .
- Configure max sse event size on Streamable HTTP clients if your implementation handles SSE payloads exceeding the 1 MiB default.