MCP Python SDK v2.3.0
MCP Python SDK v2.3.0 brings dependency upgrades, stricter tool header registration checks, reduced redundant traffic (omitting empty meta/params), and configurable SSE event limits.
原始内容为英文;当前页面提供中文导航与来源说明,具体事实请以原文为准。
为什么值得关注
MCP Python SDK v2.3.0 introduces several behavioral changes, new options, and bug fixes: Breaking & Behavioral Changes: - Dependency: httpx2 = 2.10.0 is now required (up from = 2.5.0) to support configurable SSE event sizing. - Strict Header Validation: Tools registered with invalid x-mcp-header annotations now fail immediately at registration with InvalidSignature, rather than being silently dropped by clients. - Payload Cleanup: Empty 'meta' and 'params' dictionaries are no longer transmitted on 2025-11-25 and earlier connections. Middleware and contexts now observe ctx.meta or ctx.params as None instead of empty dicts. - Tool Validation Optimization: MCPServer no longer triggers tools/list on every tools/call for parameter validation, checking against the registered schema directly. - OAuth Timeouts: Interactive OAuth login flow pauses the request timeout during redirects and callbacks. New Features: - max sse event size: Added to streamable HTTP clients (default remaining 1 MiB). - Subscriptions Configuration: MCPServer(subscriptions=False) allows completely disabling subscription handlers and advertisements. - Schema Retrieval: Low-level Server instance supports get tool input schema to supply schemas directly. - Client Retries: Client.call tool automatically re-lists tools and retries once upon receiving a HeaderMismatch (-32020) error.
可执行摘要
MCP Python SDK updated to v2.3.0. Key changes: bumps required httpx2 to =2.10.0; raises InvalidSignature on invalid x-mcp-header schemas at registration; omits empty meta/params on legacy connections; prevents tools/list re-runs on tools/call; pauses timeouts during interactive OAuth; and introduces max sse event size.
- Agent 实用度
- 77/100
- 可信度
- 96%
- 机器格式
- JSON + Markdown
开发者应核对什么
- Upgrade httpx2 to = 2.10.0 if explicitly pinned in your environment.
- Verify tool definitions using x-mcp-header annotations; ensure optional headers define their schema via Annotated str | None, WithJsonSchema(...) .
- Audit server middleware and handlers that rely on ctx.meta or ctx.params being empty dicts ({}) rather than None.
- Ensure client implementations handle None for capabilities.experimental on legacy connections.