Skip to content

v1.2.1

Choose a tag to compare

@cryxnet cryxnet released this 10 Oct 15:18
· 168 commits to 166aebaca376eeae2a0a5b90009a7ee53d5d3ab4 since this release

A patch release with two fixes to the MCP SDK. Upgrade with pip install -U promptise.

Fixed

A rejected connection no longer hangs. Before, connecting to an HTTP MCP server that refused the handshake left MCPClient, MCPMultiClient and build_agent() waiting, then crashed with a cancel-scope traceback. The usual cause was a 401 Unauthorized from a server built with require_auth=True when the key was missing or wrong. Now the connection fails at once with a typed MCPConnectionRejectedError, and the message tells you what to check:

Server 'orders' rejected the connection: 401 Unauthorized. Check the bearer_token/api_key configured for it.

The error carries status_code, reason, url and server_name. Other connection failures now raise a readable MCPClientError and never cancel the caller's task. See Rejected connections and the new examples/mcp/client_auth_errors.py.

Tool parameters keep their descriptions. @server.tool() dropped the metadata from Annotated[T, Field(description=..., ge=..., pattern=...)], so descriptions and constraints were missing from the tool schema and weren't enforced. Both now work. So does a Field(...) default, which before silently made the parameter optional. Parameters without a Field description now take it from the docstring's Args: section, or from Sphinx :param: fields.

Changed

The tool description is the docstring's whole summary paragraph. Tools, resources and prompts without description= used to send only the first line of the docstring, so a summary wrapped over two lines was cut mid-sentence. They now send everything up to the first blank line or Args: section. See Describing parameters.

Full changelog: https://github.com/promptise-com/foundry/blob/main/CHANGELOG.md