返回全部动态

MCP Python SDK 发布 v2.3.0:多项行为变更与三个新选项

原标题:v2.3.0

MCP Python SDK Releases一手来源开源质量 76

AI 摘要

MCP Python SDK 发布 v2.3.0,以修复为主并新增三个选项。行为变更包括:要求 httpx2>=2.10.0、注册时拒绝无效 x-mcp-header 注解的工具、不再发送空的 _meta 和 params、initialize 不再发送空的 experimental、Mcp-Param-* 校验改为按名称查找工具、交互式 OAuth 登录不再计入请求超时。新增 max_sse_event_size、MCPServer(subscriptions=False)、Server(get_tool_input_schema=...) 以及 call_tool 在 HeaderMismatch 后重试一次等能力。

以上摘要由 AI 生成,可能存在误差。事实请以原文为准。

正文节选

`pip install -U mcp`. Docs: https://py.sdk.modelcontextprotocol.io/ Mostly fixes, plus three new options. A few things behave differently, so skim these first: ## Behaviour changes **`httpx2>=2.10.0` is now required** (#3600) - It was `>=2.5.0`. The new `max_sse_event_size` option needs it. - Nothing to do unless you pin `httpx2` below 2.10. **A tool with an invalid `x-mcp-header` annotation fails at registration** (#3620) - `@mcp.tool()`, `add_tool` and `Tool.from_function` raise


发布时间:2026-10-03 06:02
抓取时间:2026-10-03 06:11
来源机构:MCP
阅读原文github.com