1002 words
5 minutes
Claude Agent SDK: Anthropic's MCP-Native Agent Toolkit

LangGraph, CrewAI, and AutoGen all support MCP as a feature you can plug in. The Claude Agent SDK is different: MCP is the foundation, not an add-on.

Anthropic’s agent framework was built alongside the MCP specification. Every agent in this SDK speaks MCP natively — connecting tools, reading resources, and managing prompts through the protocol. If you’ve been following this blog’s MCP series and Kiro series, this is the framework designed from the ground up for the world those posts described.

Launched in early 2026, the Claude Agent SDK sits below Claude Code in Anthropic’s product stack. Claude Code is the full IDE experience. The SDK is what you use to build your own agents, automate workflows, and embed Claude’s capabilities into your applications.


What Makes It Different#

Three design decisions set the Claude Agent SDK apart from every other framework:

1. MCP-Native Architecture#

Every other framework treats MCP as one integration option among many. The Claude Agent SDK doesn’t have an “MCP adapter” — the agent loop itself communicates through MCP.

from claude_agent import Agent, MCPConfig
agent = Agent(
model="claude-sonnet-4",
mcp_servers=[
MCPConfig(command="npx", args=["-y", "@modelcontextprotocol/server-github"]),
MCPConfig(command="node", args=["./my-mcp-server/index.js"]),
]
)

The agent connects to MCP servers at startup. Tools are discovered automatically through MCP’s tools/list endpoint. There’s no manual tool registration, no decorators, no function wrapping.

2. Tools as Resources, Not Functions#

Most frameworks model tools as Python functions you call. The SDK models tools as MCP resources — structured data that tools produce and consume.

# Other frameworks:
@tool("search_docs")
def search_docs(query: str) -> str:
return vector_store.search(query)
# Claude Agent SDK:
# MCP server exposes search_docs as a tool automatically.
# The agent's tool_use block describes it as a resource.
agent.use_tool("search_docs", {"query": "authentication flow"})
# Returns: MCP resource with structured content, not a string

This sounds like a detail, but it changes how you build agents. Tools produce typed content blocks (text, images, JSON, embedded resources) instead of raw strings. The agent can reason about tool outputs more precisely.

3. Computer Use Built In#

The SDK includes a Computer capability — the same feature that lets Claude see screenshots, move cursors, and interact with desktop applications:

from claude_agent.tools import Computer
agent = Agent(
model="claude-sonnet-4",
tools=[Computer()] # Direct UI interaction
)

The Computer tool gives the agent a virtual screen, keyboard, and mouse. This is useful for:

  • Testing UI workflows — Automated QA that actually uses the interface
  • Legacy system integration — Interacting with systems that have no API
  • Desktop automation — File management, application control, data entry

Core Architecture#

The Agent Loop#

The SDK exposes a clean agent loop that you can inspect and customize:

from claude_agent import Agent
agent = Agent(
model="claude-sonnet-4",
mcp_servers=[github_server, db_server, docs_server],
system_prompt="You are a DevOps engineer. Use GitHub for PRs, DB for queries, docs for reference."
)
response = await agent.run("Deploy the latest build to staging")
# The agent loop:
# 1. Receives message → decides next action
# 2. Calls MCP tools → receives structured results
# 3. Reasons about results → decides next action
# 4. Repeats until criteria met → returns final response

You can hook into the loop at any point:

agent.on("tool_call", lambda tool, args: log_tool_usage(tool, args))
agent.on("tool_result", lambda result: validate_output(result))
agent.on("thinking", lambda thought: stream_to_ui(thought))

Memory and State#

The SDK provides a Memory abstraction:

from claude_agent import Agent, FileMemory, PostgresMemory
# File-based for development
agent = Agent(memory=FileMemory(path="./agent_memory"))
# Postgres for production
agent = Agent(memory=PostgresMemory(connection_string=os.getenv("DB_URL")))

Memory stores:

  • Conversation history (compressed per session)
  • User preferences and learned behaviors
  • Tool output cache (avoids redundant MCP calls)
  • Session state for human-in-the-loop pauses

Thinking Mode#

Built on Claude’s extended thinking capability:

agent = Agent(
model="claude-sonnet-4",
thinking_budget=16000 # tokens allocated to reasoning
)
result = await agent.run_with_thinking(
"Debug the database connection pool exhaustion",
stream_thinking=True # See the reasoning process
)

The agent shows its reasoning process before tool calls. This isn’t a debug mode — it’s the actual agent loop exposed.


Tool Composition: Beyond Simple Functions#

The SDK supports tool composition — combining multiple tools into higher-level capabilities:

from claude_agent import Tool, compose_tools
@Tool
def search_github_issues(repo: str, query: str):
"""Search GitHub issues by keyword"""
@Tool
def read_issue(issue_url: str):
"""Read full issue content"""
@Tool
def analyze_sentiment(text: str):
"""Analyze sentiment of text"""
# Compose into a higher-level tool
incident_response = compose_tools(
"incident_response",
tools=[search_github_issues, read_issue, analyze_sentiment],
description="Search for incidents, analyze customer reports"
)
agent.add_tool(incident_response)

The composed tool appears as a single capability in the agent’s tool set. The agent calls incident_response → the SDK orchestrates the sub-tools → returns a combined result.


Production Patterns#

Pattern 1: MCP-First Service Agent#

agent = Agent(
model="claude-sonnet-4",
mcp_servers=[
MCPConfig(command="node", args=["./mcp/github.js"]),
MCPConfig(command="node", args=["./mcp/datadog.js"]),
MCPConfig(command="node", args=["./mcp/pagerduty.js"]),
MCPConfig(command="node", args=["./mcp/kubernetes.js"]),
],
system_prompt="""You are an SRE agent.
Available MCP servers provide access to:
- GitHub: PRs, issues, deployments
- Datadog: metrics, monitors, dashboards
- PagerDuty: incidents, on-call schedules
- Kubernetes: pods, services, deployments
"""
)

The agent discovers 20+ tools automatically from these four MCP servers. No tool definitions to maintain.

Pattern 2: Research Agent with Computer Use#

agent = Agent(
model="claude-sonnet-4",
mcp_servers=[web_search, browser_mcp],
tools=[Computer()],
system_prompt="Research competitor products and document findings"
)
# The agent:
# 1. Searches the web via MCP
# 2. Opens browsers via Computer tool
# 3. Takes screenshots of competitor UIs
# 4. Captures data into structured resources
# 5. Writes a research document

Claude Agent SDK vs Claude Code#

These are often confused. Here’s the distinction:

Claude Agent SDKClaude Code
PurposeBuild custom agentsInteractive coding
InterfacePython SDKTerminal / IDE
MCPNativePlugin
Computer UseYesNo
Custom logicFull controlVia rules files
DeploymentYour infrastructureAnthropic’s terminal
Best forAutomation, enterprise agentsDay-to-day coding

Claude Code is shipped. The SDK is what you build with.


When to Choose Claude Agent SDK#

Best Fit#

  • MCP-heavy architectures — Your agent needs many MCP servers; the SDK handles them natively
  • Computer Use workflows — UI testing, desktop automation, legacy system interaction
  • Anthropic-only stacks — If your organization uses Claude as the sole model provider
  • Custom agent loops — When you need to inspect, log, or modify the agent’s decision loop

Avoid When#

  • You need multi-model support — The SDK is Claude-only. No Llama, GPT, Gemini.
  • Your team doesn’t use MCP — The SDK assumes MCP; using it without MCP servers is wasteful
  • You need cross-repo orchestration — That’s Kiro’s territory, not the SDK
  • Your team prefers LangChain — The SDK has no LangChain integration; you’d be starting from scratch

Next in the Series#

PostFramework
1LangGraph
2CrewAI
3AutoGen
4Claude Agent SDK (this)
5OpenAI Agents SDK
6Head-to-Head Comparison

Series: AI Agent Frameworks 2026 — Production Comparison. Post 4: Claude Agent SDK. Post 5: OpenAI Agents SDK → coming next.

Advertisement

Claude Agent SDK: Anthropic's MCP-Native Agent Toolkit
https://minixium.com/en/posts/claude-agent-sdk-anthropic-mcp-native-agent-toolkit-2026/
Author
Minixium
Published at
2026-05-24
License
CC BY-NC-SA 4.0

Advertisement