[{"data":1,"prerenderedAt":98},["ShallowReactive",2],{"pattern-strands-agentcore-openapi":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":15,"extension":16,"framework":17,"gitHub":18,"highlight":6,"introBox":24,"language":34,"level":35,"meta":36,"patternArch":37,"resources":66,"s3URL":6,"services":6,"stem":90,"testing":91,"videoId":6,"__hash__":97},"patterns\u002Fpatterns\u002Fstrands-agentcore-openapi.json","Serverless AI Agent with AgentCore MCP Gateway and OpenAPI Target",null,{"text":8},[9],"sam delete --stack-name dev-openapi-agent-gateway --region us-east-1",[11],"content\u002Fcontributors\u002Fmike-hume.json",{"text":13},[14],".\u002Fscripts\u002Fdeploy.sh --environment-name dev --weather-api-key YOUR_WEATHERAPI_KEY","Strands SDK agent on Lambda uses AgentCore Gateway (MCP) to call WeatherAPI.com via an OpenAPI target with Cognito JWT auth and API key injection.","json","AWS SAM",{"template":19},{"repoURL":20,"templateURL":21,"projectFolder":22,"templateFile":23},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fstrands-agentcore-openapi","serverless-patterns\u002Fstrands-agentcore-openapi","strands-agentcore-openapi","template.yaml",{"headline":25,"text":26},"How it works",[27,28,29,30,31,32,33],"The user authenticates with Amazon Cognito and receives a JWT token.","The JWT is passed to an Agent Lambda which uses the Strands Agents SDK to create an AI agent backed by Amazon Bedrock (Claude Sonnet 4.5 cross-region inference profile).","The Strands Agent connects to an AgentCore Gateway MCP endpoint, dynamically discovering available weather tools via the MCP tools\u002Flist protocol.","The AgentCore Gateway validates the JWT token using a CUSTOM_JWT authorizer backed by Cognito, then routes MCP tool calls directly to WeatherAPI.com via an OpenAPI target.","The OpenAPI target is defined inline in the SAM template using the WeatherAPI.com OpenAPI schema. The Gateway injects the API key automatically using an API Key Credential Provider backed by AWS Secrets Manager — no Lambda intermediary required.","The Strands SDK handles the full agentic loop: tool discovery, Claude tool selection, tool execution via the Gateway, and response formatting — all in a single agent() call.","The stack is built and deployed with AWS SAM (sam build + sam deploy). The model used by the agent is configurable via the --model-id flag on the deploy script, which sets the BedrockModelId template parameter.","Python","300",{},{"icon1":38,"icon2":43,"icon3":48,"icon4":52,"line1":56,"line2":60,"line3":63},{"x":39,"y":40,"service":41,"label":42},15,70,"lambda","AWS Lambda",{"x":44,"y":45,"service":46,"label":47},40,30,"cognito","Amazon Cognito",{"x":49,"y":40,"service":50,"label":51},50,"bedrock-agentcore","Amazon Bedrock AgentCore Gateway",{"x":53,"y":40,"service":54,"label":55},85,"icon-internet","WeatherAPI.com",{"from":57,"to":58,"label":59},"icon1","icon2","JWT",{"from":57,"to":61,"label":62},"icon3","MCP request",{"from":61,"to":64,"label":65},"icon4","OpenAPI call",{"bullets":67},[68,71,74,76,79,82,85,88],{"text":69,"link":70},"AWS Serverless Application Model (SAM)","https:\u002F\u002Fdocs.aws.amazon.com\u002Fserverless-application-model\u002Flatest\u002Fdeveloperguide\u002Fwhat-is-sam.html",{"text":72,"link":73},"Strands Agents SDK","https:\u002F\u002Fgithub.com\u002Fstrands-agents\u002Fsdk-python",{"text":51,"link":75},"https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock-agentcore\u002Flatest\u002Fdevguide\u002Fgateway.html",{"text":77,"link":78},"AgentCore Gateway OpenAPI Target","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock-agentcore\u002Flatest\u002Fdevguide\u002Fgateway-target-openapi.html",{"text":80,"link":81},"Model Context Protocol (MCP)","https:\u002F\u002Fmodelcontextprotocol.io\u002F",{"text":83,"link":84},"Amazon Cognito JWT Authentication","https:\u002F\u002Fdocs.aws.amazon.com\u002Fcognito\u002Flatest\u002Fdeveloperguide\u002Famazon-cognito-user-pools-using-tokens-verifying-a-jwt.html",{"text":86,"link":87},"Amazon Bedrock Cross-Region Inference","https:\u002F\u002Fdocs.aws.amazon.com\u002Fbedrock\u002Flatest\u002Fuserguide\u002Finference-profiles-support.html",{"text":55,"link":89},"https:\u002F\u002Fwww.weatherapi.com\u002Fdocs\u002F","patterns\u002Fstrands-agentcore-openapi",{"text":92},[93,94,95,96],".\u002Fscripts\u002Ftest.sh",".\u002Fscripts\u002Ftest.sh 'What is the weather in London?'",".\u002Fscripts\u002Ftest.sh 'What is the weather in Paris, France?'",".\u002Fscripts\u002Ftest.sh 'Is it raining in New York right now?'","NEn_9IdnOyAxxJpLETaOFC5xXFeV_kMn-csXAoqMQw4",1788278262611]