Get the FREE Ultimate OpenClaw Setup Guide →

mcp -with-fargate

Running an MCP Server on AWS Fargate on Amazon ECS

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dgallitelli-mcp-server-with-fargate docker run -i dgallitelli/mcp-server-with-fargate \
  --env AWS_REGION="us-east-1" \
  --env AWS_PROFILE="default"

How to use

This MCP server is designed to be deployed on AWS using Fargate via an AWS CDK script. Once deployed, you interact with the MCP server over HTTP as your transport layer. The typical workflow is to provision the stack with CDK, which launches the containerized MCP server in a Fargate task behind a load balancer. After deployment, create an MCP Client that uses HTTP as the transport to communicate with the MCP server, and you can ping the server to verify it’s reachable. The server exposes the standard MCP endpoints for requesting model context, performing RPC calls, and streaming updates depending on the configuration in the CDK stack.

How to install

Prerequisites:

  • Node.js and npm installed
  • AWS CLI installed and configured with appropriate credentials
  • AWS CDK installed globally (npm install -g aws-cdk@latest)

Installation steps:

  1. Clone or download this repository
  2. Install dependencies (if any) and bootstrap your AWS environment for CDK: npm install cdk bootstrap
  3. Deploy the stack to AWS: cdk deploy
  4. After successful deployment, note the endpoint/URL provided by the load balancer for HTTP access to the MCP server. Use this URL as the MCP server address from your MCP Client.

Optional maintenance:

  • To destroy the stack when no longer needed: cdk destroy

Additional notes

Notes and tips:

  • The MCP server runs on AWS Fargate, so you will incur AWS usage charges based on compute time and data transfer. Ensure your VPC, subnets, and security groups allow the needed HTTP access.
  • The deployment is driven by CDK; you can customize the stack to adjust memory, CPU, and environment variables if the MCP server supports such options.
  • If you need to connect from outside your VPC, configure a public-facing load balancer or use a NAT/VPN setup as appropriate.
  • Common issues: insufficient IAM permissions for CDK to create resources, misconfigured VPC/subnet settings, or security groups blocking HTTP traffic. Check CloudFormation/CDK logs for details.
  • If you plan to run multiple MCP servers, you can repeat the deployment with different stack names or modify the CDK app to create multiple Fargate services behind a single load balancer.

Related MCP Servers

Sponsor this space

Reach thousands of developers