Claude Agent SDK v0.1.70 Fixes Silent MCP Data Loss and Trio Async Crashes
Anthropic has released v0.1.70 of the Claude Agent SDK for Python, resolving a critical bug where Model Context Protocol (MCP) tool results were silently replaced by validation errors.
What Happened
- Mandatory MCP Upgrade: The SDK now enforces a dependency floor for the
mcplibrary at version1.19.0or higher. Older versions of themcplibrary contained a flaw in how they handledCallToolResultobjects returned from SDK-managed tool handlers. This caused the model to receive a generic validation-error blob instead of the actual data generated by the tool. - Trio Nursery Stability: The update fixes a
RuntimeError: Nursery stack corruptedthat occurred when using the Trio concurrency framework. This crash was triggered specifically when breaking out of aquery()iteration early whileoptions.stderrwas enabled, which is a common pattern for developers attempting to implement custom timeouts or early-exit logic in agentic loops. - In-Process Tool Correction: The primary fix targets in-process MCP tools. In previous versions, even if your tool logic executed perfectly, the handoff between the tool handler and the SDK's protocol layer could fail, leading to a "black hole" where tool outputs never reached the LLM's context window.
Why This Matters for Agent Builders
Silent failures are the most expensive bugs to debug in agentic workflows. When an SDK sends a validation error instead of tool output, the model often tries to "hallucinate" a fix or enters a repetitive loop of retrying the same failed tool call, leading to wasted tokens and unpredictable agent behavior. By bumping the mcp dependency floor, builders are protected from this protocol-level mismatch.
For developers building production-grade agents that require high availability, the fix for Trio nursery corruption is equally vital. Trio is often chosen for its strict "structured concurrency" guarantees; having the SDK corrupt the nursery stack undermined the primary reason for using Trio in the first place. This fix allows for graceful cancellations and cleaner error handling when agents are running in complex, multi-tasking environments.
Try It
To ensure your agent isn't losing tool data or crashing during async execution, update your environment and verify that the mcp library has been correctly promoted:
pip install --upgrade claude-agent-sdk
pip show mcp
If you are using Trio for your agent's event loop, you can now safely break out of query iterations even with internal logging enabled:
import trio
from claude_agent_sdk import Agent
async def run_agent():
agent = Agent()
async with trio.open_nursery() as nursery:
# options.stderr used to cause nursery corruption on break
async for event in agent.query("Run diagnostics", options={"stderr": True}):
if "target_found" in event:
break
Bottom Line
V0.1.70 is a critical maintenance release that stabilizes the underlying protocol handshake for MCP and ensures that async agent loops can be cancelled without crashing the runtime.
Source: https://github.com/anthropics/claude-agent-sdk-python/releases/tag/v0.1.70 — auto-curated by ben-bot. 2026-05-01.