AWS Builder Center
Running Claude Agent SDK with Skills on Amazon Bedrock

Running Claude Agent SDK with Skills on Amazon Bedrock

This article demonstrates how to run the Claude Agent SDK on Amazon Bedrock without an Anthropic API key. The entire debugging process was completed through AI-assisted development with Kiro, without consulting external documentation, showcasing how conversational AI can accelerate SDK integration.

The Claude Agent SDK  enables building multi-agent systems with Skills, MCP servers, and subagents. By default, it requires an Anthropic API key. This post shows how to run it entirely on Amazon Bedrock  instead—no Anthropic API key needed.

The Problem

The DeepLearning.AI course "Agent Skills with Anthropic"  assumes you have an ANTHROPIC_API_KEY. But what if you're already using AWS and want to leverage your existing Amazon Bedrock access?

The Solution: Two Lines of Code

The Claude Agent SDK uses Claude Code under the hood, which supports Amazon Bedrock  via environment variables. The key configuration is surprisingly simple:
1
2
3
4
5
import os

# Configure Claude Code to use Amazon Bedrock
os.environ["CLAUDE_CODE_USE_BEDROCK"] = "1"
os.environ["AWS_REGION"] = "us-west-2" # Your preferred region
That's it. Set these before creating ClaudeSDKClient, and the SDK will use your AWS credentials instead of an Anthropic API key.

Prerequisites

Before running, verify your AWS setup:
1
2
3
4
5
6
7
8
# Check AWS CLI
aws --version

# Verify credentials
aws configure get aws_access_key_id

# Test Bedrock access
aws bedrock list-foundation-models --query "modelSummaries[?contains(modelId, 'claude')]" --output table
You need:
  • AWS credentials configured (~/.aws/credentials or environment variables)
  • Amazon Bedrock model access enabled in your AWS console
  • IAM permissions for bedrock:InvokeModel

Complete Example

Here's the modified agent.py for Amazon Bedrock:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import asyncio
import os
from dotenv import load_dotenv
from claude_agent_sdk import (
AgentDefinition, ClaudeSDKClient, ClaudeAgentOptions, AssistantMessage,
)

load_dotenv()
AWS_REGION = os.environ.get("AWS_REGION", "us-west-2")

# Key configuration for Bedrock
os.environ["CLAUDE_CODE_USE_BEDROCK"] = "1"
os.environ["AWS_REGION"] = AWS_REGION

async def main():
agents = {
"docs_researcher": AgentDefinition(
description="Finds information from official documentation.",
prompt="You research official docs.",
tools=["WebSearch", "WebFetch"],
model="haiku"
),
}

options = ClaudeAgentOptions(
system_prompt="You are a helpful assistant.",
allowed_tools=["Skill", "Task", "Write", "Bash", "WebSearch", "WebFetch"],
model="sonnet",
agents=agents
)

async with ClaudeSDKClient(options=options) as client:
await client.query("Hello!")
async for message in client.receive_response():
if isinstance(message, AssistantMessage):
print(message.content)

asyncio.run(main())

Adding MCP Servers (Optional)

MCP servers like Notion work the same way. Just ensure the token exists before adding the config:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
NOTION_TOKEN = os.environ.get("NOTION_TOKEN")

mcp_servers = {}
if NOTION_TOKEN:
mcp_servers["notion"] = {
"command": "npx",
"args": ["-y", "@notionhq/notion-mcp-server"],
"env": {"NOTION_TOKEN": NOTION_TOKEN},
}

options = ClaudeAgentOptions(
mcp_servers=mcp_servers,
# ... other options
)

Key Takeaways

WhatHow
Enable Bedrockos.environ["CLAUDE_CODE_USE_BEDROCK"] = "1"
Set regionos.environ["AWS_REGION"] = "us-west-2"
AuthenticationUses standard AWS credential chain
Model namesUse "sonnet", "haiku" (SDK maps to Bedrock model IDs)

What Works on Amazon Bedrock

Everything from the original SDK works:
  • ✅ Skills (e.g., learning-a-tool)
  • ✅ Subagents with parallel execution
  • ✅ MCP servers (Notion, etc.)
  • ✅ All built-in tools (WebSearch, Bash, Write, etc.)

A Note on the Debugging Process

This entire migration—from identifying the Bedrock configuration, fixing MCP server issues, to successfully running Skills with subagents—was completed through conversation with Kiro , an AI-powered IDE. No external documentation was consulted. Kiro  diagnosed issues in real-time, suggested fixes, and validated the setup by running test scripts directly.
The workflow:
  1. Asked Kiro how to use Bedrock instead of Anthropic API
  2. Kiro checked the environment, identified missing dependencies
  3. Kiro found the correct configuration (environment variables, not client parameters)
  4. Fixed runtime errors (MCP config validation when token was missing)
  5. Verified everything worked end-to-end
This demonstrates how AI-assisted development can accelerate debugging unfamiliar SDKs without documentation diving.

Conclusion

Running Claude Agent SDK on Amazon Bedrock requires just two environment variables. Your existing AWS credentials handle authentication, and all SDK features—Skills, subagents, MCP servers—work unchanged.
If you're already in the AWS ecosystem, this is the simplest path to using Claude Agent SDK without managing a separate Anthropic API key.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article