◈ AWS AGENTCORE BLUEPRINTS
PART II · CORE SERVICES · CHAPTER 12 / 36
TOCCONSULTING.FR
AMAZON BEDROCK / SERVICE DETAIL S04 GATEWAY

AGENTCORE GATEWAYPRACTICAL

CHAPTER 12 / 36
TOPIC create a gateway, add a target, call a tool
REV 2026.07
New to these words? Sheet 01-A "Key terms" defines tool, MCP, and Lambda. Concept: chapter 11 "Gateway".
IN PLAIN WORDS

You will create a gateway, attach an AWS Lambda function as a tool, deploy, then run a small agent that finds and calls that tool. Terms: target = a backend you attach (a Lambda, an API); authorizer = who may call the gateway (NONE = open, for testing; CUSTOM_JWT = requires a login token); MCP endpoint = the single web address the agent connects to; tool schema = a small file describing the tool's inputs.

[ 1 ] INSTALL AND CREATE A PROJECT
$ npm install -g @aws/agentcore $ agentcore create --name MyGatewayAgent --defaults # --defaults gives a Python Strands agent
[x] AWS account with credentials
[x] Node.js 18+, Python 3.10+
[x] IAM permissions for roles, Lambda, bedrock-agentcore
[x] Model access: Claude Sonnet 4.6
[ 2 ] ADD A GATEWAY AND A LAMBDA TARGET
# simplest: no inbound auth $ agentcore add gateway --name TestGateway --authorizer-type NONE --runtimes MyGatewayAgent $ agentcore add gateway-target --name TestLambdaTarget --type lambda-function-arn \ --lambda-arn <YOUR_LAMBDA_ARN> --tool-schema-file tools.json --gateway TestGateway # or with JWT inbound auth (Cognito discovery URL): $ agentcore add gateway --name TestGateway --authorizer-type CUSTOM_JWT \ --discovery-url https://cognito-idp.us-east-1.amazonaws.com/<POOL_ID>/.well-known/openid-configuration \ --allowed-audience <CLIENT_ID> --runtimes MyGatewayAgent
[ 3 ] DEPLOY AND GET THE GATEWAY URL
$ agentcore deploy # synthesizes a CDK stack, 2 to 3 minutes $ agentcore status # shows your gateway URL
The gateway is an MCP endpoint at:
https://gateway-id.gateway.bedrock-agentcore.region.amazonaws.com/mcp
[ 4 ] CALL THE TOOLS FROM A STRANDS AGENT (run_agent.py)
$ pip install strands-agents mcp

from strands import Agent
from strands.models import BedrockModel
from strands.tools.mcp.mcp_client import MCPClient
from mcp.client.streamable_http import streamablehttp_client

gateway_url = "<YOUR_GATEWAY_URL>"   # from agentcore status
model = BedrockModel(
    model_id="us.anthropic.claude-sonnet-4-6",   # current Sonnet, via a cross-region inference profile
    streaming=True)

mcp_client = MCPClient(
    lambda: streamablehttp_client(gateway_url))
with mcp_client:
    # discover the tools the gateway exposes
    tools = mcp_client.list_tools_sync()
    print([t.tool_name for t in tools])

    # give them to the agent
    agent = Agent(model=model, tools=tools)

    # the model can now call your Lambda tool
    response = agent("What's the weather in Seattle?")
    print(response)
No auth token is needed for the NONE authorizer. With CUSTOM_JWT, pass the bearer token in the MCP client headers.
[ 5 ] VALIDATE AND CLEAN UP
$ curl -X POST YOUR_GATEWAY_URL -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' $ aws logs tail /aws/bedrock-agentcore/gateways/YOUR_GATEWAY_ID --follow # remove the gateway: $ agentcore remove gateway --name TestGateway
SRC: AWS AgentCore Developer Guide (get started with AgentCore Gateway, set up a gateway)
DRAWN 2026.06, REV 2026.07.26
◄ PREVIOUS · CH 11
AgentCore Gateway, Plain Language
NEXT · CH 13 ►
AgentCore Identity, Plain Language
AWS AGENTCORE BLUEPRINTS · CONTENTS
Back to tocconsulting.fr Cover & Table of Contents
PART I · FOUNDATIONS
01AgentCore Overview, Plain LanguageCONCEPT02AgentCore, Key Terms in Plain LanguageCONCEPT03AgentCore, Common Mistakes ExplainedCONCEPT04Inside an AgentCore Agent, BlueprintCONCEPT05Harness, Practical 1, Strands PathPRACTICAL06Harness, Practical 2, Managed HarnessPRACTICAL
PART II · CORE SERVICES
07AgentCore Runtime, Plain LanguageCONCEPT08AgentCore Runtime, PracticalPRACTICAL09AgentCore Memory, Plain LanguageCONCEPT10AgentCore Memory, PracticalPRACTICAL11AgentCore Gateway, Plain LanguageCONCEPT12AgentCore Gateway, PracticalPRACTICAL13AgentCore Identity, Plain LanguageCONCEPT14AgentCore Identity, PracticalPRACTICAL
PART III · TOOLS AND OPERATIONS
15AgentCore Code Interpreter, Plain LanguageCONCEPT16AgentCore Code Interpreter, PracticalPRACTICAL17AgentCore Browser, Plain LanguageCONCEPT18AgentCore Browser, PracticalPRACTICAL19AgentCore Observability, Plain LanguageCONCEPT20AgentCore Observability, PracticalPRACTICAL21AgentCore Evaluations, Plain LanguageCONCEPT22AgentCore Evaluations, PracticalPRACTICAL
PART IV · GOVERNANCE AND TRANSACTIONS
23AgentCore Policy, Plain LanguageCONCEPT24AgentCore Policy, PracticalPRACTICAL25AgentCore Registry, Plain LanguageCONCEPT26AgentCore Registry, PracticalPRACTICAL27AgentCore Payments, Plain LanguageCONCEPT28AgentCore Payments, PracticalPRACTICAL
PART V · MULTI-AGENT AND ARCHITECTURE
29A2A and Multi-Agent, Plain LanguageCONCEPT30A2A and Multi-Agent, PracticalPRACTICAL31Architecture Patterns, Plain LanguageCONCEPT32Multi-Tenant Agents, Plain LanguageCONCEPT33Agent Security and Threat Model, Plain LanguageCONCEPT34Governance at Org Scale, Plain LanguageCONCEPT35Governance at Org Scale, PracticalPRACTICAL36Multi-Region and Distribution, Plain LanguageCONCEPT