Generative AI  

Deploy Strands Agent to Amazon Bedrock AgentCore Runtime

Introduction

In the previous blog , we created a Strands Agent that connected to AWS MCP servers for documentation and real-time pricing , helping Solution Architects ground their answers with AWS data. That was running locally on your laptop using stdio transport . Great for development — but not how you’d run it in an enterprise setting. This is where Amazon Bedrock AgentCore Runtime comes in. It allows you to deploy your Strands Agent as a fully managed runtime, automatically packaging your code, building a container image, and creating all the AWS resources you need.

This blog will walk you through deploying your first Strands Agent into AgentCore Runtime using AgentCore Starter Toolkit. Future blogs in this series will extend this deployment with:

  • MCP servers — so your runtime agent can query AWS docs and pricing directly

  • API Gateway integration — expose your agent securely to applications

  • Monitoring and Observability — track usage, latency, and performance

  • Enterprise extensions — memory, connectors, compliance-ready configurations

This series builds toward a complete solution we call the Enterprise Knowledge & Cost Copilot .

Prerequisites

1.       Install or update to the latest version of the AWS CLI

2.       Get credentials to grant programmatic access

3.       Visual Studio Code

4.       Python 3.10+ installed

5.        Access to Amazon Bedrock foundation model

6.       Required permissions to deploy the agent

Create an agent using Strands Agents SDK

Follow these steps to create a simple Strands Agent:

  • Open Visual Studio Code.

  • Navigate to your project folder.

  • Open a PowerShell terminal in VS Code.

  • Create a virtual environment and activate it.

  
    python -m venv .venv
.venv\Scripts\Activate.ps1
  
  • Create a new Python file - feature_comparison_agent.py.

  • Add your agent code.

  
    from strands import Agent, tool
from strands.models import BedrockModel
from bedrock_agentcore.runtime import BedrockAgentCoreApp

app = BedrockAgentCoreApp()

# Custom tool: currency converter (dummy implementation)
@tool
def convert_currency(amount: float, rate: float):
    """Convert amount based on exchange rate (example only)."""
    return f"{amount} converted = {amount * rate}"

# Define model and agent
model_id = "us.anthropic.claude-3-7-sonnet-20250219-v1:0"
model = BedrockModel(
    model_id=model_id,
)
agent = Agent(
    model=model,
    tools=[convert_currency],
    system_prompt="You are a helpful assistant that can handle multi-currency queries."
)

# Entrypoint for AgentCore Runtime
@app.entrypoint
def invoke(payload):
    user_input = payload.get("prompt")
    response = agent(user_input)
    return response.message['content'][0]['text']

if __name__ == "__main__":
    app.run()
  
  • Create a requirements.txt file including required packages.

  
    strands-agents
bedrock-agentcore
bedrock-agentcore-starter-toolkit
  

Locally Test the Agent

  • Install dependencies from requirements.txt.

  
    pip install -r requirements.txt
  
  • Start your agent with Python.

  
    python .\feature_comparison_agent.py
  
  • Open a second terminal and send a request using curl.

  
    curl -X POST http://localhost:8080/invocations -H "Content-Type: application/json" -d '{"prompt": "Convert 100 at rate 1.25"}'
  
result

This step ensures your agent works as expected before moving to deployment.

Deploy the Strands agent to the AgentCore Runtime

Deployment is a three-step process with the AgentCore Starter Toolkit:

Architecture
  • Configure - Generates a Dockerfile based on your application code. Prepares IAM roles and deployment scaffolding.

  
    agentcore configure -e .\feature_comparison_agent.py
  
  • Launch - Builds and pushes a container image to Amazon ECR. Creates and configures AgentCore Runtime using AWS CodeBuild.

  
    agentcore launch
  
agent-runtime2
  • Invoke - Test your deployed agent by sending a request to the AgentCore Runtime endpoint.

  
    agentcore invoke '{"prompt": "Convert 100 at rate 1.25"}'
  
prompt3

Summary

In this article, you learned how to take a Strands Agent you built locally and deploy it to Amazon Bedrock AgentCore Runtime using the Starter Toolkit .

This deployment becomes the foundation for our Enterprise Knowledge & Cost Copilot , which we’ll expand in upcoming blogs with MCP servers, API Gateway, monitoring, and enterprise