
Cloudcostsmcp
io.github.x7even由 GitHub 账号 x7even 发布v1.0.2更新于 Oct 28, 2026
Anchor AI FinOps to real, live cloud pricing — AWS, GCP & Azure public and enterprise rates.
概览
让 AI 助手获取 AWS、GCP 和 Azure 的实时云定价,用于查询价格、跨云比较工作负载并估算单位成本。
- 可以做什么
- 查询并批量比较 AWS、GCP、Azure 的计算、存储、数据库、无服务器与 AI 模型服务价格,含承诺折扣档位
- 估算物料清单成本、跨三家云比较同一工作负载,并计算每用户或每请求成本
- 发现可用区域与实例类型,并跨区域并发查询最便宜的选项
- 汇总折扣与承诺数据,并刷新或查看本地价格缓存
- 适用场景
- 适合需要助手用当前真实价格而非训练数据猜测来回答云成本问题的场景:跨云工作负载对比、寻找最便宜区域、按需与承诺价格分析,以及为产品或迁移方案计算单位经济性。
- 运行要求
- 以本地 stdio 进程运行,可从 opencloudcosts 的 PyPI 包安装(内含原生二进制),也可用 Homebrew、发布二进制、Docker 或 Go 构建。AWS 与 Azure 公开定价无需凭据;GCP 定价需在 OCC_GCP_API_KEY 中配置免费 API 密钥。AWS 实际折扣价需 AWS_ACCESS_KEY_ID、AWS_SECRET_ACCESS_KEY 并设置 OCC_AWS_ENABLE_COST_EXPLORER=true;GCP 合同价需 ADC 凭据与 OCC_GCP_BILLING_ACCOUNT_ID。需要访问各云厂商定价 API 的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Cloudcostsmcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
OpenCloudCosts MCP
Anchor AI FinOps to real, live cloud pricing.
[License: MIT] [PyPI version] [Release]
Your LLM's cloud pricing knowledge was frozen at training cutoff. Cloud pricing wasn't.
opencloudcosts is an MCP server that gives your AI assistant live, structured access to AWS, GCP, and Azure pricing — 16 tools it can call directly, with results it can reason over rather than guess at. Ask it to compare a full multi-resource workload across all three clouds simultaneously. Ask it for your actual post-discount effective rates from Reserved Instances, Savings Plans, or Enterprise Discount Programs. Ask it to fan out across every region and return the cheapest option. None of that is possible from training data alone, and none of it is possible from a single-cloud pricing calculator.
The Problem
Ask any AI assistant what an m5.2xlarge costs in ap-southeast-2, whether AWS or GCP is cheaper for a three-tier web app, or what your effective hourly rate is after Savings Plans. You will get a confident answer. It will probably be wrong.
Cloud pricing is a poor fit for static model weights: instance families are added and retired, regional pricing diverges (the same instance type can differ 20–40% across regions), spot markets fluctuate, and commitment discounts are by definition unique to each account. A model answering from training data cannot know your negotiated EDP rate. It can barely reliably recall last year's list price. The problem is not that LLMs are bad — it's that real-time, account-specific pricing data is structurally outside what a model can know.
opencloudcosts fixes this by giving your AI assistant 16 MCP tools backed by live provider APIs. Instead of hallucinating numbers, the model calls a tool and gets a precise answer.
A Concrete Scenario
Your team asks: "We're evaluating whether to migrate this workload from AWS to GCP. What does the full stack cost on-demand vs. three-year committed, across all three clouds, so I can make the case to leadership?"
Without this tool, the model interpolates — possibly from pricing that is a year out of date — across three providers, multiple resource types, and at least four pricing tiers. The numbers will be plausible and wrong.
With opencloudcosts, the model calls compare_bom with the workload spec (compute + storage + database). The tool fans out 8 concurrent provider calls across AWS, GCP, and Azure simultaneously, prices each resource category at public and committed rates, and returns a per-provider, per-term breakdown with savings analysis — in a single tool call.
No spreadsheet. No switching between three provider calculators. No manual SKU matching. No training-data approximation.
Why Not the Obvious Alternatives
Asking a model without tools — Training data has a cutoff. Cloud pricing changes constantly, varies 20–40% across regions for the same instance type, and includes account-level commitment discounts that are invisible at inference time. The model will approximate, confabulate, or recall stale numbers. There is no structured output, and the model cannot access your contracted rates under any circumstances.
Cloud pricing calculators (AWS / GCP / Azure) — Each covers exactly one cloud. They are UI-only with no API surface callable from an AI assistant. Cross-cloud comparison requires manually reproducing the same architecture three times across three separate calculators and reconciling exports by hand. They have no concept of unit economics and produce no programmatic output for agentic workflows.
Infracost — Excellent at estimating cost diffs against Terraform plans. It requires IaC files as input — it cannot answer "what does an n2-standard-8 cost in europe-west4?" without a Terraform plan in hand. It is not an MCP server and is not callable from a conversational AI context.
Calling provider APIs directly — AWS bulk pricing files are multi-GB and require targeted API access patterns to avoid downloading them in full. GCP's Cloud Billing Pricing API v1beta requires a multi-source ADC credential chain and provider-specific IAM. Azure's Retail Prices API needs pagination logic and SKU matching. Every provider uses different region naming conventions, SKU formats, and data schemas. opencloudcosts normalizes all of this behind a uniform MCP tool interface and handles credential chains, caching, and retry logic so the model does not have to.
Capabilities at a Glance
Coverage: Three Clouds, 16 Tools
Fourteen tools are fully functional. Two entries are compatibility stubs: search_pricing (a deprecated redirect from v0.8.x, kept for backward compatibility) and get_spot_history (registered but not implemented in the Go server — returns a structured "not available" response).
Credential requirements by provider
Azure Reserved VM pricing (1-year and 3-year terms) is available via the public Retail Prices API — no credentials needed. compare_bom returns committed-term Azure pricing with no setup beyond the binary.
The 16 tools by category
† Compatibility stub only — not functional for live data. See opencloudcosts-go/README.md for full parameter reference.
Performance and Reliability
Concurrency — The analysis tools are not sequential HTTP wrappers:
find_cheapest_regionandfind_available_regions: errgroup + semaphore, up to 32 goroutines — queries all available regions in parallel, returns results sorted cheapest-firstcompare_bom: 8 concurrent provider calls across AWS, GCP, and Azure simultaneouslycompare_prices: semaphore of 10 concurrent region callsget_prices_batch: parallelized across instance types within a region
Rate limiting and timeouts — Token-bucket rate limiter at 200 req/s on the HTTP transport (OCC_RATE_LIMIT). Per-request deadline: 60s (OCC_REQUEST_TIMEOUT). Per-provider API call: 30s (OCC_PROVIDER_TIMEOUT). Graceful SIGTERM drain: 15s (OCC_SHUTDOWN_TIMEOUT).
Cache — Prices are stored in a concurrent in-memory cache (read-optimised with sync.RWMutex) with atomic JSON persistence at ~/.cache/opencloudcosts/cache.json. TTLs: public prices 24h (OCC_CACHE_TTL_HOURS), region/instance metadata 7 days (OCC_METADATA_TTL_DAYS), effective/contracted rates 1h (OCC_EFFECTIVE_PRICE_TTL_HOURS). Cache survives binary updates. 401/403 responses from billing APIs are never cached, so credential rotation takes effect immediately.
AWS pricing — EC2/EBS/RDS public pricing uses a targeted SKU API path rather than downloading the full multi-GB bulk pricing file, keeping startup fast and avoiding large network payloads.
Error isolation — Raw exception text never reaches LLM context. All tool boundaries emit structured error envelopes; full tracebacks are logged server-side only. GCP contract pricing falls back to public list prices on auth failure rather than surfacing an error into the conversation.
Validated: 234/234
opencloudcosts v1.0.0 achieves 234/234 (100%) on the LLM grounding harness, with zero XML hallucinations across the full suite.
The harness covers 234 realistic pricing questions across all three clouds: instance spot checks, cross-region comparisons, BOM estimates, multi-cloud comparisons, unit economics, AI model pricing, database pricing, storage pricing, discount summaries, egress pricing, availability queries, and network pricing.
Primary validation model: qwen3.6-35b-128k running locally via llama-swap — a self-hosted 35B reasoning model with no external API dependency. The harness has also been exercised against qwen3.6-35b-a3b, qwen3.5-122b-a10b@q6_k, and gemma-4-26b-a4b. Because MCP is a protocol rather than a model feature, accuracy comes from the tool returning correct live data — any MCP-capable AI assistant calls the same tool surface and gets the same structured response.
Harness progression: 109/123 (Python v0.8.x) → 169/169 (v0.9.0) → 199/199 (v0.9.2) → 234/234 (v1.0.0).
643 Go unit tests across all providers and tools verify behavioral correctness and cross-provider API parity, independent of LLM evaluation.
Use Cases
1. Price the same workload across all three clouds at once
"Price the following on AWS, GCP, and Azure simultaneously: 4 instances (8 vCPU, 32 GB RAM), 1 managed PostgreSQL database (4 vCPU, 16 GB RAM), and 500 GB block storage. Return on-demand, 1-year committed, and 3-year committed totals for each cloud with monthly and annual figures, and flag which provider is cheapest at each commitment term."
compare_bom fans out 8 concurrent provider calls and returns a per-provider, per-term breakdown with savings analysis versus on-demand. No pricing calculator does this across cloud boundaries. AWS and Azure public pricing requires no credentials; GCP requires a free API key.
2. Find the cheapest AWS region for a long-running compute workload
"I need to run a c6a.4xlarge continuously. Fan out across all available AWS regions and return the 5 cheapest, sorted by on-demand hourly rate. Show us-east-1 as a baseline."
find_cheapest_region uses a 32-goroutine fan-out across every region where the instance type is available and returns results sorted cheapest-first. Regional price deltas for the same instance type routinely exceed 20%. No credentials needed.
3. Determine your effective AWS rate after commitments
"I have two m5.xlarge Reserved Instances (1-year, no upfront) in us-east-1 and a Compute Savings Plan covering $500/month of EC2 spend. What is my effective blended hourly rate on m5.xlarge right now, and what percentage am I saving versus on-demand?"
get_price with AWS credentials and OCC_AWS_ENABLE_COST_EXPLORER=true returns your actual post-discount rate alongside the public list price, pulling live data from Cost Explorer and Savings Plans APIs.
4. Azure serverless vs. always-on: break-even analysis
"Our batch processing job runs 1.5 million Azure Function executions per month, each consuming 512 MB for 900ms. What is the total monthly cost on the Consumption plan in West Europe, and what is the monthly cost of a Standard_D2s_v5 VM running continuously in the same region? At what monthly execution count do they break even?"
estimate_unit_economics covers the Functions path; get_price covers the VM. Azure pricing is fully public — no credentials, no API key, no subscription required.
5. Unit economics for a SaaS product
"If I run two m5.large app servers, one db.t3.medium RDS MySQL instance, and 200 GB gp3 in us-east-1, and I have 50,000 monthly active users making 1 million requests per day, what is my infrastructure cost per user and per request?"
estimate_bom prices the full stack; estimate_unit_economics computes cost per user and per request at that scale. Output is structured for direct use in a margin model or board-level cost discussion. No credentials needed.
6. AI token cost comparison: Vertex AI vs. Azure OpenAI
"We process 50 million input tokens and 8 million output tokens per month. Compare the total monthly cost of Gemini 1.5 Pro on Vertex AI versus GPT-4o and GPT-4o-mini on Azure OpenAI. Show cost per million tokens and total monthly bill for each."
get_price with domain: ai covers both providers. GCP Vertex AI and Gemini pricing requires a free GCP API key (OCC_GCP_API_KEY); Azure OpenAI pricing is fully public — no credentials needed.
Setup
Option 1 — pip (easiest, cross-platform)
The PyPI package wraps the native Go binary — no Go toolchain needed.
Option 2 — Homebrew (macOS / Linux)
Option 3 — binary download
Download the pre-built binary for your platform from the latest release:
Option 4 — Docker / container
The image is ~15 MB (distroless scratch base, static binary). No credentials are required for AWS and Azure public pricing.
Option 5 — build from source
Connect to Claude Code
Stdio (local process — recommended for single-user)
Add to ~/.claude/settings.json or your project's .mcp.json:
HTTP (shared/remote server — one server, many clients)
Kubernetes
See deploy/kubernetes/ for manifests. Build and push your own image (see Docker section above), then reference it in deployment.yaml.
Credentials are passed via environment variables or Kubernetes Secrets — same variable
names as the Docker examples above.
Test with MCP Inspector
AWS Credentials
Minimal IAM policy for public pricing:
Add these for effective pricing:
Configuration
All settings via environment variables (prefix OCC_) or .env file:
Caching
Prices are stored in a concurrent in-memory cache (read-optimised with sync.RWMutex) with atomic JSON persistence at ~/.cache/opencloudcosts/cache.json. Public list prices are cached for 24 hours — AWS pricing changes infrequently. Use the refresh_cache tool to force a refresh.
GCP Setup
Unlike AWS (which has public bulk pricing endpoints), GCP's pricing API always requires at least a free API key. No credit card or billing account is needed.
Option A — Free API key (recommended, 2 min setup):
- Go to console.cloud.google.com/apis/credentials
- Create a Project if you don't have one (free)
- Click Create Credentials → API key
- Set the key:
Or add OCC_GCP_API_KEY=AIza... to your .env file.
Option B — Application Default Credentials (if you already use gcloud):
GCP instance type format: {family}-{series}-{vcpus} e.g. n2-standard-4, e2-highmem-8, c2-standard-16
GCP Contract / Effective Pricing
If you have a negotiated pricing contract with Google Cloud, you can retrieve your actual discounted rates (EDP, custom pricing) via the Cloud Billing Pricing API v1beta. This requires:
- ADC credentials:
gcloud auth application-default login billing.billingAccountPrice.getIAM permission on your billing account- Your billing account ID:
With this configured, get_price responses for GCP compute will include an effective_price block showing your contract rate and discount percentage. Without it, public list prices are returned unchanged.
Azure Setup
Azure pricing is fully public — no credentials, API key, or subscription needed.
Azure instance type format: ARM SKU names e.g. Standard_D4s_v3, Standard_E8s_v3, Standard_B2ms
Azure pricing terms: on_demand (default), reserved_1yr, reserved_3yr, spot
Azure regions: ARM region names e.g. eastus, westeurope, southeastasia (use list_regions for full list)
Azure supported services:
GCP pricing terms: on_demand (default), spot (preemptible), cud_1yr, cud_3yr
Security
OpenCloudCosts can access sensitive billing data when configured with cloud credentials (AWS Cost Explorer, GCP billing, Azure contract pricing). Follow these guidelines to keep that data safe.
Credential hygiene
- Use dedicated, least-privilege credentials — read-only access scoped to pricing and billing APIs only. Never use root, owner, or admin credentials.
- AWS: create an IAM user/role with only
ce:GetCostAndUsage,pricing:GetProducts, andsavingsplans:Describe*permissions. - Store credentials in
.env(see.env.example) and never commit that file to version control.
Transport security
- The default
stdiotransport is safe — the server runs as a local process with no network exposure. - If you use
--transport http, never expose it publicly without a reverse proxy and authentication in front of it. Treat it as an internal service.
MCP client trust
- Only add this server to MCP client configs you control.
- Avoid running it alongside untrusted third-party MCP servers — a malicious server can craft prompts that cause the LLM to call your billing tools and relay the results.
What this server can access With credentials configured: actual spend, contract/negotiated pricing, reservation and savings plan data. Understand this before granting access in shared or multi-user environments.
Server instructions
This is the complete, verbatim Instructions string this server sends to MCP clients (from opencloudcosts-go/internal/server/server.go), reproduced here so it can be checked without reading source:
That's the whole thing: a description of what the tools do and when credentials matter. It contains no directives about the model's behavior, tone, or process, and it never will. We commit to keeping these instructions minimal and strictly pricing-scoped — any future change that adds a "you must...", "always...", or other behavioral directive is a review-blocking change and should be rejected in review unless this section of the README is updated in the same PR to reflect it.
If your MCP client or harness renders instructions from multiple locally-installed servers or plugins adjacent to each other (for example, a separate SessionStart hook from an unrelated plugin), that adjacent output is not produced by this server. Compare what you see against the fenced block above — only that text originates from OpenCloudCosts MCP.
Recent releases
- v0.9.1 ✅ GCP egress contract pricing; fix
PricingResult.sourceLiteral - v0.9.2 ✅ Azure OpenAI model matching fix; Azure Functions pricing fix;
list_instance_typescap; 199-prompt harness suite - v1.0.0 ✅ Go rewrite — static binary, dual stdio/HTTP transport, 16 tools,
compare_bomcross-cloud workload comparison, concurrent region fan-out (32 goroutines), Azure o1-mini SKU fix; 234/234 (100%) LLM grounding harness - v1.0.1 ✅ PyPI package description; CI Trusted Publisher fix;
go installtag - v1.0.2 ✅ README accuracy fixes; cache description updated
来源:README.md,提交 4b54d25
工具
0版本历史
1- v1.0.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分