# Amazon Bedrock Agent Integration with Bedrock AgentCore Gateway
## Overview
This use case demonstrates a complete end-to-end integration between **Amazon Bedrock Agents** and **Amazon Bedrock AgentCore Gateway** using the **Model Context Protocol (MCP)** to connect with a practical fruit stand backend API built on AWS Lambda and DynamoDB. This showcase illustrates how MCP enables seamless communication between AI agents and existing backend systems, allowing agents to access real-world tools and data without requiring complex integration work.
**Key Integration Focus: Model Context Protocol (MCP)**
MCP is an open standard that enables AI agents to securely connect to external data sources and tools. In this use case:
- **Bedrock Agent** communicates with the Gateway using standard action group calls
- **AgentCore Gateway** translates these calls into MCP-compatible format
- **Backend Lambda functions** are automatically exposed as MCP tools
- **Real-time data access** is achieved through MCP's standardized protocol
**Amazon Bedrock Agents** uses the reasoning capabilities of foundation models (FMs), APIs, and data to break down user requests, gather relevant information, and efficiently complete tasks—freeing teams to focus on high-value work.
**Amazon Bedrock AgentCore Gateway** automatically converts APIs, Lambda functions, and existing services into MCP-compatible tools so developers can quickly make these essential capabilities available to agents without managing complex integrations.
#### The Integration Challenge Solved
Traditionally, connecting AI agents to existing backend systems requires complex API integration, protocol translation, tool management, and authentication handling. This use case demonstrates how Gateway eliminates these challenges by:
- **"What fruits are available?"** → Agent calls inventory tool via Gateway
- **"Create an order for Bob with 2 apples"** → Agent calls order creation tool
- **"Get details for order ABC123"** → Agent retrieves order information
## Prerequisites
* Python 3.9 or higher
* AWS Account with appropriate permissions
* AWS CLI 2.x configured with credentials
* Jupyter Notebook or JupyterLab
* Internet connection for AWS API calls
* Access to the following AWS services:
* Amazon Bedrock
* AWS Lambda
* Amazon DynamoDB
* Amazon Cognito (for Gateway authentication)
* AWS IAM
* Required AWS permissions: Ignore if running this sample from Admin role
*`bedrock:*` - For Bedrock Agent operations
*`lambda:*` - For Lambda function management
*`dynamodb:*` - For DynamoDB table operations
*`iam:*` - For role and policy management
*`cognito-idp:*` - For OAuth2 authentication setup
## Use case setup
Install the prerequisite packages and configure your environment:
```bash
# Navigate to the project directory
cd 06-BedrockAgent-Integration
# Install packages required for Bedrock AgentCore Gateway
pip install -r dev-requirements.txt
# Install remaining packages
pip install jupyter notebook requests urllib3
# Configure AWS credentials
aws configure
```
## Execution instructions
Run the use case by executing the Jupyter notebook:
The examples provided in this repository are for experimental and educational purposes only. They demonstrate concepts and techniques but are not intended for direct use in production environments. Make sure to have Amazon Bedrock Guardrails in place to protect against [prompt injection](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-injection.html).