Serverless AI weather agent using Strands SDK and AgentCore Gateway with an API Gateway target. Uses MCP, Cognito JWT auth, and key-less Open-Meteo.
The user authenticates with Amazon Cognito and receives a JWT ID token.
The JWT is passed to an Agent Lambda which uses the Strands Agents SDK to create an AI agent backed by Amazon Bedrock (us.anthropic.claude-sonnet-4-6 cross-region inference profile).
The Strands Agent connects to an AgentCore Gateway MCP endpoint, dynamically discovering available weather tools via the MCP tools/list protocol.
AgentCore Gateway auto-discovers operations from the API Gateway REST API via GetExportAPI and presents them as MCP tools to the agent.
The AgentCore Gateway validates the incoming JWT token using a CUSTOM_JWT authorizer backed by Cognito.
When the agent selects a tool, AgentCore routes the request to the API Gateway REST API, authenticating with an API key managed by a credential provider backed by Secrets Manager.
The API Gateway proxies the request to Open-Meteo, a free key-less weather API — one path for geocoding (city name to coordinates) and one for the forecast.
The Strands SDK handles the full agentic loop: tool discovery, Claude tool selection, MCP tool execution, and response formatting — all in a single agent() call. For a place name the agent chains both tools: geocode first, then forecast.