Principle: Each tool should have a single, well-defined responsibility (Single Responsibility Principle) and provide clear, structured outputs that the agent can reason about.
The SDK wraps your agent functions as MCP-compatible servers, handling protocol details so you can focus on logic.
For tool hosting,
The SDK uses Stateless Streamable HTTP with the Mcp-Session-Id header for session isolation .
Servers must run on 0.0.0.0:8000 and expose /mcp.
AgentCore automatically adds Mcp-Session-Id to support stateless, session-aware communication. The InvokeAgentRuntime API passes through all payloads, enabling seamless MCP message proxying.
The Bedrock AgentCore Gateway is important because it streamlines the process of turning Lambda functions into secure, scalable MCP servers without managing infrastructure.
FastMCP: Creates an MCP server that can host your tools
@mcp.tool(): Decorator that turns your Python functions into MCP tools
stateless_http=True: Required for AgentCore Runtime compatibility
Tools: Three simple tools demonstrating different types of operations