Production-Ready Tools with Bedrock AgentCore Runtime
Deploying custom tools at scale requires more than just local functions; it requires managed infrastructure that is secure, authenticated, and scalable. Bedrock AgentCore Runtime allows you to deploy Model Context Protocol (MCP) servers as managed services. This transition moves your tools from local Python decorators to enterprise-grade microservices that can be shared across multiple agents and teams.
By combining AgentCore Runtime with Amazon Cognito, you can enforce strict authentication on your tools. This setup ensures that only authorized agents can trigger sensitive operations, such as searching internal databases or executing proprietary business logic, all while AWS handles the underlying server scaling and maintenance.
A. Deploying a Managed MCP Server
To deploy a tool to the cloud, you first define your MCP server and then register it with the AgentCore Runtime. In this example, we assume an MCP server (like a DuckDuckGo search service) has been containerized and is ready for deployment.
from bedrock_agentcore.tools.runtime_client import RuntimeClient
# Initialize the Runtime Client
runtime_client = RuntimeClient(region="us-east-1")
# Deploy a managed MCP server with Cognito authentication
mcp_server = runtime_client.create_mcp_server(
name="SearchService",
image="your-docker-image-uri",
auth_config={
"type": "COGNITO",
"user_pool_id": "us-east-1_xxxxxxxxx",
"client_id": "xxxxxxxxxxxxxxxx"
}
)
print(f"MCP Server deployed at: {mcp_server['endpoint']}")
B. Connecting a Strands Agent to a Remote Tool
Once deployed, the Strands Agent connects to the remote MCP server using the AgentCoreRuntime tool. The agent handles the authentication handshake automatically, allowing it to use the remote "Search" tool as if it were a local function.
from strands import Agent
from strands.models import BedrockModel
from strands_tools.runtime import AgentCoreRuntime
# Initialize connection to the deployed runtime
agentcore_runtime = AgentCoreRuntime(region="us-east-1")
# Create an agent that uses the remote managed search tool
agent = Agent(
model=BedrockModel(model_id="us.amazon.nova-pro-v1:0"),
tools=[agentcore_runtime.mcp_tool(server_name="SearchService")]
)
# The agent invokes the remote MCP server securely to answer the query
agent("What are the key highlights from the latest AWS Re:Invent?")
Key Takeaway: Bedrock AgentCore Runtime provides the "production glue" for AI agents. It shifts the burden of server management, security, and scaling from the developer to AWS. This allows you to build a library of secure, reusable MCP tools that any Strands Agent in your organization can consume with just a single line of code.

Top comments (0)