Enables deployment and management of MCP servers on Amazon Bedrock AgentCore, providing a gateway to wrap AWS Lambda functions as standardized tools.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Amazon Bedrock AgentCore MCP Gatewaycheck the stock price for AMZN"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server POC for Amazon Bedrock AgentCore
This POC demonstrates deployment and management of Model Context Protocol (MCP) servers on Amazon Bedrock AgentCore using the Gateway method.
Overview
The Model Context Protocol (MCP) provides a standardized interface for AI applications to access tools, resources, and enterprise data sources. This solution implements:
Gateway Method: Wraps existing Lambda functions or REST APIs as MCP tools, handling protocol translation automatically
MCP Server: Direct implementation using FastMCP framework
Architecture
┌─────────────────┐
│ Bedrock │
│ AgentCore │
└────────┬────────┘
│
▼
┌─────────────────┐
│ MCP Gateway │ ← Protocol Translation
│ (Lambda) │
└────────┬────────┘
│
┌────┴────┐
▼ ▼
┌────────┐ ┌────────┐
│Lambda │ │ REST │
│Functions│ │ APIs │
└────────┘ └────────┘Components
MCP Gateway (
gateway/): Translates MCP protocol to Lambda/REST API callsMCP Server (
server/): Direct MCP server implementation using FastMCPExample Tools (
tools/): Sample Lambda functions and REST APIsInfrastructure (
infrastructure/): AWS SAM templates for deployment
Prerequisites
Python 3.11+
AWS CLI configured
AWS SAM CLI installed
Docker (for local testing)
Quick Start
1. Install Dependencies
pip install -r requirements.txt2. Deploy Infrastructure
Option A: Using AWS SAM (Recommended for beginners)
cd infrastructure
sam build
sam deploy --guidedOption B: Using Terraform
cd terraform
cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your values
terraform init
terraform plan
terraform applySee TERRAFORM_QUICKSTART.md for detailed Terraform deployment guide with Python dependencies layer configuration.
3. Test MCP Gateway
python test_gateway.pyProject Structure
mcp_1/
├── gateway/ # MCP Gateway implementation
│ ├── __init__.py
│ ├── gateway.py # Main gateway handler
│ └── protocol.py # MCP protocol translation
├── server/ # Direct MCP server
│ ├── __init__.py
│ └── mcp_server.py # FastMCP server
├── tools/ # Example tools
│ ├── lambda_functions/ # Lambda functions as MCP tools
│ └── rest_apis/ # REST API endpoints
├── infrastructure/ # AWS SAM deployment
│ ├── template.yaml # SAM template
│ └── README.md # SAM deployment guide
├── terraform/ # Terraform deployment
│ ├── main.tf # Main Terraform configuration
│ ├── variables.tf # Variable definitions
│ ├── outputs.tf # Output values
│ ├── versions.tf # Provider versions
│ ├── README.md # Terraform deployment guide
│ └── Makefile # Helper commands
├── TERRAFORM_QUICKSTART.md # Quick Terraform deployment guide
├── QUICKSTART.md # Local development quick start
├── tests/ # Test files
├── requirements.txt # Python dependencies
└── README.md # This fileGateway Method
The Gateway method automatically:
Translates MCP tool calls to Lambda invocations
Translates MCP tool calls to REST API requests
Handles authentication and error handling
Provides unified interface for multiple backends
Example Usage
Registering a Lambda Function as MCP Tool
from gateway.gateway import MCPGateway
gateway = MCPGateway()
gateway.register_lambda_tool(
name="weather_lookup",
lambda_arn="arn:aws:lambda:us-east-1:123456789:function:WeatherFunction",
description="Get weather information for a location"
)Registering a REST API as MCP Tool
gateway.register_rest_tool(
name="stock_price",
endpoint="https://api.example.com/stock",
method="GET",
description="Get stock price information"
)Testing
Run the test suite:
pytest tests/Test the gateway locally:
python -m gateway.gatewayDeployment
Terraform: See
TERRAFORM_QUICKSTART.mdfor quick Terraform deployment (includes Python dependencies layer)SAM: See
DEPLOYMENT.mdfor detailed SAM deployment instructionsTerraform Details: See
terraform/README.mdfor comprehensive Terraform guide
License
MIT
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.