anthropics/claude-agent-sdk-python
OfficialThe Claude Agent SDK for Python — enables programmatic control of Claude Code to build autonomous agents.
The Claude Agent SDK for Python is an official MIT-licensed Python library from Anthropic that enables developers to create autonomous AI agents using Claude models, complete with built-in OS tools, MCP server integration, and multi-agent orchestration.
Best for
Our Review
Claude Agent SDK for Python is the official Anthropic SDK for Claude agents -- 6,184 GitHub stars as of April 2026. Released under the MIT license, it runs on Python 3.10+ and delivers OS access plus MCP tools without extra setup.
What Claude Agent SDK for Python does:
- •Agent orchestration Agents use tools, call APIs, and spawn sub-agents for complex tasks.
- •MCP integration Agents connect directly to MCP servers for extended tool access.
- •OS access tools Native filesystem read/write, terminal bash, and process management work out of the box.
- •Bundled Claude Code CLI No separate install needed; SDK includes it by default.
- •Multi-agent patterns Coordinate multiple Claude instances in one app.
- •Async-first design Modern Python support handles concurrent agent runs efficiently.
- •Tool permissions Control allowed_tools and permission_mode for safe execution.
Claude Agent SDK for Python ecosystem:
- •Anthropic docs Full guides at platform.claude.com cover query(), options, and permissions.
- •MCP servers Standard protocol pairs with external tool servers.
- •Claude Code evolution Builds on deprecated SDK with versioned releases like v0.1.56.
Getting started:
Install with pip install claude-agent-sdk. Run a quick query:
```python import anyio from claude_agent_sdk import query
async def main(): async for message in query(prompt="What is 2 + 2?"): print(message)
anyio.run(main) ```
Set options for tools:
```python from claude_agent_sdk import ClaudeAgentOptions
options = ClaudeAgentOptions(allowed_tools=["Read", "Write", "Bash"]) ```
Check platform.claude.com/docs for full examples.
Limitations:
Requires Python 3.10+ and Anthropic API keys for Claude access. Early version (v0.1.56) means potential bugs in multi-agent flows. Async-only design demands familiarity with anyio or asyncio.
Cons
- Requires Python 3.10+ and Anthropic API keys for Claude access.
- Early version (v0.1.56) means potential bugs in multi-agent flows.
- Async-only design demands familiarity with anyio or asyncio.
- No built-in UI; focus stays on SDK for coded agents.
Our Verdict
Vibe Builders grab Claude Agent SDK for Python to prototype AI-native apps fast. It gives Claude real OS power and MCP tools without setup hassle. You ship autonomous agents that edit files or run bash in minutes.
Developers choose it as the first-party Anthropic option over LangChain abstractions. Production apps gain from bundled CLI, versioned releases, and official docs. MCP support future-proofs tool integrations.
Skip Claude Agent SDK for Python if you avoid coding or need no-API-key local runs. Pick OpenAI Agents SDK instead for proprietary tools.
Frequently Asked Questions
What is Claude Agent SDK for Python and what does it do?
Claude Agent SDK for Python is Anthropic's official SDK for building Claude-powered agents. It provides OS tools, MCP integration, and multi-agent orchestration. Developers use query() for async interactions with full Claude Code toolset.
Is Claude Agent SDK for Python free and open source?
Claude Agent SDK for Python is free and open source under the MIT license. Anthropic maintains it on GitHub with 6,184 stars. Install via pip with no cost beyond API usage.
Claude Agent SDK for Python vs OpenAI Agents SDK -- which should I use?
Claude Agent SDK for Python supports the MCP standard for tools. OpenAI Agents SDK uses proprietary formats. Choose Claude Agent SDK for Python when MCP ecosystem matters, OpenAI Agents SDK when proprietary tools fit.
How do MCP servers work with Claude Agent SDK for Python?
MCP servers extend agent tools via the MCP protocol. Claude Agent SDK for Python includes native client support. Agents connect automatically for external capabilities like custom APIs.
How do I install and get started with Claude Agent SDK for Python?
Install Claude Agent SDK for Python with `pip install claude-agent-sdk` on Python 3.10+. The 2026 v0.1.56 release bundles Claude Code CLI. Start with `query(prompt="task")` in an async function.
What is claude-agent-sdk-python?
The Claude Agent SDK for Python is an official MIT-licensed Python library from Anthropic that enables developers to create autonomous AI agents using Claude models, complete with built-in OS tools, MCP server integration, and multi-agent orchestration.
What license does claude-agent-sdk-python use?
claude-agent-sdk-python uses the MIT license.
What are alternatives to claude-agent-sdk-python?
Search My AI Guide for similar tools in this category.
Great for: Pro Vibe Builders
Skip if: You need something more beginner-friendly or guided
Open source & community-verified
MIT licensed — free to use in any project, no strings attached. 6,416 developers have starred this, meaning the community has reviewed and trusted it.
Reviewed by My AI Guide for relevance, quality, and active maintenance before listing.
Topics