@jadenrazo/cloudcost-mcp 1.2.0 → 1.2.2
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/CHANGELOG.md +165 -0
- package/README.md +24 -12
- package/data/aws-pricing/metadata.json +22 -2
- package/data/azure-pricing/metadata.json +297 -2
- package/data/gcp-pricing/cloud-storage.json +222 -16
- package/data/gcp-pricing/compute-engine.json +2051 -253
- package/data/gcp-pricing/metadata.json +19 -5
- package/data/gcp-pricing/persistent-disk.json +222 -16
- package/dist/{chunk-CGMU4ETN.js → chunk-4P3I7BSL.js} +73 -664
- package/dist/{chunk-LWTVE7UY.js → chunk-R2BI5AVN.js} +13 -7
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +2 -3
- package/dist/index.js +2 -2
- package/dist/{loader-CMBV7346.js → loader-G7WW74B6.js} +2 -2
- package/package.json +12 -10
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
import { readFileSync } from "fs";
|
|
5
5
|
import { join, dirname } from "path";
|
|
6
6
|
import { fileURLToPath } from "url";
|
|
7
|
+
|
|
8
|
+
// src/data/freshness.ts
|
|
9
|
+
var FRESH_MAX_AGE_DAYS = 14;
|
|
10
|
+
var AGING_MAX_AGE_DAYS = 45;
|
|
11
|
+
var MS_PER_DAY = 864e5;
|
|
12
|
+
|
|
13
|
+
// src/data/loader.ts
|
|
7
14
|
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
15
|
function findProjectRoot(startDir) {
|
|
9
16
|
let dir = startDir;
|
|
@@ -132,22 +139,21 @@ function getFallbackMetadata(provider) {
|
|
|
132
139
|
}
|
|
133
140
|
return _fallbackMeta[provider];
|
|
134
141
|
}
|
|
135
|
-
var FRESH_MAX_AGE_DAYS = 14;
|
|
136
|
-
var AGING_MAX_AGE_DAYS = 45;
|
|
137
|
-
var MS_PER_DAY = 864e5;
|
|
138
142
|
function getPricingMetadata(provider, now = /* @__PURE__ */ new Date()) {
|
|
139
143
|
const meta = getFallbackMetadata(provider);
|
|
140
144
|
const source = meta?.source ?? "unknown";
|
|
141
145
|
if (!meta?.last_updated) {
|
|
142
146
|
return { source, as_of: null, age_days: null, staleness: "stale" };
|
|
143
147
|
}
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
148
|
+
const candidates = [meta.last_updated, meta.last_verified].filter((d) => typeof d === "string").map((d) => ({ raw: d, at: new Date(d) })).filter((d) => !Number.isNaN(d.at.getTime()));
|
|
149
|
+
if (candidates.length === 0) {
|
|
146
150
|
return { source, as_of: meta.last_updated, age_days: null, staleness: "stale" };
|
|
147
151
|
}
|
|
152
|
+
const oldest = candidates.reduce((a, b) => a.at.getTime() <= b.at.getTime() ? a : b);
|
|
153
|
+
const asOf = oldest.at;
|
|
148
154
|
const ageDays = Math.max(0, Math.floor((now.getTime() - asOf.getTime()) / MS_PER_DAY));
|
|
149
155
|
const staleness = ageDays < FRESH_MAX_AGE_DAYS ? "fresh" : ageDays < AGING_MAX_AGE_DAYS ? "aging" : "stale";
|
|
150
|
-
return { source, as_of:
|
|
156
|
+
return { source, as_of: oldest.raw, age_days: ageDays, staleness };
|
|
151
157
|
}
|
|
152
158
|
function _resetLoaderCache() {
|
|
153
159
|
_resourceEquivalents = null;
|
|
@@ -181,4 +187,4 @@ export {
|
|
|
181
187
|
getPricingMetadata,
|
|
182
188
|
_resetLoaderCache
|
|
183
189
|
};
|
|
184
|
-
//# sourceMappingURL=chunk-
|
|
190
|
+
//# sourceMappingURL=chunk-R2BI5AVN.js.map
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
/**
|
|
3
2
|
* CloudCost MCP CLI
|
|
4
3
|
*
|
|
4
|
+
* NOTE: do not add a `#!/usr/bin/env node` line here. tsup injects one into
|
|
5
|
+
* every bundle via `banner.js` in tsup.config.ts; a second copy in this source
|
|
6
|
+
* file lands on line 2 of dist/cli.js, where Node does not strip it, and the
|
|
7
|
+
* binary dies with `SyntaxError: Invalid or unexpected token`.
|
|
8
|
+
*
|
|
5
9
|
* Standalone command-line interface for the CloudCost MCP server tools.
|
|
6
10
|
*
|
|
7
11
|
* Usage:
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
#!/usr/bin/env node
|
|
3
2
|
import {
|
|
4
3
|
PricingCache,
|
|
5
4
|
PricingEngine,
|
|
@@ -10,8 +9,8 @@ import {
|
|
|
10
9
|
loadConfig,
|
|
11
10
|
optimizeCost,
|
|
12
11
|
whatIf
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-4P3I7BSL.js";
|
|
13
|
+
import "./chunk-R2BI5AVN.js";
|
|
15
14
|
|
|
16
15
|
// src/cli.ts
|
|
17
16
|
import { readFileSync, existsSync, statSync, realpathSync } from "fs";
|
package/dist/index.js
CHANGED
|
@@ -36,12 +36,12 @@ import {
|
|
|
36
36
|
tfvarsField,
|
|
37
37
|
whatIf,
|
|
38
38
|
whatIfSchema
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-4P3I7BSL.js";
|
|
40
40
|
import {
|
|
41
41
|
getFallbackMetadata,
|
|
42
42
|
getPricingMetadata,
|
|
43
43
|
getResourceEquivalents
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-R2BI5AVN.js";
|
|
45
45
|
|
|
46
46
|
// src/server.ts
|
|
47
47
|
import { createRequire } from "module";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
getRegionPriceMultipliers,
|
|
16
16
|
getResourceEquivalents,
|
|
17
17
|
getStorageMap
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-R2BI5AVN.js";
|
|
19
19
|
export {
|
|
20
20
|
_resetLoaderCache,
|
|
21
21
|
getAwsInstances,
|
|
@@ -33,4 +33,4 @@ export {
|
|
|
33
33
|
getResourceEquivalents,
|
|
34
34
|
getStorageMap
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=loader-
|
|
36
|
+
//# sourceMappingURL=loader-G7WW74B6.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jadenrazo/cloudcost-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "MCP server for multi-cloud cost analysis of Terraform, CloudFormation, Pulumi, and Bicep/ARM codebases",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"what-if"
|
|
33
33
|
],
|
|
34
34
|
"engines": {
|
|
35
|
-
"node": ">=
|
|
35
|
+
"node": ">=20.20.2"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|
|
@@ -70,21 +70,23 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@cdktf/hcl2json": "^0.21.0",
|
|
73
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
73
|
+
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
74
74
|
"better-sqlite3": "^12.10.0",
|
|
75
75
|
"yaml": "^2.9.0",
|
|
76
76
|
"zod": "^4.4.3"
|
|
77
77
|
},
|
|
78
78
|
"overrides": {
|
|
79
|
-
"hono": "^4.13.
|
|
79
|
+
"hono": "^4.13.5",
|
|
80
80
|
"@hono/node-server": "^2.0.0",
|
|
81
81
|
"path-to-regexp": "^8.4.2",
|
|
82
82
|
"vite": "^8.0.0",
|
|
83
|
-
"fast-uri": "^3.1.
|
|
84
|
-
"ip-address": "^10.
|
|
85
|
-
"qs": "^6.
|
|
83
|
+
"fast-uri": "^3.1.8",
|
|
84
|
+
"ip-address": "^10.7.1",
|
|
85
|
+
"qs": "^6.16.0",
|
|
86
86
|
"body-parser": "^2.3.0",
|
|
87
|
-
"brace-expansion": "^5.0.
|
|
87
|
+
"brace-expansion": "^5.0.12",
|
|
88
|
+
"esbuild": "^0.28.1",
|
|
89
|
+
"nanoid": "^3.3.18"
|
|
88
90
|
},
|
|
89
91
|
"prettier": {
|
|
90
92
|
"semi": true,
|
|
@@ -97,7 +99,7 @@
|
|
|
97
99
|
"@eslint/js": "^10.0.1",
|
|
98
100
|
"@types/better-sqlite3": "^7.6.13",
|
|
99
101
|
"@types/node": "^24.12.4",
|
|
100
|
-
"@vitest/coverage-v8": "^4.1.
|
|
102
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
101
103
|
"eslint": "^10.4.0",
|
|
102
104
|
"eslint-config-prettier": "^10.1.8",
|
|
103
105
|
"prettier": "^3.8.3",
|
|
@@ -105,6 +107,6 @@
|
|
|
105
107
|
"tsx": "^4.22.0",
|
|
106
108
|
"typescript": "^6.0.3",
|
|
107
109
|
"typescript-eslint": "^8.59.3",
|
|
108
|
-
"vitest": "^4.1.
|
|
110
|
+
"vitest": "^4.1.11"
|
|
109
111
|
}
|
|
110
112
|
}
|