You need four things before you start: an AWS account with the CLI signed in, Node.js 20 or newer, Python 3.10 or newer, and one API or Lambda function you’d like an AI agent to use.
With those, AgentCore Gateway turns that function into a tool any MCP-speaking agent can call, in about 15 minutes.
Amazon Bedrock AgentCore Gateway is a managed entry point that sits between your agents and everything they call: tools, other agents and models. It’s one of the services in Amazon Bedrock AgentCore, and you can use it on its own.
If the CLI isn’t set up yet, install the AWS CLI and sign in first.
Last checked against the AWS docs on December 1, 2026.
Before you start, check:
- AWS CLI signed in to a non-production account
- Node.js 20+ (for the AgentCore CLI) and Python 3.10+ (for the test agent)
- IAM rights to create roles, Lambda functions and AgentCore resources
- A Lambda function, OpenAPI spec or MCP server to expose as a tool
This post contains affiliate links. As an Amazon Associate, Stepstocloud.com earns from qualifying purchases.
Gateway solves the wiring; deciding which tools an agent should have is a design question. The tool-use chapter in AI Engineering is a good primer before you expose anything that writes data.

Understand the three target types
A gateway is a single URL. Behind it you attach targets, and AWS groups them into three kinds:
| Target type | What you attach | How agents see it |
|---|---|---|
| MCP target | Lambda functions, API Gateway REST APIs, OpenAPI specs, Smithy models, MCP servers, built-in connectors | All merged into one virtual MCP server with a single tool list |
| HTTP target | AgentCore Runtime agents, A2A agents, external MCP servers, any HTTP endpoint | Passed through as-is, addressed by path |
| Inference target | Model providers such as Amazon Bedrock, OpenAI and Anthropic | One endpoint; the request’s model field picks the provider |
Most people start with an MCP target, which is what this walkthrough builds. The agent connects once and sees every tool from every MCP target in one tools/list response.

Step 1: Install the AgentCore CLI and create a project
npm install -g @aws/agentcore
agentcore create --name MyGatewayProject --template empty
cd MyGatewayProjectThe project only holds the gateway and its targets; your test agent runs on your own machine.
Step 2: Describe your tools
Gateway needs a schema so the model knows what each tool does and what to send. For a Lambda target, save a tools.json file like this.
The descriptions matter: they’re what the model reads when deciding which tool to call.
[
{
"name": "get_order_status",
"description": "Look up the shipping status of a customer order by order ID",
"inputSchema": {
"type": "object",
"properties": {
"order_id": { "type": "string", "description": "The order ID, e.g. A-10442" }
},
"required": ["order_id"]
}
}
]Inside your Lambda function, Gateway passes the tool name in the client context. AWS’s quick start reads it like this and splits off the target prefix:
def lambda_handler(event, context):
tool_name = context.client_context.custom["bedrockAgentCoreToolName"]
tool = tool_name.split("___", 1)[1]
if tool == "get_order_status":
return {"order_id": event["order_id"], "status": "shipped"}
return {"error": f"Unknown tool: {tool}"}Step 3: Add the gateway and the target
# Test only: no inbound authorization
agentcore add gateway --name OrdersGateway --authorizer-type NONE
agentcore add gateway-target \
--gateway OrdersGateway \
--target-configuration '{
"name": "OrdersLambda",
"targetType": "lambdaFunctionArn",
"lambdaFunctionArn": {
"lambdaArn": "arn:aws:lambda:us-east-1:111122223333:function:orders-tool",
"toolSchemaFile": "tools.json"
}
}'--authorizer-type NONE is fine for a first test in a sandbox account and nowhere else. Swap it for a JWT authorizer before anyone else can reach the URL (see the next section).
Step 4: Deploy and find your gateway URL
agentcore deploy
agentcore status --jsonPer the AgentCore Gateway quick start, the deploy builds an AWS CDK stack and takes about 2 to 3 minutes. The gateway ID is the last part of the ARN that status prints, and your MCP URL follows this pattern:
https://<gateway-id>.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp
Step 5: Point an agent at the gateway
Any MCP client works. With Strands Agents (pip install strands-agents mcp), the agent lists the gateway’s tools and hands them to the model:
from strands import Agent
from strands.tools.mcp.mcp_client import MCPClient
from mcp.client.streamable_http import streamablehttp_client
GATEWAY_URL = "https://<gateway-id>.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp"
mcp = MCPClient(lambda: streamablehttp_client(GATEWAY_URL))
with mcp:
tools = mcp.list_tools_sync()
agent = Agent(tools=tools)
agent("Where is order A-10442?")Ask a question your tool can answer and you should see the agent call get_order_status. For a JWT-protected gateway, send the token in an Authorization: Bearer header, as AWS’s full sample does.
Lock it down before real use
Gateway handles security in two directions, as the Gateway core concepts page explains, and you need both. Inbound decides who may call the gateway; outbound decides how the gateway signs in to each tool.
| Direction | Options | Use |
|---|---|---|
| Inbound | OAuth (JWT), IAM SigV4, authenticate-only, none | JWT from Cognito, Okta or Entra ID for apps; IAM for AWS-to-AWS calls; none only in a sandbox |
| Outbound: Lambda and Smithy targets | The gateway’s execution role | Give that role only lambda:InvokeFunction on the functions it needs |
| Outbound: OpenAPI and MCP server targets | Credential provider with an API key or OAuth, or IAM SigV4 | Keys stay in AgentCore Identity; the model never sees them |
For a JWT authorizer, AWS’s example passes your identity provider’s discovery URL and allowed audience, for instance a Cognito user pool’s /.well-known/openid-configuration address. Pair that with AgentCore Policy rules on any tool that writes or deletes data.

Use semantic tool search when the list grows
A model choosing between 8 tools is fine. Choosing between 300 bloats every prompt and confuses it.
Gateway’s semantic tool selection, described in the Gateway overview, lets the agent search for the right few tools by task, which keeps prompts short and responses faster.
Keep tool names and descriptions specific (“Look up shipping status by order ID”, not “orders”); search and the model both depend on them.

Fix the common setup errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Agent sees no tools | Wrong URL or missing /mcp path | Rebuild the URL from agentcore status --json |
| 401 or 403 from the gateway | JWT audience or discovery URL mismatch | Match allowedAudience to your app client ID |
| Tool call fails with access denied | Gateway role can’t invoke the Lambda | Grant lambda:InvokeFunction on that function ARN |
| Lambda gets the wrong tool name | Target prefix not stripped | Split on ___ as in the handler above |
| Model calls the wrong tool | Vague tool descriptions | Rewrite descriptions as clear, single-purpose sentences |
Know what it costs
Gateway is pay per use: you’re charged for operations such as listing and invoking tools, for search queries, and for targets indexed for semantic search.
Per the AgentCore pricing page, there’s no minimum fee, and data sent to your own VPC costs $0.006 per GB in commercial Regions.
Your Lambda functions and model calls are billed separately, at their usual rates. Clean up test gateways when you’re done; check how AWS pricing works if any of these meters are new to you.
Books for building agent tools

AI Engineering (Chip Huyen, O’Reilly)
How agents choose and call tools, and how to test them.
Check price on Amazon
Hands-On Large Language Models (O’Reilly)
The model side of tool calling, explained with visuals.
Check price on AmazonFrequently asked questions
What is AgentCore Gateway?
AgentCore Gateway is a managed AI gateway in Amazon Bedrock AgentCore. It gives agents one secure endpoint for tools, other agents and model providers. It converts APIs and Lambda functions into MCP tools, passes traffic to other agents and routes model requests across providers.
Does AgentCore Gateway support MCP?
Yes. MCP targets are merged into one virtual MCP server, so an MCP client sees all tools in a single tools list. Gateway can turn Lambda functions, OpenAPI specs, Smithy models and API Gateway REST APIs into MCP tools, and it can also front existing MCP servers.
How do I secure an AgentCore gateway?
Set an inbound authorizer, such as OAuth JWT from Cognito, Okta or Entra ID, or IAM SigV4. For outbound calls, give the gateway role only the Lambda permissions it needs and store API keys or OAuth secrets in a credential provider. Use no authorization only for tests.
What can a gateway target be?
Targets come in three kinds. MCP targets include Lambda functions, OpenAPI specs, Smithy models, API Gateway REST APIs and MCP servers. HTTP targets pass traffic to agents or HTTP services. Inference targets route model requests to providers such as Amazon Bedrock, OpenAI and Anthropic.
How much does AgentCore Gateway cost?
Gateway is pay per use with no minimum fee. You are charged for operations such as listing and invoking tools, for search queries and for targets indexed for semantic search. Lambda functions and model calls behind the gateway are billed separately at their normal rates.
Do I need AgentCore Runtime to use Gateway?
No. Gateway works on its own. Any agent that speaks MCP can connect to it, whether it runs on your laptop, in a container, on Lambda or on AgentCore Runtime. The AWS quick start even runs the test agent on a local machine.
Conclusion
AgentCore Gateway gives your agents one secure door to every tool, agent and model they need, without writing MCP servers or storing keys in prompts.
- Three target types: MCP (merged tools), HTTP (pass-through agents) and inference (model routing).
- The AgentCore CLI creates, deploys and lists a gateway in a few commands.
- Use no inbound auth only in a sandbox; switch to JWT or IAM for real traffic.
- Clear tool descriptions decide whether the model picks the right tool.
- Billing is per operation, search and indexed target, with no minimum.

Recommended reading
- What is Amazon Bedrock?
- AWS STS and temporary credentials
- AWS AI Practitioner study guide
- AWS IAM explained
I am an Amazon Web Services Professional, having more than 11 years of experience in AWS and other technologies. Extensively working in various AWS tools like S3, Lambda, API, Kinesis, Load Balancers, EKS, ECS, and many more. Working as a Solution Architect and Technology Lead for Architecting and implementing the same for different clients. He provides expert solutions around the world and especially in countries like the United States, Canada, United Kingdom, Australia, New Zealand, etc. Check out the complete profile on About us.
