@jadenrazo/cloudcost-mcp 0.4.0 → 0.5.0

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.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <h1 align="center">CloudCost MCP Server</h1>
2
2
 
3
3
  <p align="center">
4
- Multi-cloud cost analysis for Terraform. Live pricing from AWS, Azure, and GCP.
4
+ Multi-cloud cost analysis for Terraform, CloudFormation, Pulumi, and Bicep/ARM. Live pricing from AWS, Azure, and GCP.
5
5
  <br />
6
6
  Built on the <a href="https://modelcontextprotocol.io">Model Context Protocol</a> for seamless AI agent integration.
7
7
  </p>
@@ -28,11 +28,12 @@
28
28
 
29
29
  ---
30
30
 
31
- CloudCost MCP is a [Model Context Protocol](https://modelcontextprotocol.io) server that lets AI agents parse Terraform codebases, query real-time pricing data, and generate multi-cloud cost comparison reports. It connects directly to public pricing APIs from AWS, Azure, and GCP. No API keys or cloud credentials required.
31
+ CloudCost MCP is a [Model Context Protocol](https://modelcontextprotocol.io) server that lets AI agents parse infrastructure-as-code across multiple formats (Terraform, CloudFormation, Pulumi, Bicep/ARM), query real-time pricing data, and generate multi-cloud cost comparison reports. It connects directly to public pricing APIs from AWS, Azure, and GCP. No API keys or cloud credentials required.
32
32
 
33
33
  ### What it does
34
34
 
35
- - Parses Terraform HCL files and extracts resource inventories with variable resolution, including referenced modules and OpenTofu `.tofu` files
35
+ - Parses Terraform HCL files, CloudFormation templates, Pulumi stack exports, and Bicep/ARM templates with automatic format detection
36
+ - Extracts resource inventories with variable resolution, including referenced modules and OpenTofu `.tofu` files
36
37
  - Queries live on-demand pricing from AWS Bulk Pricing CSV and Azure Retail Prices REST API; GCP via live Cloud Billing Catalog API with bundled fallback
37
38
  - Maps equivalent resources across AWS, Azure, and GCP (compute, database, storage, networking, Kubernetes, container registries, secrets management, DNS)
38
39
  - Generates cost estimates with per-resource breakdowns (monthly and yearly) across multiple currencies
@@ -43,6 +44,15 @@ CloudCost MCP is a [Model Context Protocol](https://modelcontextprotocol.io) ser
43
44
  - Tags resources for cost attribution and groups report output by team, environment, or any custom label
44
45
  - Posts cost estimate comments to pull requests via a reusable GitHub Actions composite action
45
46
 
47
+ ### Supported IaC Formats
48
+
49
+ | Format | Extensions | Auto-detected |
50
+ |---|---|---|
51
+ | Terraform/OpenTofu | `.tf`, `.tofu` | Yes |
52
+ | CloudFormation | `.yaml`, `.yml`, `.json`, `.template` | Yes |
53
+ | Pulumi | `.json` (stack export) | Yes |
54
+ | Bicep/ARM | `.json` (ARM template) | Yes |
55
+
46
56
  ---
47
57
 
48
58
  ## Installation
@@ -117,7 +127,7 @@ node dist/index.js
117
127
 
118
128
  ## Tools
119
129
 
120
- The server exposes seven MCP tools. Each accepts JSON input and returns structured JSON output.
130
+ The server exposes eleven MCP tools. Each accepts JSON input and returns structured JSON output.
121
131
 
122
132
  ### `analyze_terraform`
123
133
 
@@ -208,6 +218,50 @@ Run hypothetical pricing scenarios against existing Terraform resources. Change
208
218
  }
209
219
  ```
210
220
 
221
+ ### `analyze_plan`
222
+
223
+ Parse terraform plan JSON output for before/after cost-of-change analysis. Shows what resources are being added, changed, or destroyed and the cost impact of each change.
224
+
225
+ | Parameter | Type | Required | Description |
226
+ |-----------|------|----------|-------------|
227
+ | `plan_json` | `string` | Yes | JSON output from `terraform show -json planfile` |
228
+ | `provider` | `aws \| azure \| gcp` | No | Target provider for pricing (auto-detected if omitted) |
229
+ | `currency` | `string` | No | Output currency (default: `USD`) |
230
+
231
+ ### `compare_actual`
232
+
233
+ Parse `.tfstate` files to compare actual infrastructure costs vs estimates. Identifies drift between planned and deployed resources.
234
+
235
+ | Parameter | Type | Required | Description |
236
+ |-----------|------|----------|-------------|
237
+ | `state_json` | `string` | Yes | Contents of a `terraform.tfstate` file |
238
+ | `provider` | `aws \| azure \| gcp` | No | Target provider for pricing (auto-detected if omitted) |
239
+ | `currency` | `string` | No | Output currency (default: `USD`) |
240
+
241
+ ### `price_trends`
242
+
243
+ Query historical pricing trends and price change tracking. Shows how pricing has changed over time for specific resource types.
244
+
245
+ | Parameter | Type | Required | Description |
246
+ |-----------|------|----------|-------------|
247
+ | `provider` | `aws \| azure \| gcp` | Yes | Cloud provider |
248
+ | `service` | `string` | Yes | Service category |
249
+ | `resource_type` | `string` | Yes | Instance type, storage type, etc. |
250
+ | `region` | `string` | Yes | Cloud region |
251
+ | `period_days` | `number` | No | Lookback period in days (default: `90`) |
252
+
253
+ ### `detect_anomalies`
254
+
255
+ Cost anomaly detection with budget checks, price changes, concentration risk, and right-sizing hints. Analyzes parsed resources and flags potential cost issues.
256
+
257
+ | Parameter | Type | Required | Description |
258
+ |-----------|------|----------|-------------|
259
+ | `files` | `{path, content}[]` | Yes | IaC files to analyze |
260
+ | `tfvars` | `string` | No | Variable overrides |
261
+ | `provider` | `aws \| azure \| gcp` | No | Target provider (auto-detected if omitted) |
262
+ | `budget_monthly` | `number` | No | Monthly budget cap in USD |
263
+ | `currency` | `string` | No | Output currency (default: `USD`) |
264
+
211
265
  ---
212
266
 
213
267
  ## How Pricing Works
@@ -401,7 +455,7 @@ Configuration priority: environment variables > config file > built-in defaults.
401
455
 
402
456
  | Category | AWS | Azure | GCP |
403
457
  |----------|-----|-------|-----|
404
- | **Compute** | `aws_instance`, `aws_launch_template` | `azurerm_virtual_machine`, `azurerm_linux_virtual_machine` | `google_compute_instance` |
458
+ | **Compute** | `aws_instance` | `azurerm_virtual_machine`, `azurerm_linux_virtual_machine` | `google_compute_instance` |
405
459
  | **Database** | `aws_db_instance`, `aws_rds_cluster` | `azurerm_postgresql_flexible_server`, `azurerm_mysql_flexible_server` | `google_sql_database_instance` |
406
460
  | **Storage** | `aws_ebs_volume`, `aws_s3_bucket` | `azurerm_managed_disk`, `azurerm_storage_account` | `google_compute_disk`, `google_storage_bucket` |
407
461
  | **Network** | `aws_lb`, `aws_nat_gateway` | `azurerm_lb`, `azurerm_nat_gateway` | `google_compute_forwarding_rule` |
@@ -409,6 +463,11 @@ Configuration priority: environment variables > config file > built-in defaults.
409
463
  | **Container Registries** | `aws_ecr_repository` | `azurerm_container_registry` | `google_artifact_registry_repository` |
410
464
  | **Secrets Management** | `aws_secretsmanager_secret` | `azurerm_key_vault` | `google_secret_manager_secret` |
411
465
  | **DNS** | `aws_route53_zone` | `azurerm_dns_zone` | `google_dns_managed_zone` |
466
+ | **API Gateway** | `aws_api_gateway_rest_api`, `aws_apigatewayv2_api` | `azurerm_api_management` | `google_api_gateway_api` |
467
+ | **WAF** | `aws_wafv2_web_acl` | `azurerm_web_application_firewall_policy` | |
468
+ | **OpenSearch** | `aws_opensearch_domain` | | |
469
+ | **Messaging** | `aws_sns_topic`, `aws_mq_broker` | `azurerm_servicebus_namespace`, `azurerm_eventhub_namespace` | `google_pubsub_topic` |
470
+ | **ML/AI** | `aws_sagemaker_endpoint`, `aws_sagemaker_notebook_instance` | | `google_vertex_ai_endpoint` |
412
471
 
413
472
  Instance type mapping covers 70+ AWS instance types (including Graviton/ARM families: m6g, m7g, c6g, c7g, r6g, r7g, t4g), 40+ Azure VM sizes, and 20+ GCP machine types with full bidirectional cross-provider mapping.
414
473
 
@@ -1,72 +1,107 @@
1
1
  {
2
2
  "us-central1": {
3
- "db-custom-1-3840": 0.0500,
4
- "db-custom-2-7680": 0.1000,
5
- "db-custom-4-15360": 0.2000,
3
+ "db-custom-1-3840": 0.0515,
4
+ "db-custom-2-7680": 0.1030,
5
+ "db-custom-4-15360": 0.2060,
6
6
  "storage_per_gb": 0.170,
7
7
  "ha_multiplier": 2.0
8
8
  },
9
9
  "us-east1": {
10
- "db-custom-1-3840": 0.0500,
11
- "db-custom-2-7680": 0.1000,
12
- "db-custom-4-15360": 0.2000,
10
+ "db-custom-1-3840": 0.0515,
11
+ "db-custom-2-7680": 0.1030,
12
+ "db-custom-4-15360": 0.2060,
13
13
  "storage_per_gb": 0.170,
14
14
  "ha_multiplier": 2.0
15
15
  },
16
- "europe-west1": {
17
- "db-custom-1-3840": 0.0550,
18
- "db-custom-2-7680": 0.1100,
19
- "db-custom-4-15360": 0.2200,
20
- "storage_per_gb": 0.187,
16
+ "us-east4": {
17
+ "db-custom-1-3840": 0.0580,
18
+ "db-custom-2-7680": 0.1161,
19
+ "db-custom-4-15360": 0.2322,
20
+ "storage_per_gb": 0.192,
21
21
  "ha_multiplier": 2.0
22
22
  },
23
23
  "us-west1": {
24
- "db-custom-1-3840": 0.0500,
25
- "db-custom-2-7680": 0.1000,
26
- "db-custom-4-15360": 0.2000,
24
+ "db-custom-1-3840": 0.0515,
25
+ "db-custom-2-7680": 0.1030,
26
+ "db-custom-4-15360": 0.2060,
27
27
  "storage_per_gb": 0.170,
28
28
  "ha_multiplier": 2.0
29
29
  },
30
- "asia-northeast1": {
31
- "db-custom-1-3840": 0.0575,
32
- "db-custom-2-7680": 0.1150,
33
- "db-custom-4-15360": 0.2300,
34
- "storage_per_gb": 0.196,
35
- "ha_multiplier": 2.0
36
- },
37
- "asia-south1": {
38
- "db-custom-1-3840": 0.0525,
39
- "db-custom-2-7680": 0.1050,
40
- "db-custom-4-15360": 0.2100,
30
+ "us-west4": {
31
+ "db-custom-1-3840": 0.0541,
32
+ "db-custom-2-7680": 0.1082,
33
+ "db-custom-4-15360": 0.2163,
41
34
  "storage_per_gb": 0.179,
42
35
  "ha_multiplier": 2.0
43
36
  },
44
- "australia-southeast1": {
45
- "db-custom-1-3840": 0.0590,
46
- "db-custom-2-7680": 0.1180,
47
- "db-custom-4-15360": 0.2360,
48
- "storage_per_gb": 0.201,
37
+ "europe-west1": {
38
+ "db-custom-1-3840": 0.0567,
39
+ "db-custom-2-7680": 0.1133,
40
+ "db-custom-4-15360": 0.2266,
41
+ "storage_per_gb": 0.187,
49
42
  "ha_multiplier": 2.0
50
43
  },
51
44
  "europe-west2": {
52
- "db-custom-1-3840": 0.0550,
53
- "db-custom-2-7680": 0.1100,
54
- "db-custom-4-15360": 0.2200,
45
+ "db-custom-1-3840": 0.0567,
46
+ "db-custom-2-7680": 0.1133,
47
+ "db-custom-4-15360": 0.2266,
55
48
  "storage_per_gb": 0.187,
56
49
  "ha_multiplier": 2.0
57
50
  },
51
+ "europe-west3": {
52
+ "db-custom-1-3840": 0.0577,
53
+ "db-custom-2-7680": 0.1154,
54
+ "db-custom-4-15360": 0.2307,
55
+ "storage_per_gb": 0.190,
56
+ "ha_multiplier": 2.0
57
+ },
58
58
  "europe-west4": {
59
- "db-custom-1-3840": 0.0550,
60
- "db-custom-2-7680": 0.1100,
61
- "db-custom-4-15360": 0.2200,
59
+ "db-custom-1-3840": 0.0567,
60
+ "db-custom-2-7680": 0.1133,
61
+ "db-custom-4-15360": 0.2266,
62
62
  "storage_per_gb": 0.187,
63
63
  "ha_multiplier": 2.0
64
64
  },
65
+ "europe-north1": {
66
+ "db-custom-1-3840": 0.0556,
67
+ "db-custom-2-7680": 0.1112,
68
+ "db-custom-4-15360": 0.2225,
69
+ "storage_per_gb": 0.184,
70
+ "ha_multiplier": 2.0
71
+ },
72
+ "asia-northeast1": {
73
+ "db-custom-1-3840": 0.0593,
74
+ "db-custom-2-7680": 0.1185,
75
+ "db-custom-4-15360": 0.2370,
76
+ "storage_per_gb": 0.196,
77
+ "ha_multiplier": 2.0
78
+ },
79
+ "asia-south1": {
80
+ "db-custom-1-3840": 0.0541,
81
+ "db-custom-2-7680": 0.1082,
82
+ "db-custom-4-15360": 0.2163,
83
+ "storage_per_gb": 0.179,
84
+ "ha_multiplier": 2.0
85
+ },
86
+ "australia-southeast1": {
87
+ "db-custom-1-3840": 0.0608,
88
+ "db-custom-2-7680": 0.1216,
89
+ "db-custom-4-15360": 0.2431,
90
+ "storage_per_gb": 0.201,
91
+ "ha_multiplier": 2.0
92
+ },
65
93
  "northamerica-northeast1": {
66
- "db-custom-1-3840": 0.0525,
67
- "db-custom-2-7680": 0.1050,
68
- "db-custom-4-15360": 0.2100,
94
+ "db-custom-1-3840": 0.0541,
95
+ "db-custom-2-7680": 0.1082,
96
+ "db-custom-4-15360": 0.2163,
69
97
  "storage_per_gb": 0.179,
70
98
  "ha_multiplier": 2.0
99
+ },
100
+ "southamerica-east1": {
101
+ "db-custom-1-3840": 0.0659,
102
+ "db-custom-2-7680": 0.1318,
103
+ "db-custom-4-15360": 0.2637,
104
+ "storage_per_gb": 0.218,
105
+ "ha_multiplier": 2.0
71
106
  }
72
107
  }
@@ -1,13 +1,18 @@
1
1
  {
2
2
  "us-central1": { "STANDARD": 0.020, "NEARLINE": 0.010, "COLDLINE": 0.004, "ARCHIVE": 0.0012 },
3
3
  "us-east1": { "STANDARD": 0.020, "NEARLINE": 0.010, "COLDLINE": 0.004, "ARCHIVE": 0.0012 },
4
+ "us-east4": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
5
+ "us-west1": { "STANDARD": 0.020, "NEARLINE": 0.010, "COLDLINE": 0.004, "ARCHIVE": 0.0012 },
6
+ "us-west4": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
4
7
  "europe-west1": { "STANDARD": 0.020, "NEARLINE": 0.010, "COLDLINE": 0.004, "ARCHIVE": 0.0012 },
8
+ "europe-west2": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
9
+ "europe-west3": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
10
+ "europe-west4": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
11
+ "europe-north1": { "STANDARD": 0.020, "NEARLINE": 0.010, "COLDLINE": 0.004, "ARCHIVE": 0.0012 },
5
12
  "asia-southeast1": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
6
- "us-west1": { "STANDARD": 0.020, "NEARLINE": 0.010, "COLDLINE": 0.004, "ARCHIVE": 0.0012 },
7
13
  "asia-northeast1": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
8
- "asia-south1": { "STANDARD": 0.021, "NEARLINE": 0.011, "COLDLINE": 0.005, "ARCHIVE": 0.0013 },
9
- "australia-southeast1": { "STANDARD": 0.024, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
10
- "europe-west2": { "STANDARD": 0.022, "NEARLINE": 0.011, "COLDLINE": 0.005, "ARCHIVE": 0.0013 },
11
- "europe-west4": { "STANDARD": 0.022, "NEARLINE": 0.011, "COLDLINE": 0.005, "ARCHIVE": 0.0013 },
12
- "northamerica-northeast1": { "STANDARD": 0.021, "NEARLINE": 0.011, "COLDLINE": 0.005, "ARCHIVE": 0.0013 }
14
+ "asia-south1": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
15
+ "australia-southeast1": { "STANDARD": 0.023, "NEARLINE": 0.013, "COLDLINE": 0.006, "ARCHIVE": 0.0015 },
16
+ "northamerica-northeast1": { "STANDARD": 0.020, "NEARLINE": 0.010, "COLDLINE": 0.004, "ARCHIVE": 0.0012 },
17
+ "southamerica-east1": { "STANDARD": 0.035, "NEARLINE": 0.020, "COLDLINE": 0.007, "ARCHIVE": 0.0025 }
13
18
  }