npm package: @frontpoint/aws-infra-mcp
Description: MCP server for generating AWS CDK infrastructure code with resource analysis
Author: frontpoint
Latest version: 0.1.0

# AWS Infra MCP

MCP (Model Context Protocol) server for generating AWS CDK TypeScript infrastructure code with resource analysis.

## Features

- **AWS Resource Analysis**: Scan existing AWS resources (EC2, RDS, Lambda, S3, DynamoDB, ECS, EKS, ECR, VPC, API Gateway)
- **CDK Code Generation**: Generate type-safe AWS CDK TypeScript projects
- **Full Service Coverage**: Support for compute, database, storage, and network resources
- **Interactive Configuration**: Add resources incrementally with MCP tools
- **Cost Estimation**: Preview estimated monthly costs (coming soon)
- **Security Validation**: IAM and security group validation (coming soon)

## Installation

```bash
npm install -g @frontpoint/aws-infra-mcp
```

## Usage

### As MCP Server

Add to your Claude Code MCP configuration:

```json
{
  "mcpServers": {
    "aws-infra": {
      "command": "aws-infra-mcp",
      "args": ["/path/to/your/project"]
    }
  }
}
```

### CLI

```bash
# Start MCP server in current directory
aws-infra-mcp

# Start with specific project path
aws-infra-mcp /path/to/project
```

## Available Tools

| Tool | Description |
|------|-------------|
| `aws-init` | Initialize project with AWS credentials verification |
| `aws-analyze` | Scan existing AWS resources in your account |
| `aws-status` | Show current configuration status |
| `aws-add-compute` | Add EC2, Lambda, ECS, EKS resources |
| `aws-add-database` | Add RDS, Aurora, DynamoDB resources |
| `aws-add-storage` | Add S3, ECR resources |
| `aws-add-network` | Add VPC, API Gateway resources |
| `aws-generate-all` | Generate complete CDK project |

## Supported AWS Services

### Compute
- EC2 Instances & Auto Scaling Groups
- Lambda Functions with event sources
- ECS Clusters, Services, Task Definitions
- EKS Clusters with Node Groups

### Database
- RDS (MySQL, PostgreSQL, MariaDB)
- Aurora (MySQL, PostgreSQL, Serverless v2)
- DynamoDB Tables with GSI/LSI

### Storage
- S3 Buckets with lifecycle policies
- ECR Repositories

### Network
- VPC with public/private subnets
- NAT Gateways
- API Gateway (REST, HTTP, WebSocket)

## Example Workflow

```bash
# 1. Initialize project
aws-init projectName: my-app region: ap-northeast-2

# 2. Analyze existing resources (optional)
aws-analyze

# 3. Add infrastructure resources
aws-add-network type: vpc name: main-vpc cidrBlock: 10.0.0.0/16
aws-add-database type: dynamodb name: users-table partitionKey: userId:S
aws-add-storage type: s3 name: my-app-assets versioning: true
aws-add-compute type: lambda name: api-handler runtime: nodejs20.x

# 4. Generate CDK project
aws-generate-all

# 5. Deploy
cd cdk-infra && npm install && npx cdk deploy --all
```

## Generated CDK Structure

```
cdk-infra/
├── bin/
│   └── app.ts              # CDK app entry point
├── lib/
│   └── stacks/
│       ├── network-stack.ts
│       ├── compute-stack.ts
│       ├── database-stack.ts
│       └── storage-stack.ts
├── cdk.json
├── package.json
└── tsconfig.json
```

## Requirements

- Node.js >= 18.0.0
- AWS CLI configured with credentials
- AWS CDK CLI (`npm install -g aws-cdk`)

## Configuration

Configuration is stored in `.aws-infra-mcp/` directory:

- `config.json` - Infrastructure configuration
- `state.json` - Generation state and history
- `analysis-cache.json` - Cached AWS resource analysis

## License

MIT

## Author

frontpoint