MCP Server for AWS - EC2, Cost Management, Resource Optimization
npm install @plugix/mcp-awsMCP server for AWS infrastructure management and cost optimization.
- get_ec2_instances - List EC2 instances with filters
- get_cost_report - AWS cost analysis by service
- get_idle_resources - Find wasteful resources (EBS, EIPs)
- stop_instances - Stop EC2 instances (with confirmation)
- delete_volumes - Delete unused EBS volumes (with confirmation)
``bash`
npm install @plugix/mcp-aws
Or run directly:
`bash`
npx @plugix/mcp-aws
Set environment variables:
`envPlugix API connection
API_URL=wss://api.plugix.ai
API_TOKEN=plx_live_your_token_here
Or use IAM roles (recommended for EC2/ECS):
`env
API_URL=wss://api.plugix.ai
API_TOKEN=plx_live_your_token_here
AWS_REGION=us-east-1
No access keys needed - uses instance role
`Usage
$3
`bash
npm run dev
`$3
`bash
npm run build
npm start
`$3
`bash
docker build -t plugix-mcp-aws .
docker run --env-file .env plugix-mcp-aws
`$3
Add to
claude_desktop_config.json:`json
{
"mcpServers": {
"aws": {
"command": "npx",
"args": ["@plugix/mcp-aws"],
"env": {
"API_URL": "wss://api.plugix.ai",
"API_TOKEN": "plx_live_your_token",
"AWS_REGION": "us-east-1"
}
}
}
}
`Tools Reference
$3
List EC2 instances with optional filters.
Parameters:
| Name | Type | Description |
|------|------|-------------|
| state | string | Filter: running, stopped, pending, terminated |
| instanceType | string | Filter by type (t3.micro, m5.large, etc.) |
| tagName | string | Filter by Name tag (partial match) |
Example:
`json
{
"name": "get_ec2_instances",
"arguments": {
"state": "running",
"tagName": "production"
}
}
`$3
Get AWS cost breakdown for a date range.
Parameters:
| Name | Type | Required | Description |
|------|------|----------|-------------|
| startDate | string | Yes | YYYY-MM-DD |
| endDate | string | Yes | YYYY-MM-DD |
| granularity | string | No | DAILY or MONTHLY |
Example:
`json
{
"name": "get_cost_report",
"arguments": {
"startDate": "2024-01-01",
"endDate": "2024-01-31",
"granularity": "DAILY"
}
}
`$3
Find resources that could be deleted to save costs.
Checks:
- Stopped EC2 instances (EBS charges continue)
- Unattached EBS volumes
- Unassociated Elastic IPs
Parameters: None
$3
Stop one or more EC2 instances. Requires confirmation.
Parameters:
| Name | Type | Required | Description |
|------|------|----------|-------------|
| instanceIds | array | Yes | List of instance IDs |
| confirmed | boolean | Yes | Must be
true to stop |Example:
`json
{
"name": "stop_instances",
"arguments": {
"instanceIds": ["i-1234567890abcdef0"],
"confirmed": true
}
}
`$3
Delete unattached EBS volumes. HIGH RISK - requires confirmation.
Parameters:
| Name | Type | Required | Description |
|------|------|----------|-------------|
| volumeIds | array | Yes | List of volume IDs |
| confirmed | boolean | Yes | Must be
true to delete |IAM Permissions
Minimum required IAM policy:
`json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeVolumes",
"ec2:DescribeAddresses",
"ec2:StopInstances",
"ec2:DeleteVolume"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ce:GetCostAndUsage"
],
"Resource": "*"
}
]
}
`For read-only access, remove
StopInstances and DeleteVolume.Testing
`bash
npm test
``MIT