Skip to content
Back to search

sample-aws-pricing-calculator-mcp

MCP server for creating, reading, updating AWS Pricing Calculator estimates through natural language.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/aws-samples/sample-aws-pricing-calculator-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/aws-samples/sample-aws-pricing-calculator-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/aws-samples--sample-aws-pricing-calculator-mcp/badge.svg)](/listings/aws-samples--sample-aws-pricing-calculator-mcp)

HTML

<a href="/listings/aws-samples--sample-aws-pricing-calculator-mcp"><img src="/api/listings/aws-samples--sample-aws-pricing-calculator-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Requires [Node.js®](https://nodejs.org/en/download).

Via npx (recommended)

The published package on npm runs without cloning:

{
  "mcpServers": {
    "aws-pricing-calculator-mcp-server": {
      "command": "npx",
      "args": ["-y", "sample-aws-pricing-calculator-mcp@latest"]
    }
  }
}

Add this to your MCP client config (e.g. `~/.kiro/settings/mcp.json`, Claude Desktop's `claude_desktop_config.json`, Cursor's MCP settings, or the VS Code MCP config). The install badges above generate the right config automatically.

From source

git clone https://github.com/aws-samples/sample-aws-pricing-calculator-mcp.git
cd sample-aws-pricing-calculator-mcp
npm install
npm run build

Then point your client at the built bundle:

{
  "mcpServers": {
    "aws-pricing-calculator-mcp-server": {
      "command": "node",
      "args": ["/path/to/sample-aws-pricing-calculator-mcp/dist/mcp-server.js"]
    }
  }
}

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 457 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # AWS Pricing Calculator MCP Server
  2. [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that creates, reads, and updates [AWS Pricing Calculator](https://calculator.aws/#/estimate) estimates through natural language.
  3. [![Install in Kiro](https://img.shields.io/badge/Install-Kiro-9046FF?style=flat-square&logo=kiro)](https://kiro.dev/launch/mcp/add?name=aws-pricing-calculator-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22sample-aws-pricing-calculator-mcp%40latest%22%5D%7D) [![Install in Cursor](https://img.shields.io/badge/Install-Cursor-blue?style=flat-square&logo=cursor)](https://cursor.com/en/install-mcp?name=aws-pricing-calculator-mcp-server&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInNhbXBsZS1hd3MtcHJpY2luZy1jYWxjdWxhdG9yLW1jcEBsYXRlc3QiXX0%3D) [![Install in VS Code](https://img.shields.io/badge/Install-VS_Code-FF9900?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=aws-pricing-calculator-mcp-server&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22sample-aws-pricing-calculator-mcp%40latest%22%5D%7D)
  4. ## Key Features
  5. - **Build estimates from natural language** - agent constructs the estimate via MCP tools; the server saves it to AWS Pricing Calculator and returns a shareable URL.
  6. - **No AWS credentials required** - uses public, unauthenticated calculator.aws CDN endpoints.
  7. - **Live service definitions** - fetches the AWS Pricing Calculator manifest at runtime (~436 services).
  8. - **Verified Configs Catalog** - 21 per-service entries declaring the smallest config that produces a priced estimate, with documented gotchas.
  9. - **Lint refusal before save** - refuses estimates the calculator would render read-only or required-input, with actionable recovery hints.
  10. - **Import existing estimates** - download by URL or ID as JSON (for region swaps, modifications) or Markdown (for LLM analysis).
  11. - **Read computed costs** - `get_estimate_cost` re-shares an estimate through the calculator (Update estimate → Share) so AWS persists the computed costs, then reads them back: upfront, monthly, and 12-month totals, the pricing date, and every per-line cost. Uses an on-demand Playwright/Chromium dependency only needed for this tool.
  12. - **Two transport modes** - stdio (default, for local clients like Claude Desktop, Kiro, Cursor) and optional HTTP (`MCP_TRANSPORT=http`) for hosted deployments.
  13. ## Example
  14. Prompt:
  15. > Create an AWS Pricing Calculator estimate for a common Wordpress environment on AWS (Dev, Quality, Production).
  16. Output:
  17. ![](example1.png)
  18. ## Quick Start
  19. Requires [Node.js®](https://nodejs.org/en/download).
  20. ### Via npx (recommended)
  21. The published package on npm runs without cloning:
  22. ```json
  23. {
  24. "mcpServers": {
  25. "aws-pricing-calculator-mcp-server": {
  26. "command": "npx",
  27. "args": ["-y", "sample-aws-pricing-calculator-mcp@latest"]
  28. }
  29. }
  30. }
  31. ```
  32. Add this to your MCP client config (e.g. `~/.kiro/settings/mcp.json`, Claude Desktop's `claude_desktop_config.json`, Cursor's MCP settings, or the VS Code MCP config). The install badges above generate the right config automatically.
  33. ### From source
  34. ```bash
  35. git clone https://github.com/aws-samples/sample-aws-pricing-calculator-mcp.git
  36. cd sample-aws-pricing-calculator-mcp
  37. npm install
  38. npm run build
  39. ```
  40. Then point your client at the built bundle:
  41. ```json
  42. {
  43. "mcpServers": {
  44. "aws-pricing-calculator-mcp-server": {
  45. "command": "node",
  46. "args": ["/path/to/sample-aws-pricing-calculator-mcp/dist/mcp-server.js"]
  47. }
  48. }
  49. }
  50. ```
  51. ## MCP Tools
  52. | Tool | Description |
  53. |---|---|
  54. | `search_services` | Search AWS services by name or key. Supports comma-separated queries. |
  55. | `get_service_fields` | Get input field IDs, types, labels, valid options, and selector values for one or more services. For curated services, the response includes a `catalog` block (`minimalConfig`, required-field hints, traps). For deprecated parent service codes (currently `amazonS3`), returns a `redirect_to_parent` status with `child_service_codes` listing the actual service codes to use instead. Services with an include/exclude AWS Free Tier template pair (e.g. Lambda) return a `freeTierChoice` block so the caller can ask the user and pass the chosen template as `estimateFor`. |
  56. | `create_estimate` | Create a new empty estimate. Returns an estimate ID. |
  57. | `add_service` | Add one or more services to an estimate. Validates field IDs and values against the live service definition (dropdowns, fileSize unit format, numeric/frequency types, region whitelist). Auto-corrects unambiguous mistakes (case mismatches, typos, number-to-string coercion) and returns a `corrections` array on the per-service result. Partial entries return a `partial: true` warning when required inputs are missing. A per-entry `estimateFor` selects a specific pricing template (e.g. `lambdaWithoutFreeTier` to exclude the AWS Free Tier); Free-Tier-capable services added without a choice return a `free_tier_choice` advisory. |
  58. | `validate_estimate` | Dry-run preflight: builds the would-be saved payload and runs a static check, without calling the save API. Returns `{lint_verdict, next_step, lint_services, would_be_payload}`. Use to confirm an estimate would render correctly before saving. |
  59. | `build_estimate` | One-shot create + add services + lint preflight + save. Returns the shareable URL on success, or a structured envelope identifying which services need field discovery before retry. |
  60. | `export_estimate` | Save the in-flight estimate to calculator.aws and return a shareable URL. Refuses with an actionable `next_step` if the static linter predicts the saved blob would rehydrate read-only. |
  61. | `import_estimate` | Download an existing estimate by URL or ID. Returns JSON (raw) or Markdown. |
  62. | `get_estimate_cost` | Return the AWS-computed cost of a saved estimate (by URL or ID): upfront, monthly, and 12-month totals, the pricing date, and every per-line cost (complete, un-paginated). It re-shares the estimate through the calculator (Update estimate → Share) so AWS persists the costs, then reads them back — this saves a fresh copy under a new id (`priced_estimate_url`; the original is untouched). Requires Playwright and the Chromium browser — an on-demand dependency NOT installed by default; when either is missing the tool returns `cost_available:false` with the exact install commands instead of failing. **Runs only on an explicit user request for the cost — agents should not call it automatically after `export_estimate`/`build_estimate`.** |
  63. | `get_server_info` | Return version and capability information. |
  64. ## Project Structure
  65. ```
  66. mcp-server.js # Entry point — registers the 10 MCP tools, stdio + HTTP transports
  67. lib/
  68. aws/ # AWS API access + payload construction
  69. aws-client.js # Manifest loading, service definitions, save/read APIs, selector aggregations
  70. estimate-builder.js # In-memory estimate model, AWS payload assembly, columnFormIPM remap
  71. ec2.js # EC2 agent-friendly → ec2Enhancement transform
  72. pct-config.js # PCT-based field suggestion
  73. surfaceability.js # PCT-driven surfaceability index
  74. agent-fields.js # Synthetic field surfacing for fields hidden in composite widgets
  75. lint/ # Rehydration prediction + pre-save validation
  76. can-rehydrate.js # Static rehydration linter (pure predicates)
  77. can-rehydrate-fetch.js # Network wrapper around the linter
  78. validation.js # Pre-save config validation (field-id, value-shape, region, auto-correct)
  79. lint-hints.js # Translates lint failures into agent-actionable next_step text
  80. catalog.js # Loader for catalog/services/*.json curated entries
  81. mcp/ # MCP tool plumbing
  82. handler-helpers.js # Shared internals for the MCP tool handlers
  83. tool-descriptions.js # Long agent-facing tool descriptions (separated from wiring)
  84. trace/ # Observability
  85. trace-logger.js # Structured JSON trace events on stderr
  86. trace-events.js # Trace event name registry
  87. request-context.js # Per-request session id propagation
  88. store/ # In-flight estimate persistence
  89. estimate-store.js # Pluggable store (memory default)
  90. estimate-store-dynamodb.js # DynamoDB-backed store for stateless multi-replica deployments
  91. dom-cost.js # Playwright flows: re-share for computed costs (get_estimate_cost) + single-page DOM read (eval oracle). Playwright/Chromium is an on-demand dependency
  92. catalog/
  93. schema.json # JSON Schema for catalog entries
  94. services/ # Verified configs catalog (minimalConfig, traps, subServices)
  95. test/ # node:test suite
  96. eval/ # Scenario-driven behavior eval (87 stdio + LLM scenarios)
  97. scripts/ # Maintainer tools (catalog authoring, sweep, diagnostic)
  98. dist/ # Build output: mcp-server.js bundle, aws-calculator.zip, bundle-contract.json
  99. ```
  100. The `lib/` tree groups modules by layer (aws, lint, mcp, trace, store). The architecture diagram below highlights the load-bearing modules; minor helpers are not shown.
  101. ## Build
  102. ```bash
  103. npm run build
  104. ```
  105. Produces:
  106. - `dist/mcp-server.js` — single-file esbuild bundle (CJS, minified, Node platform)
  107. - `dist/aws-calculator.zip` — the bundle plus catalog files and runtime libs, zipped for hosted deployment
  108. - `dist/bundle-contract.json` — describes the bundle's environment-variable surface (name, type, default, enum values) so downstream consumers can typecheck their CDK/Terraform against the actual surface
  109. ## Tests
  110. Four layers, no overlap:
  111. - **`npm test`** — node:test suite, **hermetic**: 491 pass / 10 skipped, no network, ~1.5s. Per-commit gate, and the only layer that runs in CI. Covers pure functions (validation, lint, surfaceability), payload construction, EC2 transforms, catalog schema.
  112. - **`npm run test:network`** — the same suite with `SKIP_NETWORK` unset, so the 10 skipped tests run. They fetch the live manifest and POST real estimates to the save API, which is why they are not in CI. Run before a release.
  113. - **`npm run validate-catalog:cost`** — sweeps verified catalog entries against the live cost oracle. Catches stale URLs and pricing-engine drift.
  114. - **`python eval/run.py`** — 87 YAML scenarios (scripted MCP calls + LLM-driven). Each does a real save, then asserts on the saved blob (DOM-rendered cost, structural field equality, lint-must-pass). Read `eval/README.md` on interpreting failures — a raw count is not meaningful; use `--compare-baseline`.
  115. `npm test` sets `SKIP_NETWORK=1` itself, so a clean checkout is green offline. The
  116. network-dependent tests declare the gate at their `describe`, following the
  117. convention in `test/author-catalog.test.js`.
  118. ### CI
  119. `.github/workflows/ci.yml` runs two jobs on every push to `main` and every PR:
  120. - **test** — `npm ci && npm test` on Node 22 and 24.
  121. - **dist-freshness** — rebuilds the bundle and requires `dist/mcp-server.js` and
  122. `dist/bundle-contract.json` to be byte-identical to what is committed. `dist/`
  123. is a tracked artifact that consumers install (see `files` in `package.json`),
  124. so a source change with a stale bundle ships nothing. Expect this job to fail
  125. on a dependency bump until you rerun `npm run build` — deps are bundled, so
  126. that is a true positive. `dist/aws-calculator.zip` is not compared, since zip
  127. embeds mtimes.
  128. ## Architecture
  129. ```
  130. ┌─────────────────┐ stdio (default) ┌──────────────────────────────────────┐
  131. │ MCP Client │◄───────────────────►│ MCP Server │
  132. │ (Kiro, Claude, │ JSON-RPC over │ │
  133. │ Cursor, etc.) │ stdin/stdout │ mcp-server.js (entry point) │
  134. │ │ — or, with │ ├── lib/aws/ (client, builder) │
  135. │ │ MCP_TRANSPORT │ ├── lib/lint/ (can-rehydrate, │
  136. │ │ =http, JSON-RPC │ │ validation,catalog)│
  137. │ │ over HTTPS │ ├── lib/mcp/ (handler-helpers) │
  138. └─────────────────┘ │ ├── lib/trace/ (trace-logger) │
  139. │ └── lib/store/ (estimate-store) │
  140. └──────┬─────────┬─────────┬──────────┘
  141. │ │ │
  142. GET │ GET │ POST │
  143. ▼ ▼ ▼
  144. ┌─────────┐ ┌─────────┐ ┌─────────────┐
  145. │ CDN │ │ CDN │ │ Calculator │
  146. │ manifest│ │ saved │ │ Save API │
  147. │ + svc │ │ estimate│ │ │
  148. │ defs │ │ read │ │ POST │
  149. │ │ │ │ │ /v2/saveAs │
  150. │ d1qsj… │ │ d3knq… │ │ dnd5z… │
  151. └─────────┘ └─────────┘ └─────────────┘
  152. ```
  153. - **Default transport is stdio.** The MCP server runs as a local child process spawned by the MCP client; it is not network-accessible by default. Set `MCP_TRANSPORT=http` to expose it on `PORT` (default `8000`, `HOST` default `127.0.0.1`) for hosted deployments — the operator is responsible for placing it behind appropriate authentication and network controls.
  154. - All outbound requests are **HTTPS to public, unauthenticated AWS CloudFront distributions** — the same hosts the calculator.aws website uses. No AWS credentials are required for the default in-memory store. The optional DynamoDB store opens a fourth outbound path to DynamoDB and requires AWS credentials with the IAM permissions noted in [Estimate persistence](#estimate-persistence).
  155. - Estimate data is held **in memory only by default** (lost when the process exits). Switch to `ESTIMATES_STORE=dynamodb` to persist in-flight estimates across replicas.
  156. ## How It Works
  157. ### Service discovery
  158. On first use, the server fetches the AWS Calculator manifest from CloudFront (~436 services with their keys, names, and definition URLs). Service definitions are fetched on demand and cached. The `get_service_fields` tool parses these definitions to extract input field IDs, types, labels, and valid options into a flat, usable format.
  159. ### Estimate building
  160. `EstimateBuilder` holds services and groups in memory (or in DynamoDB if configured). When `add_service` is called, the config is validated against the live service definition and stored using the AWS field IDs. Services can be organized into named groups, and multiple instances of the same service are supported via composite keys (e.g. `aWSLambda:Compute`).
  161. ### EC2 handling
  162. EC2 uses a custom config transform (`lib/aws/ec2.js`) that converts agent-friendly fields (instance type, OS, pricing strategy) into the `ec2Enhancement` format the calculator expects. Supports On-Demand, Savings Plans, Reserved Instances, and Spot pricing.
  163. ### Partition support
  164. The server supports the following AWS partitions:
  165. - `aws` — standard commercial regions
  166. - `aws-iso` — US ISO East/West
  167. - `aws-iso-b` — US ISOB East
  168. - `aws-eusc` (Experimental) AWS European Sovereign Cloud
  169. ### Export to calculator.aws
  170. When `export_estimate` is called, the server:
  171. 1. Resolves each service name against the manifest.
  172. 2. Fetches the service definition to get the correct `version`, `serviceCode`, and template ID.
  173. 3. Maps config keys to `calculationComponents` in the AWS payload format.
  174. 4. Runs the rehydration linter against the would-be saved blob. If it predicts read-only, the call is refused with an actionable recovery hint instead of a URL.
  175. 5. POSTs the payload to the AWS Calculator save API.
  176. 6. Returns the shareable `calculator.aws` URL.
  177. AWS recalculates the actual costs when someone opens the link.
  178. ### Reading computed costs
  179. `get_estimate_cost` returns AWS's computed cost for a saved estimate (by URL or ID). Because the calculator prices in the browser, the tool re-shares the estimate through the UI — it presses **Update estimate** (recompute to current pricing) then **Share**, which makes AWS persist the costs — and then reads the resulting saved estimate via the public read API. The response carries `upfront_cost`, `monthly_cost`, `total_12_months_cost` (derived as upfront + 12×monthly, which is how the calculator defines the 12-month total), `pricing_as_of`, and `rows` — every group/line with its own monthly, upfront, and config. There is no pagination, so `rows_complete` is always true.
  180. Because it carries an optional, heavyweight dependency (Playwright + Chromium, not installed by default), `get_estimate_cost` is meant to run **only when the user explicitly asks for the computed cost**. Agents should not invoke it automatically after `export_estimate` or `build_estimate` — those already return the shareable URL, which is the normal end of the flow.
  181. Because Update+Share re-saves, the tool creates a **fresh copy under a new id** (returned as `priced_estimate_url`); the original estimate is unchanged. This avoids two dead ends we ruled out: scraping the rendered table (it paginates at 10 rows) and the Export→file download (which does not fire in headless Chromium).
  182. This is the only part of the server that needs a browser. **Playwright and the Chromium binary are an on-demand dependency, not installed by default.** The tool checks for them first and, when either is missing, returns `cost_available:false` with the exact install commands rather than failing:
  183. ```bash
  184. npm install playwright # if the library itself is missing
  185. npx playwright install chromium # downloads the ~150MB browser binary
  186. npx playwright install-deps chromium # installs system dependencies
  187. ```
  188. Every other tool works without Playwright.
  189. ## Environment Variables
  190. All optional. The full set is also documented machine-readably in `dist/bundle-contract.json` after build.
  191. | Variable | Default | Purpose |
  192. |---|---|---|
  193. | `AWS_SAVE_URL` | CloudFront save URL | Override the AWS Calculator save endpoint (testing only). |
  194. | `MCP_TRANSPORT` | `stdio` | `stdio` or `http`. HTTP listens on `PORT` (default `8000`) bound to `HOST` (default `127.0.0.1`). |
  195. | `ESTIMATES_STORE` | `memory` | In-flight estimate store. See [Estimate persistence](#estimate-persistence). |
  196. | `ESTIMATES_TABLE` | — | DynamoDB table name. Required when `ESTIMATES_STORE=dynamodb`. |
  197. | `ESTIMATES_TTL_SECONDS` | `0` | TTL for DynamoDB-stored estimates in seconds. `0` = no TTL. |
  198. | `TRACE` | `off` | Set to `on` (or `1`/`true`/`yes`) to enable structured stderr trace events. See [Trace events](#trace-events). |
  199. | `TRACE_RESULT_TEXT_MAX` | `500` | Cap on `resultText` length when tracing is enabled. |
  200. ## Estimate persistence
  201. The MCP server keeps in-flight estimates (between `create_estimate` and `export_estimate`) in a pluggable store. Configure with `ESTIMATES_STORE`:
  202. | Value | Description |
  203. | --- | --- |
  204. | `memory` (default) | In-process `Map`. State is lost when the process exits. Suitable for stdio and single-process deployments. |
  205. | `dynamodb` | Persists snapshots in a DynamoDB table. Required for any deployment where `create_estimate` and `add_service` may run in different processes (multi-replica HTTP, Lambda, container runtimes with non-sticky session routing). |
  206. ### `dynamodb` configuration
  207. The AWS SDK packages are NOT bundled with the published artifact (they are declared as optional peer dependencies). Before running with `ESTIMATES_STORE=dynamodb`, install them in your deployment image:
  208. ```bash
  209. npm install @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb
  210. ```
  211. Required env vars when `ESTIMATES_STORE=dynamodb`:
  212. | Variable | Required | Description |
  213. | --- | --- | --- |
  214. | `ESTIMATES_TABLE` | Yes | DynamoDB table name. |
  215. | `AWS_REGION` | Yes | AWS region for the DynamoDB client. |
  216. | `ESTIMATES_TTL_SECONDS` | No | If set, items are written with an `expiresAt` attribute equal to `now + ESTIMATES_TTL_SECONDS`. Pair this with a TTL configuration on the table (TTL attribute name: `expiresAt`) to expire abandoned estimates automatically. |
  217. ### Table schema
  218. ```
  219. TableName: <ESTIMATES_TABLE>
  220. PartitionKey: id (String)
  221. Attributes:
  222. id (String) the estimate's UUID
  223. snapshot (String) JSON-encoded snapshot of the estimate
  224. expiresAt (Number) optional epoch seconds, populated when ESTIMATES_TTL_SECONDS is set
  225. TTL attribute: expiresAt (configure on the table if you set ESTIMATES_TTL_SECONDS)
  226. ```
  227. The IAM role running the server needs `dynamodb:GetItem`, `dynamodb:PutItem`, and `dynamodb:DeleteItem` on the table.
  228. ### Implementation notes
  229. - Each estimate is stored as a single JSON string under one item. Estimates that approach DynamoDB's 400 KB per-item cap (hundreds of services) will fail to write — use S3 or chunk-encoding if you need that.
  230. - The store is constructed once at process start. Switching backends requires restarting the process.
  231. ## Verified Configs Catalog
  232. The catalog (`catalog/services/*.json`) is a set of curated per-service entries. Each entry declares:
  233. - `minimalConfig` — the smallest config that produces a priced editable estimate
  234. - `required[]` — pricing-engine-required fields (often broader than the manifest's `validations.required: true`)
  235. - `optional[]` — documented hints with examples
  236. - `traps[]` — free-text gotchas the manifest can't express (e.g. "Step Functions' frequency unit MUST be `perMonth`, not `millionPerMonth`")
  237. - `subServices[]` — child routing for sub-service-selector parents (e.g. S3 storage classes, Bedrock models)
  238. `get_service_fields` returns this metadata in a `catalog` block when an entry exists, so the agent doesn't have to guess.
  239. ### Coverage
  240. | Status | Count | Meaning |
  241. |---|---|---|
  242. | `verified` | 18 | Reverified end-to-end: a fresh save from `minimalConfig` renders non-zero cost in calculator.aws |
  243. | `partial` | 1 | Authored but not fully verified |
  244. | **Total entries** | **17** | Out of ~436 services in the manifest |
  245. The verified entries cover the highest-impact services from production usage analysis: Lambda, RDS PostgreSQL, ALB, Fargate, EC2, NAT Gateway, Transit Gateway, CloudTrail, Direct Connect, Cognito, S3 (storage classes), SNS, SageMaker, Bedrock, AppSync, and Step Functions.
  246. ### Why not catalog every service
  247. Catalog entries are work to author and maintain. They earn their place when the manifest underdeclares what the pricing engine actually needs (the silent-$0 trap class). For services where the manifest is sufficient, no entry is needed — the agent reads the manifest, sends fields, the calculator prices them.
  248. `scripts/diagnose-service.js` runs the falsifiable test: probe each un-cataloged service and classify it. Useful when scoping new catalog work.
  249. ### Validating the catalog
  250. ```bash
  251. npm run validate-catalog # JSON Schema check (runs in npm test)
  252. npm run validate-catalog:cost # Sweeps verified entries against the live cost oracle
  253. ```
  254. The cost-oracle sweep saves a fresh estimate from each verified entry's `minimalConfig` and confirms it renders ≥$0.01/mo via the DOM oracle (`lib/dom-cost.js`). Run on a cadence (manual / cron / pre-deploy) to catch stale URLs and pricing-engine drift.
  255. ### Catalog quality
  256. The catalog content was audited along three independent axes before release.
  257. **Cost-rendering correctness (deterministic).** The `validate-catalog:cost` sweep saves each of the verified entries' `minimalConfig` and confirms a non-zero rendered cost via the DOM oracle. Result: **entries render priced cost** (e.g. Lambda $699.80/mo, RDS PostgreSQL $175.75/mo, EC2 $70.08/mo).
  258. **Trap content audit (manifest cross-check + LLM cold-eye).** Each `traps[]` claim was checked against the live manifest data and, where applicable, the saved blob of the corresponding `verifiedEstimateId`. Result across the 60 shipped traps: **0 hallucinated claims**. Every trap was then classified by the type of utility it provides to a runtime agent — falling roughly into:
  259. - **Prevents save-failure** — without the trap, the agent's save fails (lint refusal, value validation, sub-service-selector rejected). The largest category.
  260. - **Prevents silent-zero** — save+lint pass but cost renders $0 without the trap. The catalog's most distinctive value class.
  261. - **Steers selection** — empirically demonstrated by a probe scenario, manifest-derived (mechanism visible to `get_service_fields`), or a well-known AWS pricing fact (Multi-AZ doubles cost, etc.).
  262. 5 traps that classified as "author-only" or "unverifiable prose" were removed before release rather than shipped to agents.
  263. **Agent-success measurement (empirical, paired drift audits).** The `eval/scenarios/cat-<svc>-with.yaml` / `cat-<svc>-without.yaml` pairs run the same prompt twice — once with the catalog active, once with it removed — and compare outcomes. As of the 1.2.0 eval run with Bedrock Haiku 4.5: **6 services demonstrate measurably better agent success with the catalog** (ALB, CloudTrail, Direct Connect, EC2, Fargate, Transit Gateway — `with` passes, `without` fails). 2 are redundant (manifest alone is sufficient: AppSync, NAT). 8 produce mixed results that depend on agent prompt-following behavior; for those services the catalog still provides correct content (verified by the cost sweep above) but the marginal effect on a specific LLM run isn't deterministic.
  264. The trap audit and earns-place data are summarized here for transparency; the deterministic cost sweep is the load-bearing correctness gate.
  265. ## Known Issues
  266. - The CloudFront save/manifest APIs are undocumented and may change without notice.
  267. - Callers must use the correct AWS field IDs — discover them via `get_service_fields`.
  268. - The server discovers applicable selector values but cannot resolve cross-field dependencies (e.g. EC2 Instance Types ↔ License).
  269. - With the default `memory` store, in-flight estimates don't persist across restarts. Use `ESTIMATES_STORE=dynamodb` for stateless or multi-replica deployments.
  270. - No local cost calculation — pricing is computed by AWS. View the shareable link (press **Update estimate** in the calculator UI to reflect the latest pricing), or call `get_estimate_cost` to read the computed cost programmatically (requires the on-demand Playwright/Chromium dependency).
  271. - Catalog coverage is partial (verified entries against ~436 manifest services). Uncatalogued services still benefit from the lint and trace events; they just don't get the magnitude-calibration role the catalog plays.
  272. ## Security
  273. This is sample code intended for educational purposes. You should work with your security and legal teams to meet your organizational security, regulatory, and compliance requirements before deployment.
  274. ### Security model
  275. This MCP server is a **local tool provider** — by default it runs as a child process of an MCP client over stdio and is not network-accessible. It has no authentication or authorization layer; access control is the responsibility of the MCP client that spawns it. When `MCP_TRANSPORT=http` is enabled, the operator is responsible for placing the server behind appropriate authentication and network controls.
  276. The server does not handle AWS credentials (in the default `memory` mode), customer data, or PII. It processes only pricing configuration parameters (region, instance type, request counts) provided by the MCP client. The DynamoDB store does require AWS credentials with the listed IAM permissions; the server itself never reads or stores the calling user's AWS account data.
  277. The save and manifest endpoints are the same public, unauthenticated CloudFront distributions used by the [calculator.aws](https://calculator.aws) website.
  278. ### Input validation and sanitization
  279. - All MCP tool inputs are validated using [Zod](https://zod.dev/) schemas before processing.
  280. - User-provided descriptions and group names are sanitized to remove `<`, `>`, and `&` characters before inclusion in API payloads, preventing HTML/XML injection in the calculator frontend.
  281. - Service configuration keys and values are validated against the live service definition (typo detection via Levenshtein distance, dropdown options against enums, fileSize unit format, region whitelist) before payload construction.
  282. ### Data handling
  283. - Estimate data is held **in memory only by default** for the lifetime of the process. With `ESTIMATES_STORE=dynamodb`, estimates are persisted to a customer-owned DynamoDB table (the operator owns the data lifecycle).
  284. - The data consists of pricing configuration (region codes, service parameters, instance types) — not secrets, credentials, or personally identifiable information.
  285. - Shareable URLs generated by export contain only an opaque estimate ID. The estimate content is stored by AWS, not by this server.
  286. ### Reporting security issues
  287. See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for information on reporting security issues.
  288. ## Trace events
  289. When tracing is enabled (`TRACE=on`), the server emits structured JSON lines on stderr, one per event, for every tool call and save operation. Hosted deployments typically capture these via the runtime's log pipeline; in stdio mode they appear on the process stderr directly.
  290. **Tracing is off by default.** Set `TRACE=on` (or `1`/`true`/`yes`) to enable. The default keeps stderr quiet for local CLI use.
  291. Each line carries `ts` (ISO timestamp), `event` (one of the names below), and an `mcpSessionId` field when the call was made over HTTP transport.
  292. | Event | Payload fields | When emitted |
  293. |---|---|---|
  294. | `tool.call` | `name`, `args`, `mcpSessionId?` | Tool handler entry |
  295. | `tool.result` | `name`, `isError`, `resultText` (≤500 chars), `resultLength` (pre-truncation), `durationMs`, `mcpSessionId?` | Tool handler exit (success or error) |
  296. | `lint` | `verdict`, `services`, `estimateId?`, `mcpSessionId?` | After the rehydration linter runs in `export_estimate` / `build_estimate` |
  297. | `save.send` | `bytes`, `groupCount`, `serviceCount`, `estimateId?`, `mcpSessionId?` | Before POST to AWS save API |
  298. | `save.ok` | `savedKey`, `estimateId?`, `mcpSessionId?` | Save API returned 200 |
  299. | `save.fail` | `status`, `body` (≤500 chars), `estimateId?`, `mcpSessionId?` | Save API returned non-200 |
  300. | `session.start` | `mcpSessionId?` | New MCP session opened (HTTP transport) |
  301. `tool.call` and `tool.result` are paired — sort by `ts` to reconstruct the sequence. `save.*` events sit between them on `export_estimate` / `build_estimate` calls.
  302. `resultText` is truncated to keep log volume bounded; `resultLength` is the original (pre-truncation) length. Set `TRACE_RESULT_TEXT_MAX=<N>` to raise the cap when investigating a clipped response.
  303. ### Customer-text redaction
  304. Trace events are typically captured to log groups that may be queryable by anyone with read access. To keep agent-supplied free text out of those logs, the trace logger redacts values at known-sensitive keys before emit:
  305. - `name` — estimate names from `create_estimate` / `build_estimate`
  306. - `description` — per-service free-text labels from `add_service` / `build_estimate` / `import_estimate`
  307. Both fields are replaced with `[redacted: <N> chars]` in `tool.call` args and `tool.result` resultText. Structure is preserved (you still see "the agent set a description") but the content isn't. `resultLength` reflects the original pre-redaction length. Non-sensitive fields — service codes, region IDs, field IDs, numeric values, UUIDs — pass through untouched.
  308. To extend redaction for a new sensitive field, add the key to `SENSITIVE_KEYS` in `lib/trace/trace-logger.js`. The redactor walks nested structures recursively, including the JSON-stringified `services` arg of `add_service` / `build_estimate`.
  309. The `mcpSessionId` field has three states, useful for telling transports apart:
  310. - HTTP request with an `mcp-session-id` header → `"mcpSessionId": "<uuid>"`
  311. - HTTP request without the header → `"mcpSessionId": null`
  312. - Stdio transport → field omitted entirely
  313. ## AWS MCP Servers Comparison: Pricing & Cost Management
  314. | | **AWS Pricing Calculator MCP (This)** | **[AWS Billing & Cost Management MCP](https://github.com/awslabs/mcp#-cost--operations)** | **[AWS Pricing MCP](https://github.com/awslabs/mcp#-cost--operations)** |
  315. |---|---|---|---|
  316. | **Purpose** | Build shareable cost estimates for new workloads | Analyze historical spend & optimize existing costs | Query real-time pricing data from Price List API |
  317. | **Data Source** | AWS Pricing Calculator (calculator.aws) | Cost Explorer, Cost Optimization Hub, Compute Optimizer, Savings Plans, Budgets, Storage Lens | AWS Price List Bulk API |
  318. | **Output** | Shareable calculator.aws URL with full estimate | Natural language cost insights, savings recommendations | Raw pricing data, cost reports (markdown/CSV) |
  319. | **Use Case** | "What will this new architecture cost?" | "Where am I overspending today?" | "What's the per-unit price of X?" |
  320. | **Scope** | Forward-looking estimates | Historical & current spend | Current catalog pricing |
  321. | **AWS Credentials** | Not required (uses public calculator API) | Required (reads your billing data) | Required (`pricing:*` permissions) |
  322. TL;DR: Use the Pricing Calculator MCP to build estimates for proposals, the Billing & Cost Management MCP to analyze and optimize existing spend, and the Pricing MCP for granular unit-price lookups and IaC cost analysis.
  323. ## Changelog
  324. See [CHANGELOG.md](CHANGELOG.md) for the full release history.
  325. ## License
  326. This library is licensed under the MIT-0 License. See the [LICENSE](LICENSE) file.
  327. ## Disclaimer
  328. Before using an MCP Server, you should consider conducting your own independent assessment to ensure that your use would comply with your own specific security and quality control practices and standards, as well as the laws, rules, and regulations that govern you and your content.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.