Claude Agent SDK for Python 0.2.140 adds MCP 2.x in-process servers and a structured ResultError instead of exit code 1
Released 18 Aug 2026, the SDK widens its MCP dependency to `mcp>=1.23.0,<3.0.0` and serves in-process SDK MCP servers over mcp's own in-memory transport rather than hand-rolled JSON-RPC, so hand-built `mcp.server.Server` instances now pass resources, prompts and all result content types through verbatim, with tool cancellation on interrupt under 2.x. It also adds `forward_subagent_text` to stream a subagent's text and thinking blocks, a `ResultError` carrying `subtype`, `errors`, `api_error_status`, `terminal_reason` and `session_id` so callers stop string-matching on failures, and `can_use_tool` permission callbacks that now work with plain string prompts. Follow-ups 0.2.141 and 0.2.142 on 19 and 20 Aug bundle Claude CLI 2.1.236 and 2.1.237.
↳ Follow the thread