fix: correct MCPServer call_tool result type (#2816)

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
This commit is contained in:
冯基魁 2026-06-20 22:56:16 +08:00 • committed by GitHub
commit fda4c54362
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,17 @@ Version 2 of the MCP Python SDK introduces several breaking changes to improve t
## Breaking Changes
### `MCPServer.call_tool()` returns `CallToolResult`
`MCPServer.call_tool()` now always returns a `CallToolResult`. It previously
advertised `Sequence[ContentBlock] | dict[str, Any]` and leaked the internal
conversion shapes (a bare content sequence or a `(content, structured_content)`
tuple), forcing callers to re-assemble a `CallToolResult` themselves.
If you call `MCPServer.call_tool()` directly, read `.content` and
`.structured_content` off the returned `CallToolResult` instead of branching on
the result type.
### `streamablehttp_client` removed
The deprecated `streamablehttp_client` function has been removed. Use `streamable_http_client` instead.