AWS Cost Analysis
Visit ProjectAnalyze CDK projects to identify AWS services used and retrieve pricing information.
Visit ProjectCategory
Tags
What is AWS Cost Analysis?
AWS Cost Analysis is a project that analyzes Cloud Development Kit (CDK) and Terraform projects to identify AWS services used and retrieve pricing information. It provides pre-deployment cost estimates for infrastructure planning and cost optimization recommendations.
How to use AWS Cost Analysis?
- Install prerequisites:
uv
and Python 3.10 - Configure AWS credentials with the necessary permissions
- Set up the MCP server in your MCP client configuration or via Docker
- Ask questions about your AWS costs in natural language to get instant answers
Key features of AWS Cost Analysis?
- Analyze and visualize AWS costs by service, region, and tier
- Generate cost report and insights for cloud infrastructure
- Query cost data using natural language for quick answers
- Get pre-deployment cost estimates and optimization recommendations
Use cases of AWS Cost Analysis?
- Planning and estimating costs before deploying AWS infrastructure
- Understanding cost distribution across AWS services for budgeting
- Optimizing cloud costs by identifying potential savings
- Analyzing both CDK and Terraform projects for AWS service usage
FAQ from AWS Cost Analysis?
-
Can AWS Cost Analysis provide exact billing information?
No, it provides estimated pricing for pre-deployment planning based on AWS pricing APIs and web pages. Actual expenses may vary.
-
Which IaC frameworks does AWS Cost Analysis support?
It supports both CDK and Terraform projects for service analysis and cost estimation.
- How are AWS credentials used?
Credentials are used locally to authenticate with AWS services and access the Pricing API. They are not stored or transmitted beyond your local machine.
Cost Analysis MCP Server
MCP server for generating upfront AWS service cost estimates and providing cost insights
Important Note: This server provides estimated pricing based on AWS pricing APIs and web pages. These estimates are for pre-deployment planning purposes and do not reflect the actual expenses of deployed cloud services.
Features
Analyze and visualize AWS costs
- Get detailed breakdown of your AWS costs by service, region and tier
- Understand how costs are distributed across various services
- Provide pre-deployment cost estimates for infrastructure planning
- Support for analyzing both CDK and Terraform projects to identify AWS services
Query cost data with natural language
- Ask questions about your AWS costs in plain English, no complex query languages required
- Get instant answers fetched from pricing webpage and AWS Pricing API, for questions related to AWS services
- Retrieve estimated pricing information before actual cloud service deployment
Generate cost reports and insights
- Generate comprehensive cost estimates based on your IaC implementation
- Get cost optimization recommendations for potential cloud infrastructure
- Provide upfront pricing analysis to support informed decision-making
Prerequisites
- Install
uv
from Astral or the GitHub README - Install Python using
uv python install 3.10
- Set up AWS credentials with access to AWS services
- You need an AWS account with appropriate permissions
- Configure AWS credentials with
aws configure
or environment variables - Ensure your IAM role/user has permissions to access AWS Pricing API
Installation
Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit ~/.aws/amazonq/mcp.json
):
{
"mcpServers": {
"awslabs.cost-analysis-mcp-server": {
"command": "uvx",
"args": ["awslabs.cost-analysis-mcp-server@latest"],
"env": {
"FASTMCP_LOG_LEVEL": "ERROR",
"AWS_PROFILE": "your-aws-profile"
},
"disabled": false,
"autoApprove": []
}
}
}
or docker after a successful docker build -t awslabs/cost-analysis-mcp-server .
:
# fictitious `.env` file with AWS temporary credentials
AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
{
"mcpServers": {
"awslabs.cost-analysis-mcp-server": {
"command": "docker",
"args": [
"run",
"--rm",
"--interactive",
"--env",
"FASTMCP_LOG_LEVEL=ERROR",
"--env-file",
"/full/path/to/file/above/.env",
"awslabs/cost-analysis-mcp-server:latest"
],
"env": {},
"disabled": false,
"autoApprove": []
}
}
}
NOTE: Your credentials will need to be kept refreshed from your host
AWS Authentication
The MCP server uses the AWS profile specified in the AWS_PROFILE
environment variable. If not provided, it defaults to the "default" profile in your AWS configuration file.
"env": {
"AWS_PROFILE": "your-aws-profile"
}
Make sure the AWS profile has permissions to access the AWS Pricing API. The MCP server creates a boto3 session using the specified profile to authenticate with AWS services. Your AWS IAM credentials remain on your local machine and are strictly used for accessing AWS services.