aws-iac-cost-estimator-mcp-server
v0.1.1An MCP server that estimates AWS monthly costs from Terraform and CDK infrastructure-as-code files
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
estimate_terraform_cost
Estimate monthly AWS costs from a Terraform project directory. Parses .tf files, extracts AWS resources, and queries the AWS Price List API to provide cost estimates for each resource and a total monthly/annual estimate. For usage-based services (Lambda, S3, DynamoDB, SQS), the output includes usage_questions — ask the user these questions and pass their answers back via usage_inputs on a follow-up call for accuracy. If the user says 'skip' or 'use defaults', proceed without usage_inputs.
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to the Terraform project directory containing .tf files |
region | string | AWS region for pricing (default: us-east-1) |
usage_inputs | object | Optional. User-provided usage data for usage-based resources. Keys are resource identifiers (e.g., 'aws_lambda_function.processor'), values are objects with usage fields (e.g., {"monthly_requests": 50… |
estimate_tfplan_cost
Estimate monthly AWS costs from a Terraform plan JSON file. Use 'terraform show -json tfplan > plan.json' to generate the input. This provides more accurate estimates than parsing .tf files directly as it includes resolved variables and computed values.
| Parameter | Type | Description |
|---|---|---|
plan_path * | string | Path to the Terraform plan JSON file (output of 'terraform show -json') |
region | string | AWS region for pricing (default: us-east-1) |
estimate_cloudformation_cost
Estimate monthly AWS costs from a CloudFormation template (YAML or JSON). Parses the Resources section, extracts AWS resources, and queries the AWS Price List API. Supports both single template files and directories containing multiple templates.
| Parameter | Type | Description |
|---|---|---|
template_path * | string | Path to a CloudFormation template file (.yaml, .yml, .json) or a directory containing multiple templates |
region | string | AWS region for pricing (default: us-east-1) |
estimate_cdk_cost
Estimate monthly AWS costs from a CDK project. Reads synthesized CloudFormation templates from cdk.out/ directory. IMPORTANT: You must run 'cdk synth' manually BEFORE calling this tool — automatic synthesis is disabled for security reasons (it would execute arbitrary project code). Works with any CDK language (TypeScript, Python, Java, Go, C#).
| Parameter | Type | Description |
|---|---|---|
project_path * | string | Path to the CDK project directory (containing cdk.json) |
region | string | AWS region for pricing (default: us-east-1) |
estimate_resource_cost
Estimate monthly AWS cost for a single resource by specifying the resource type and its attributes directly. Useful for quick cost checks without having a full IaC project. Accepts both Terraform-style (aws_instance) and CloudFormation-style (AWS::EC2::Instance) resource types.
| Parameter | Type | Description |
|---|---|---|
attributes * | object | Resource attributes. For Terraform: {"instance_type": "m5.large"}. For CloudFormation: {"InstanceType": "m5.large"}. |
resource_type * | string | Resource type — either Terraform style (e.g., aws_instance, aws_db_instance) or CloudFormation style (e.g., AWS::EC2::Instance, AWS::RDS::DBInstance) |
count | integer | Number of this resource (default: 1) |
region | string | AWS region for pricing (default: us-east-1) |
list_supported_resources
List all supported resource types for cost estimation, including both Terraform and CloudFormation resource type formats and their corresponding AWS services.
compare_region_costs
Compare estimated costs for the same infrastructure across multiple AWS regions. Useful for choosing the cheapest region for deployment.
| Parameter | Type | Description |
|---|---|---|
iac_type * | string | Type of IaC project (terraform, cloudformation, or cdk) |
project_path * | string | Path to Terraform, CDK, or CloudFormation project |
regions * | array | List of AWS regions to compare (e.g., ['us-east-1', 'eu-west-1', 'ap-southeast-1']) |
cost_diff
Compare cost estimates between two versions of infrastructure (e.g., current main branch vs. a proposed PR). Shows what changed: new resources added, resources removed, resources modified, and the total cost impact. Generates a PR-ready markdown comment. Ideal for code reviews and CI/CD pipelines.
| Parameter | Type | Description |
|---|---|---|
baseline_path * | string | Path to the baseline/current IaC project (e.g., main branch) |
iac_type * | string | Type of IaC project |
proposed_path * | string | Path to the proposed/new IaC project (e.g., PR branch) |
region | string | AWS region for pricing (default: us-east-1) |