awslabs.cost-explorer-mcp-server 0.0.5__tar.gz → 0.0.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/CHANGELOG.md +19 -0
  2. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/Dockerfile +2 -2
  3. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/PKG-INFO +41 -14
  4. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/README.md +39 -12
  5. awslabs_cost_explorer_mcp_server-0.0.6/awslabs/cost_explorer_mcp_server/comparison_handler.py +719 -0
  6. awslabs_cost_explorer_mcp_server-0.0.6/awslabs/cost_explorer_mcp_server/constants.py +106 -0
  7. awslabs_cost_explorer_mcp_server-0.0.5/awslabs/cost_explorer_mcp_server/server.py → awslabs_cost_explorer_mcp_server-0.0.6/awslabs/cost_explorer_mcp_server/cost_usage_handler.py +20 -152
  8. awslabs_cost_explorer_mcp_server-0.0.6/awslabs/cost_explorer_mcp_server/forecasting_handler.py +234 -0
  9. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/awslabs/cost_explorer_mcp_server/helpers.py +381 -59
  10. awslabs_cost_explorer_mcp_server-0.0.6/awslabs/cost_explorer_mcp_server/metadata_handler.py +88 -0
  11. awslabs_cost_explorer_mcp_server-0.0.6/awslabs/cost_explorer_mcp_server/models.py +70 -0
  12. awslabs_cost_explorer_mcp_server-0.0.6/awslabs/cost_explorer_mcp_server/server.py +92 -0
  13. awslabs_cost_explorer_mcp_server-0.0.6/awslabs/cost_explorer_mcp_server/utility_handler.py +50 -0
  14. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/pyproject.toml +2 -2
  15. awslabs_cost_explorer_mcp_server-0.0.6/tests/test_comparison_handler.py +1507 -0
  16. awslabs_cost_explorer_mcp_server-0.0.6/tests/test_cost_usage_handler.py +1283 -0
  17. awslabs_cost_explorer_mcp_server-0.0.6/tests/test_forecasting_handler.py +483 -0
  18. awslabs_cost_explorer_mcp_server-0.0.6/tests/test_helpers.py +1195 -0
  19. awslabs_cost_explorer_mcp_server-0.0.6/tests/test_metadata_handler.py +230 -0
  20. awslabs_cost_explorer_mcp_server-0.0.6/tests/test_models.py +135 -0
  21. awslabs_cost_explorer_mcp_server-0.0.6/tests/test_server.py +75 -0
  22. awslabs_cost_explorer_mcp_server-0.0.6/tests/test_utility_handler.py +52 -0
  23. awslabs_cost_explorer_mcp_server-0.0.6/uv-requirements.txt +26 -0
  24. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/uv.lock +8 -8
  25. awslabs_cost_explorer_mcp_server-0.0.5/tests/test_helpers.py +0 -919
  26. awslabs_cost_explorer_mcp_server-0.0.5/tests/test_server.py +0 -1378
  27. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/.gitignore +0 -0
  28. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/.python-version +0 -0
  29. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/LICENSE +0 -0
  30. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/NOTICE +0 -0
  31. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/awslabs/__init__.py +0 -0
  32. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/awslabs/cost_explorer_mcp_server/__init__.py +0 -0
  33. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/docker-healthcheck.sh +0 -0
  34. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/tests/__init__.py +0 -0
  35. {awslabs_cost_explorer_mcp_server-0.0.5 → awslabs_cost_explorer_mcp_server-0.0.6}/tests/conftest.py +0 -0
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.6.0] - 2025-06-20
9
+
10
+ ### Added
11
+ - **NEW AWS Cost Comparison Feature Integration**
12
+ - `get_cost_and_usage_comparisons` - Leverage AWS Cost Explorer's new Cost Comparison feature to compare costs between two time periods
13
+ - `get_cost_comparison_drivers` - Automatically analyze the top 10 most significant cost change drivers using AWS's new API
14
+ - Reduces manual cost analysis time from hours to seconds using AWS's built-in intelligence
15
+ - Provides detailed breakdowns of cost drivers, including usage and discount changes
16
+ **Cost Forecasting Capabilities**
17
+ - `get_cost_forecast` - Generate cost forecasts based on historical usage patterns with confidence intervals (80% or 95%)
18
+ - Support for daily and monthly forecast granularity for budget planning
19
+ **Modular Architecture**
20
+ - Refactored codebase into modular handler architecture for better maintainability
21
+ - Separate handlers for cost usage, comparison, forecasting, metadata, and utility functions
22
+ **Enhanced Testing**
23
+ - Comprehensive test coverage for comparison features
24
+ - Fixed duplicate test method definitions
25
+ - Improved test reliability and error handling
26
+
8
27
  ## [0.5.0] - 2025-06-16
9
28
 
10
29
  ### Added
@@ -30,11 +30,11 @@ ENV UV_PYTHON_PREFERENCE=only-system
30
30
  ENV UV_FROZEN=true
31
31
 
32
32
  # Copy the required files first
33
- COPY pyproject.toml uv.lock ./
33
+ COPY pyproject.toml uv.lock uv-requirements.txt ./
34
34
 
35
35
  # Install the project's dependencies using the lockfile and settings
36
36
  RUN --mount=type=cache,target=/root/.cache/uv \
37
- pip install uv && \
37
+ pip install --require-hashes --requirement uv-requirements.txt && \
38
38
  uv sync --frozen --no-install-project --no-dev --no-editable
39
39
 
40
40
  # Then, add the rest of the project source code and install it
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.cost-explorer-mcp-server
3
- Version: 0.0.5
3
+ Version: 0.0.6
4
4
  Summary: MCP server for analyzing AWS costs and usage data through the AWS Cost Explorer API
5
5
  Project-URL: Homepage, https://awslabs.github.io/mcp/
6
6
  Project-URL: Documentation, https://awslabs.github.io/mcp/servers/cost-explorer-mcp-server/
@@ -21,7 +21,7 @@ Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
23
  Requires-Python: >=3.10
24
- Requires-Dist: boto3>=1.36.20
24
+ Requires-Dist: boto3>=1.38.40
25
25
  Requires-Dist: loguru>=0.7.0
26
26
  Requires-Dist: mcp[cli]>=1.6.0
27
27
  Requires-Dist: pandas>=2.2.3
@@ -41,17 +41,28 @@ MCP server for analyzing AWS costs and usage data through the AWS Cost Explorer
41
41
  - Query historical cost data for specific time periods
42
42
  - Filter costs by various dimensions, tags, and cost categories
43
43
 
44
+
45
+ ### Compare costs between time periods
46
+
47
+ - **NEW AWS Feature**: Leverage AWS Cost Explorer's new [Cost Comparison feature](https://docs.aws.amazon.com/cost-management/latest/userguide/ce-cost-comparison.html)
48
+ - Compare costs between two time periods to identify changes and trends
49
+ - Analyze cost drivers to understand what caused cost increases or decreases
50
+ - Get detailed insights into the top 10 most significant cost change drivers automatically
51
+ - Identify specific usage types, discount changes, and infrastructure changes affecting costs
52
+
53
+ ### Forecast future costs
54
+
55
+ - Generate cost forecasts based on historical usage patterns
56
+ - Get predictions with confidence intervals (80% or 95%)
57
+ - Support for daily and monthly forecast granularity
58
+ - Plan budgets and anticipate future AWS spending
59
+
44
60
  ### Query cost data with natural language
45
61
 
46
62
  - Ask questions about your AWS costs in plain English
47
63
  - Get instant answers about your AWS spending patterns
48
64
  - Retrieve historical cost data with simple queries
49
65
 
50
- ### Generate cost reports and insights
51
-
52
- - Generate comprehensive cost reports based on your AWS Cost Explorer data
53
- - Get cost breakdowns by various dimensions (service, region, account, etc.)
54
- - Analyze usage patterns and spending trends
55
66
 
56
67
  ## Prerequisites
57
68
 
@@ -149,6 +160,9 @@ The following IAM permissions are required for this MCP server:
149
160
  - ce:GetCostAndUsage
150
161
  - ce:GetDimensionValues
151
162
  - ce:GetTags
163
+ - ce:GetCostForecast
164
+ - ce:GetCostAndUsageComparisons
165
+ - ce:GetCostComparisonDrivers
152
166
 
153
167
 
154
168
 
@@ -160,26 +174,39 @@ The Cost Explorer MCP Server provides the following tools:
160
174
  2. `get_dimension_values` - Get available values for a specific dimension (e.g., SERVICE, REGION)
161
175
  3. `get_tag_values` - Get available values for a specific tag key
162
176
  4. `get_cost_and_usage` - Retrieve AWS cost and usage data with filtering and grouping options
177
+ 5. `get_cost_and_usage_comparisons` - Compare costs between two time periods to identify changes and trends
178
+ 6. `get_cost_comparison_drivers` - Analyze what drove cost changes between periods (top 10 most significant drivers)
179
+ 7. `get_cost_forecast` - Generate cost forecasts based on historical usage patterns
163
180
 
164
181
  ## Example Usage
165
182
 
166
- Here are some examples of how to use the Cost Explorer MCP Server:
167
-
183
+ Here are some examples of how to use the Cost Explorer MCP Server through natural language queries:
168
184
 
169
- ### Get dimension values
185
+ ### Cost Analysis Examples
170
186
 
171
187
  ```
172
- What AWS services did I use last month?
188
+ Show me my AWS costs for the last 3 months grouped by service in us-east-1 region
189
+ Break down my S3 costs by storage class for Q1 2025
190
+ Show me costs for production resources tagged with Environment=prod
191
+ What were my costs for reserved instances vs on-demand in May?
192
+ What was my EC2 instance usage by instance type?
173
193
  ```
174
194
 
175
- ### Generate a cost report
195
+ ### Cost Comparison Examples
176
196
 
177
197
  ```
178
- Show me my AWS costs for the last 3 months grouped by service in us-east-1 region
198
+ Compare my AWS costs between April and May 2025
199
+ How did my EC2 costs change from last month to this month?
200
+ Why did my AWS bill increase in June compared to May?
201
+ What caused the spike in my S3 costs last month?
179
202
  ```
180
203
 
204
+ ### Forecasting Examples
205
+
181
206
  ```
182
- What were my EC2 costs excluding us-east-2 for January 2025?
207
+ Forecast my AWS costs for next month
208
+ Predict my EC2 spending for the next quarter
209
+ What will my total AWS bill be for the rest of 2025?
183
210
  ```
184
211
 
185
212
  ## License
@@ -11,17 +11,28 @@ MCP server for analyzing AWS costs and usage data through the AWS Cost Explorer
11
11
  - Query historical cost data for specific time periods
12
12
  - Filter costs by various dimensions, tags, and cost categories
13
13
 
14
+
15
+ ### Compare costs between time periods
16
+
17
+ - **NEW AWS Feature**: Leverage AWS Cost Explorer's new [Cost Comparison feature](https://docs.aws.amazon.com/cost-management/latest/userguide/ce-cost-comparison.html)
18
+ - Compare costs between two time periods to identify changes and trends
19
+ - Analyze cost drivers to understand what caused cost increases or decreases
20
+ - Get detailed insights into the top 10 most significant cost change drivers automatically
21
+ - Identify specific usage types, discount changes, and infrastructure changes affecting costs
22
+
23
+ ### Forecast future costs
24
+
25
+ - Generate cost forecasts based on historical usage patterns
26
+ - Get predictions with confidence intervals (80% or 95%)
27
+ - Support for daily and monthly forecast granularity
28
+ - Plan budgets and anticipate future AWS spending
29
+
14
30
  ### Query cost data with natural language
15
31
 
16
32
  - Ask questions about your AWS costs in plain English
17
33
  - Get instant answers about your AWS spending patterns
18
34
  - Retrieve historical cost data with simple queries
19
35
 
20
- ### Generate cost reports and insights
21
-
22
- - Generate comprehensive cost reports based on your AWS Cost Explorer data
23
- - Get cost breakdowns by various dimensions (service, region, account, etc.)
24
- - Analyze usage patterns and spending trends
25
36
 
26
37
  ## Prerequisites
27
38
 
@@ -119,6 +130,9 @@ The following IAM permissions are required for this MCP server:
119
130
  - ce:GetCostAndUsage
120
131
  - ce:GetDimensionValues
121
132
  - ce:GetTags
133
+ - ce:GetCostForecast
134
+ - ce:GetCostAndUsageComparisons
135
+ - ce:GetCostComparisonDrivers
122
136
 
123
137
 
124
138
 
@@ -130,26 +144,39 @@ The Cost Explorer MCP Server provides the following tools:
130
144
  2. `get_dimension_values` - Get available values for a specific dimension (e.g., SERVICE, REGION)
131
145
  3. `get_tag_values` - Get available values for a specific tag key
132
146
  4. `get_cost_and_usage` - Retrieve AWS cost and usage data with filtering and grouping options
147
+ 5. `get_cost_and_usage_comparisons` - Compare costs between two time periods to identify changes and trends
148
+ 6. `get_cost_comparison_drivers` - Analyze what drove cost changes between periods (top 10 most significant drivers)
149
+ 7. `get_cost_forecast` - Generate cost forecasts based on historical usage patterns
133
150
 
134
151
  ## Example Usage
135
152
 
136
- Here are some examples of how to use the Cost Explorer MCP Server:
137
-
153
+ Here are some examples of how to use the Cost Explorer MCP Server through natural language queries:
138
154
 
139
- ### Get dimension values
155
+ ### Cost Analysis Examples
140
156
 
141
157
  ```
142
- What AWS services did I use last month?
158
+ Show me my AWS costs for the last 3 months grouped by service in us-east-1 region
159
+ Break down my S3 costs by storage class for Q1 2025
160
+ Show me costs for production resources tagged with Environment=prod
161
+ What were my costs for reserved instances vs on-demand in May?
162
+ What was my EC2 instance usage by instance type?
143
163
  ```
144
164
 
145
- ### Generate a cost report
165
+ ### Cost Comparison Examples
146
166
 
147
167
  ```
148
- Show me my AWS costs for the last 3 months grouped by service in us-east-1 region
168
+ Compare my AWS costs between April and May 2025
169
+ How did my EC2 costs change from last month to this month?
170
+ Why did my AWS bill increase in June compared to May?
171
+ What caused the spike in my S3 costs last month?
149
172
  ```
150
173
 
174
+ ### Forecasting Examples
175
+
151
176
  ```
152
- What were my EC2 costs excluding us-east-2 for January 2025?
177
+ Forecast my AWS costs for next month
178
+ Predict my EC2 spending for the next quarter
179
+ What will my total AWS bill be for the rest of 2025?
153
180
  ```
154
181
 
155
182
  ## License