Async-First Python SDK for Cloud AI Agents
Overview
The Python SDK for Chucky (chucky-sdk on PyPI), an async-first client for building Claude-powered AI assistants, with streaming, locally-executed tools, and MCP support.
Why It Exists
Python is the default language for AI/ML and backend automation. This SDK gives Python developers first-class access to the cloud agent platform with idiomatic asyncio and Pydantic-typed responses, matching the TypeScript SDK’s capabilities.
What We Built
A compact, focused package (chucky/) with client.py (async prompt/stream and session handling over a WebSocket connection), tools.py for defining tools that execute locally in the caller’s Python process, types.py with Pydantic v2 models, and utils.py. Streaming yields typed events that callers iterate with async for; tool calls round-trip back to the local handler. Dependencies are deliberately minimal, websockets and pydantic, with optional python-dotenv. Supports Python 3.10 through 3.13, with an examples/ directory and a tests/ suite.
Technologies & Approach
Async-first design built on websockets and Pydantic v2 for validated, strongly-typed message handling. Keeping the dependency surface tiny makes it easy to embed in existing services and notebooks.
Outcome / Impact
Extends the platform to the Python ecosystem with the same session/streaming/tools/MCP feature set as the reference TypeScript SDK, published and installable via pip/poetry/uv.
Capabilities Demonstrated
- Async streaming client design (
asyncio+websockets) - Strongly-typed responses with Pydantic v2
- Locally-executed custom tools and MCP support
- Cross-language SDK parity with a shared protocol