Integrates with various AWS services including Cost Explorer, Cost Optimization Hub, Compute Optimizer, Trusted Advisor, and Performance Insights to analyze AWS costs and provide optimization recommendations
Supports integration with Git for version control of the MCP server code and configuration
Hosts the MCP server code repository, allowing users to clone and contribute to the project
Supports Markdown format for report generation, enabling detailed cost optimization reports to be produced in a human-readable format
Uses Python to integrate with AWS services and implement cost optimization analysis capabilities
CFM Tips - Cost Optimization MCP Server
A comprehensive Model Context Protocol (MCP) server for AWS cost analysis and optimization recommendations, designed to work seamlessly with Amazon Q CLI and other MCP-compatible clients.
🚀 Quick Start
🧩 Add-on MCPs
Add-on AWS Pricing MCP Server MCP server for accessing real-time AWS pricing information and providing cost analysis capabilities https://github.com/awslabs/mcp/tree/main/src/aws-pricing-mcp-server
✅ Features
Core AWS Services Integration
- Cost Explorer - Retrieve cost data and usage metrics
- Cost Optimization Hub - Get AWS cost optimization recommendations
- Compute Optimizer - Right-sizing recommendations for compute resources
- Trusted Advisor - Cost optimization checks and recommendations
- Performance Insights - RDS performance metrics and analysis
- CUR Reports - Cost and Usage Report analysis from S3
Cost Optimization Playbooks
- 🔧 EC2 Right Sizing - Identify underutilized EC2 instances
- 💾 EBS Optimization - Find unused and underutilized volumes
- 🗄️ RDS Optimization - Identify idle and underutilized databases
- ⚡ Lambda Optimization - Find overprovisioned and unused functions
- 📊 Comprehensive Analysis - Multi-service cost analysis
Advanced Features
- Real CloudWatch Metrics - Uses actual AWS metrics for analysis
- Multiple Output Formats - JSON and Markdown report generation
- Cost Calculations - Estimated savings and cost breakdowns
- Actionable Recommendations - Priority-based optimization suggestions
📁 Project Structure
🔐 Required AWS Permissions
Your AWS credentials need these permissions. The MCP server uses your role to perform actions, hence proceed with least privilege access only. The below creates an IAM policy with for list, read and describe actions only:
🛠️ Installation
Prerequisites
- Python 3.11 or higher
- AWS CLI configured with appropriate credentials
- Amazon Q CLI (for MCP integration) - https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html
Setup Steps
- Clone the Repository
- Install Dependencies
- Configure AWS Credentials
- Apply IAM Permissions
- Create an IAM policy with the permissions listed above
- Attach the policy to your IAM user or role
- Test the Installation
- Start the MCP Server
- Start the Q Chat
🔧 Available Tools
Cost Analysis Tools
get_cost_explorer_data
- Retrieve AWS cost and usage datalist_coh_enrollment
- Check Cost Optimization Hub enrollmentget_coh_recommendations
- Get cost optimization recommendationsget_coh_summaries
- Get recommendation summariesget_compute_optimizer_recommendations
- Get compute optimization recommendations
EC2 Optimization
ec2_rightsizing
- Analyze EC2 instances for right-sizing opportunitiesec2_report
- Generate detailed EC2 optimization reports
EBS Optimization
ebs_optimization
- Analyze EBS volumes for optimizationebs_unused
- Identify unused EBS volumesebs_report
- Generate EBS optimization reports
RDS Optimization
rds_optimization
- Analyze RDS instances for optimizationrds_idle
- Identify idle RDS instancesrds_report
- Generate RDS optimization reports
Lambda Optimization
lambda_optimization
- Analyze Lambda functions for optimizationlambda_unused
- Identify unused Lambda functionslambda_report
- Generate Lambda optimization reports
Comprehensive Analysis
comprehensive_analysis
- Multi-service cost analysis
Additional Tools
list_cur_reports
- List Cost and Usage Reports in S3get_trusted_advisor_checks
- Get Trusted Advisor recommendationsget_performance_insights_metrics
- Get RDS Performance Insights data
📊 Example Usage
Basic Cost Analysis
Resource Optimization
Report Generation
Multi-Service Analysis
🔍 Troubleshooting
Common Issues
- Cost Optimization Hub Not Working
- No Metrics Found
- Ensure resources have been running for at least 14 days
- Verify CloudWatch metrics are enabled
- Check that you're analyzing the correct region
- Permission Errors
- Verify IAM permissions are correctly applied
- Check AWS credentials configuration
- Ensure Cost Optimization Hub is enabled in AWS Console
- Import Errors
Getting Help
- Check the RUNBOOKS_GUIDE.md for detailed usage instructions
- Run the diagnostic script:
python3 diagnose_cost_optimization_hub_v2.py
- Run integration tests:
python3 test_runbooks.py
🎯 Key Benefits
- Immediate Cost Savings - Identify unused resources for deletion
- Right-Sizing Opportunities - Optimize overprovisioned resources
- Real Metrics Analysis - Uses actual CloudWatch data
- Actionable Reports - Clear recommendations with cost estimates
- Comprehensive Coverage - Analyze EC2, EBS, RDS, Lambda, and more
- Easy Integration - Works seamlessly with Amazon Q CLI
📈 Expected Results
The CFM Tips cost optimization server can help you:
- Identify cost savings on average
- Find unused resources costing hundreds of dollars monthly
- Right-size overprovisioned instances for optimal performance/cost ratio
- Optimize storage costs through volume type recommendations
- Eliminate idle resources that provide no business value
🤝 Contributing
We welcome contributions! Please see our contributing guidelines:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A comprehensive Model Context Protocol server that analyzes AWS costs and provides optimization recommendations by integrating with services like Cost Explorer, Cost Optimization Hub, and Trusted Advisor.
Related MCP Servers
- AsecurityFlicenseAqualityA Model Context Protocol server that integrates with AWS CodePipeline, allowing users to manage pipelines through Windsurf and Cascade using natural language commands.Last updated -124TypeScript
- AsecurityFlicenseAqualityA comprehensive Model Context Protocol server for advanced code analysis that provides tools for syntax analysis, dependency visualization, and AI-assisted development workflow support.Last updated -284Python
Log Analyzer with MCPofficial
-securityAlicense-qualityA Model Context Protocol server that provides AI assistants access to AWS CloudWatch Logs, enabling browsing, searching, summarizing, and correlating logs across multiple AWS services.Last updated -104PythonApache 2.0- AsecurityFlicenseAqualityA Model Context Protocol server that provides tools for accessing and managing AWS VPC Lattice information, allowing users to list sources and retrieve sample prompts related to AWS networking documentation.Last updated -21TypeScript