remote-mcp-based-on-aws-managed-services

manaty226/remote-mcp-based-on-aws-managed-services

3.2

If you are the rightful owner of remote-mcp-based-on-aws-managed-services and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A simple example of a remote model context protocol server built using AWS managed services.

Remote MCP Server Sample with AWS Managed Services

This repository provides a sample implementation of a remote Model Context Protocol (MCP) server using only AWS managed services: API Gateway and Cognito. The goal is to leverage the advanced features of API Gateway to implement an authorization-enabled MCP server without requiring any additional compute resources (such as Lambda, EC2, or containers) beyond the MCP tooling itself.

Architecture

  • API Gateway: Serves as the main entry point for all MCP server requests. It handles routing, request/response transformation, and integrates with Cognito for authentication and authorization.
  • Cognito: Provides user authentication and authorization. API Gateway is configured to require valid Cognito tokens for access to protected endpoints.
  • Lambda: Lambda is required for only the MCP tooling itself.
[Client] --(HTTPS)--> [API Gateway] --(Authorization)--> [Cognito User Pool]
                             |
                             v
                      [Cognito Authorizer]
                             |
                             v
                        [Lambda] (MCP tooling)

Getting Started

Prerequisites

  • Terraform (for infrastructure as code)
  • AWS account with permissions to create API Gateway and Cognito resources

Setup

  1. Clone this repository:

    git clone https://github.com/manaty226/remote-mcp-based-on-aws-managed-services.git
    cd remote-mcp-based-on-aws-managed-services
    
  2. Initialize and apply the Terraform configuration:

    cd infra
    terraform init
    terraform apply
    

    This will provision the API Gateway, Cognito User Pool, and related resources.

  3. After deployment, note the output values for the API endpoint and Cognito User Pool details.

Usage

To verify operation with MCP Inspector:

  1. Run MCP Inspector
npx @modelcontextprotocol/inspector
  1. Open MCP Inspector in your browser
  2. Select Streamable HTTP transport and enter https://<YOUR API GATEWAY HOST>/mcp as the URL
  3. Click Connect to establish a connection and then use MCP tool

To verify operation with VSCode:

  1. Open VSCode and edit the .vscode/mcp.json file
  2. Modify it to include the following content:
    {
         "servers": {
              "get-uuid": {
                    "url": "https://<YOUR API GATEWAY HOST>/mcp/get-uuid"
              }
         }
    }
    
  3. Save the file and start the MCP server

File Structure

  • infra/ - Terraform scripts for provisioning AWS resources
  • mcp-server/ - (Optional) Sample Lambda or Dockerfile for extension (not required for core functionality)
  • README.md - This documentation

Notes

  • This implementation is intended as a reference for building secure, serverless MCP servers using only AWS managed services.
  • For advanced logic or custom processing, you may extend with Lambda or other compute resources as needed.

License

See for details.