mcp -with-fargate
Running an MCP Server on AWS Fargate on Amazon ECS
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:
- Clone or download this repository
- Install dependencies (if any) and bootstrap your AWS environment for CDK: npm install cdk bootstrap
- Deploy the stack to AWS: cdk deploy
- 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
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP