v1.1.4
What's Changed
MCP Sampling
- Advertise the
sampling.toolssub-capability via a thinClientSessionsubclass; pydantic-ai's__aenter__picks up the patched class through module-attribute lookup, so MCP servers can now issuesampling/createMessagewith tool definitions instead of falling back to a manual review path - Route sampling requests to the env-configured default model (
DEFAULT_PROVIDER+ matching*_DEFAULT_MODEL); resolution failure (e.g. missing API key) silently disables sampling - New
MCP_ALLOW_SAMPLING=true|falseenv flag as a kill switch for cost/privacy reasons; when off, the patched session does not advertisesampling.toolsand pydantic-ai passes no callback
UX
- Welcome screen now shows
Sampling Model: <provider>/<model>(ordisabled) alongside Provider/Model and the connected MCP servers - Mark known sampling-using servers with
— uses samplingin the connected-servers list - Each server-initiated sampling exchange renders as a collapsible
Used Sampling: <server>step nested under the in-flight tool that triggered it (falling back to the run step if no tool is active); prompt and response are shown as wrapping markdown rather than a non-wrapping code block, truncated atSTEP_OUTPUT_LIMIT
Dependencies
- Bumped
pydantic-aifloor to>=1.89.0(latest at release time); patch confirmed compatible with 1.89.1's MCP__aenter__call site
Full Changelog: v1.1.3...v1.1.4