Copied to Clipboard
At this point — hit Cntrl-C to exit the local HTTP server.
Deploy to ECS Express
Now that the server has been tested locally- start the remote deployment to ECS Express.
Use the deploy target:
> make deploy
✦ I will execute the full deployment cycle, which includes building the Docker image, pushing it to ECR, and
deploying to ECS Express Mode.
Then check the status:
>make status
✦ I will check the status of the ECS Express Mode service.
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell make status [in /home/xbill/gemini-cli-aws/mcp-ecsexpress-python-aws] │
│ │
│ Checking AWS ECS service status for mcp-express-python-aws... │
│ Service: mcp-express-python-aws │
│ Status: ACTIVE │
│ Endpoint: mc-8d69e7dfa87344be98fdb3f7a8fbbbba.ecs.us-east-1.on.aws │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The ECS Express Mode service mcp-express-python-aws is ACTIVE and available at:
mc-8d69e7dfa87344be98fdb3f7a8fbbbba.ecs.us-east-1.on.aws
And the endpoint:
Based on the make status output earlier, the actual endpoint is:
mc-8d69e7dfa87344be98fdb3f7a8fbbbba.ecs.us-east-1.on.aws
Gemini CLI settings.json
The default Gemini CLI settings.json has an entry for the Python source:
{"mcpServers":{"aws-ecs-express-python":{"httpUrl":"https://mc-8d69e7dfa87344be98fdb3f7a8fbbbba.ecs.us-east-1.on.aws/mcp"}}}
Validation with Gemini CLI
Leave the HTTP server running and open a new terminal.
Gemini CLI is restarted and the MCP connection over HTTP to the Python Code is validated. The full Gemini CLI Session will start:
xbill@penguin:~/gemini-cli-aws/mcp-ecsexpress-python-aws$gemini
▝▜▄ Gemini CLI v0.36.0
▝▜▄
▗▟▀ Signed in with Google: xbill@glitnir.com /auth
▝▀ Plan: Gemini Code Assist Standard /upgrade
>/mcp list
Configured MCP servers:
🟢 aws-ecs-express-python - Ready (1 tool)
Tools:
- mcp_aws-ecs-express-python_greet
And you can then connect to the MCP Server over HTTP:
> greet ECS Express!
✦ I will call the greet tool with "ECS Express!".
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✓ greet (aws-ecs-express-python MCP Server) {"param":"ECS Express!"} │
│ │
│ ECS Express! │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The greet tool returned: ECS Express!
Validate Project Setup with Gemini CLI
Gemini CLI was used to summarize the project:
> summarize the project deployment to Amazon ECS Express
✦ The deployment of the mcp-express-python-aws project to Amazon ECS Express Mode is a streamlined process that
automates the container lifecycle from build to public endpoint.
Deployment Workflow (make deploy)
1. Containerization: Builds a Python 3.13-slim Docker image and pushes it to an Amazon ECR repository
(mcp-server-repo).
2. Identity & Access: Automatically provisions necessary IAM roles (ecsTaskExecutionRole and
ecsInfrastructureRoleForExpressServices) if they do not already exist.
3. Orchestration: Deploys the container to ECS Express Mode, which simplifies AWS Fargate deployments by
automatically managing the Application Load Balancer, Security Groups, and Networking.
Current Infrastructure State
* Service Name: mcp-express-python-aws
* Status: ACTIVE
* Compute: AWS Fargate (Task size: 1 vCPU / 2GB RAM)
* Scaling: Configured for 1 to 20 tasks, triggered at 60% average CPU usage.
* Public Access: mc-8d69e7dfa87344be98fdb3f7a8fbbbba.ecs.us-east-1.on.aws (Port 8080)
The service is currently running and reachable via its assigned ECS Express Gateway endpoint.
Summary
The strategy for using Python for MCP development with Gemini CLI and AWS was validated with a incremental step by step approach.
A minimal HTTP transport MCP Server was started from Python source code and validated with Gemini CLI running as a MCP client in the same local environment.
The HTTP server was then tested remotely from the AWS ECS Express instance.
This approach can be extended to more complex deployments using other MCP transports and Cloud based options.