# ECS Task Sizing Calculator AI Agent Connect

> Calculate precise AWS ECS task resources, EC2 capacity, and scaling configurations.

## Overview
- **Category:** infrastructure
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_dX7W76STbQu0Kx11KJfEQ59H6c6lJp1lDV468rQQ/ai-agent-connect
- **Tags:** ecs, fargate, ec2, aws, capacity-planning

## Description

This MCP server provides deterministic calculations for AWS ECS resource planning. Use `calculate_task_resources` to determine exact CPU and memory requirements for Fargate and EC2, including mandatory overhead. Use `plan_ec2_capacity` to calculate how many tasks fit on a specific EC2 instance, and `evaluate_service_configuration` to plan for Cloud Map service discovery and target tracking scaling.

## Tools

### calculate_task_resources


### evaluate_service_configuration
Evaluate service discovery and scaling

### plan_ec2_capacity
Calculate tasks per EC2 instance

## Prompt Examples

**Prompt:** 
```
Calculate resources for a Fargate task with 2 containers, each needing 512MB memory and 256 CPU units.
```

**Response:** 
```
The total CPU required is 512 units and the total memory required is 1024 MB. This combination is valid for Fargate.
```

**Prompt:** 
```
How many tasks can I run on an EC2 instance with 8192 MB of memory if each task needs 1024 MB?
```

**Response:** 
```
You can run 7 tasks on this EC2 instance. (8192 MB total / 1280 MB per task including overhead).
```

**Prompt:** 
```
Evaluate service configuration for a service using Cloud Map with a 70% target utilization.
```

**Response:** 
```
Service discovery via Cloud Map will add operational overhead. The scaling metric to track is ECSServiceAutoScalingTargetTrackingUtilization with a target value of 70.
```

## Frequently Asked Questions

**How does the tool handle EC2 overhead?**
For EC2 launch types, the tool automatically adds a 256 MB memory overhead to the total task size to account for the ECS agent and system processes.

**Can I validate Fargate CPU and memory combinations?**
Yes, the `calculate_task_resources` tool validates your requested CPU and memory against official AWS Fargate constraints and flags invalid combinations.

**How many tasks can I fit on my EC2 instance?**
You can use the `plan_ec2_capacity` tool by providing the total task memory and the instance memory to get the maximum number of tasks per instance.
