Infracost MCP 9b597a83

MCP运维云端

提供方 DownAtTheBottomOfTheMoleHole

运维云端 未标注 Token 社区 / 第三方 VS Code

一个用于估算、比较和发布基础设施代码项目成本变化的Model Context Protocol (MCP)服务器,支持Terraform等多种基础设施即代码工具。

一句话选型结论

按资料字段整理

Infracost MCP 9b597a83 属于运维云端类 MCP 服务器,传输方式未标注,Token,可直接接入 VS Code,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式未标注 鉴权Token 部署方式未标注
GitHub 星标 0 仓库热度,无公开仓库时显示未标注
工具数 8 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量8暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

基础设施即代码JavaScript本地部署成本估算Terraform云计算DevOps

安装与配置

未标注 Token
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 8 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 8 个工具,职责相对集中,接入后不容易误操作。
  • 已适配 VS Code,换客户端不用重新研究配置。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 使用前要准备好Token对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 VS Code 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Infracost MCP 9b597a83当前 8 未标注 未标注 无 2026-05-17
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方DownAtTheBottomOfTheMoleHole上游标注的维护方 DownAtTheBottomOfTheMoleHole
分类运维云端本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式Token远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

13.2 KB
来自项目仓库与上游目录的原文,未做删改

Infracost MCP Server

> Note: This is a community-maintained MCP server. It is not an official Model Context Protocol server from Infracost.

A Model Context Protocol (MCP) server for running the Infracost CLI to estimate, compare, and publish infrastructure cost changes from Terraform and other Infrastructure as Code projects.

Overview

This server provides eight MCP tools across estimation, reporting, collaboration, and operations workflows:

  • infracost_breakdown to generate baseline cost estimates.
  • infracost_diff to compare planned cost changes.
  • infracost_output to render existing Infracost JSON in different formats.
  • infracost_comment to post PR comments on supported SCM platforms.
  • infracost_upload to upload reports to Infracost Cloud.
  • infracost_configure to get or set CLI configuration.
  • infracost_auth to run authentication flow.
  • infracost_generate_usage to generate usage files with sensible defaults.

Platform Compatibility

This MCP server is platform-agnostic and works in local and CI environments:

  • Local development
  • GitHub Actions
  • GitLab CI/CD
  • Azure DevOps
  • CircleCI, Jenkins, and Bitbucket Pipelines
  • AI Agents and Copilot workflows

The primary requirements are Node.js and the Infracost CLI binary.

Tool Matrix

Tool Category Typical outcome
infracost_breakdown Estimation Monthly cost baseline for current IaC
infracost_diff Comparison Cost delta from a planned change
infracost_output Reporting Rendered table/JSON/HTML/comment output
infracost_comment Collaboration PR comment with estimated impact
infracost_upload Cloud Sync Cost report visible in Infracost Cloud
infracost_configure Configuration Persisted CLI config update/read
infracost_auth Authentication Login flow for Infracost Cloud
infracost_generate_usage Utilities Pre-filled usage file template with defaults

Tools

infracost_breakdown

Runs infracost breakdown.

Inputs:

  • workingDirectory (string, optional): Command working directory.
  • path (string, optional): Path to Terraform/IaC directory or plan JSON.
  • configFile (string, optional): Path to Infracost config file.
  • usageFile (string, optional): Path to usage file.
  • format (string, optional): Output format. Default: table.
  • fields (string[], optional): Fields to include in output.
  • showSkus (boolean, optional): Include SKU details.
  • syncUsageFile (boolean, optional): Sync usage file with detected resources.
  • compareTo (string, optional): Baseline Infracost JSON path.
  • terraformWorkspace (string, optional): Terraform workspace.
  • terraformPlanFlags (string, optional): Flags for terraform plan.
  • timeoutSeconds (number, optional): Timeout in seconds.
  • extraArgs (string[], optional): Additional CLI arguments.

infracost_diff

Runs infracost diff.

Inputs:

  • workingDirectory (string, optional): Command working directory.
  • path (string, optional): Path to Terraform/IaC directory or plan JSON.
  • configFile (string, optional): Path to Infracost config file.
  • usageFile (string, optional): Path to usage file.
  • format (string, optional): Output format. Default: table.
  • compareTo (string, optional): Baseline Infracost JSON path.
  • showSkus (boolean, optional): Include SKU details.
  • syncUsageFile (boolean, optional): Sync usage file with detected resources.
  • terraformWorkspace (string, optional): Terraform workspace.
  • terraformPlanFlags (string, optional): Flags for terraform plan.
  • timeoutSeconds (number, optional): Timeout in seconds.
  • extraArgs (string[], optional): Additional CLI arguments.

infracost_output

Runs infracost output.

Inputs:

  • workingDirectory (string, optional): Command working directory.
  • path (string, optional): Infracost JSON file path. Auto-detected when omitted.
  • format (string, optional): Output format. Default: table.
  • fields (string[], optional): Fields to include in output.
  • showSkus (boolean, optional): Include SKU details.
  • timeoutSeconds (number, optional): Timeout in seconds.
  • extraArgs (string[], optional): Additional CLI arguments.

infracost_comment

Runs infracost comment.

Inputs:

  • workingDirectory (string, optional): Command working directory.
  • platform (string, optional): Platform (github, gitlab, azure-repos, bitbucket). Default: github.
  • path (string, optional): Infracost JSON file path. Auto-detected when omitted.
  • repo (string, optional): Repository (owner/repo).
  • pullRequest (string, optional): Pull request number.
  • commit (string, optional): Commit SHA.
  • token (string, optional): Platform token.
  • tag (string, optional): Comment tag.
  • behavior (string, optional): Comment update behavior.
  • dryRun (boolean, optional): Generate without posting.
  • timeoutSeconds (number, optional): Timeout in seconds.
  • extraArgs (string[], optional): Additional CLI arguments.

infracost_upload

Runs infracost upload.

Inputs:

  • workingDirectory (string, optional): Command working directory.
  • path (string, optional): Infracost JSON file path. Auto-detected when omitted.
  • timeoutSeconds (number, optional): Timeout in seconds.
  • extraArgs (string[], optional): Additional CLI arguments.

infracost_configure

Runs infracost configure.

Inputs:

  • workingDirectory (string, optional): Command working directory.
  • set (string, optional): Set configuration value.
  • get (string, optional): Read configuration value.
  • timeoutSeconds (number, optional): Timeout in seconds.
  • extraArgs (string[], optional): Additional CLI arguments.

infracost_auth

Runs infracost auth login.

Inputs:

  • workingDirectory (string, optional): Command working directory.
  • timeoutSeconds (number, optional): Timeout in seconds.
  • extraArgs (string[], optional): Additional CLI arguments.

infracost_generate_usage

Generates an Infracost usage file with sensible defaults for specified resource types. This is a utility tool that complements infracost_configure by providing pre-filled templates you can customize for your workloads. Returns both raw JSON and formatted guidance.

Inputs:

  • resourceTypes (string[], required): Resource types to include (e.g., ["aws_lambda_function", "aws_s3_bucket"]).
  • outputFilePath (string, optional): Path where usage file should be saved (for guidance only).
  • includeGuidance (boolean, optional): Include formatted guidance. Default: true.
  • onlyJson (boolean, optional): Return only raw JSON (no guidance). Default: false.

Supported resource types: aws_lambda_function, aws_instance, aws_db_instance, aws_s3_bucket, aws_dynamodb_table, aws_ebs_volume, aws_cloudfront_distribution, aws_lb, aws_nat_gateway, google_compute_instance, google_storage_bucket, azurerm_windows_virtual_machine, azurerm_linux_virtual_machine, azurerm_storage_account, azurerm_mssql_database.

Prompt Cookbook

Use these minimal prompts in Copilot Chat with @infracost.
CLI tools default to the current workspace root when no path is given.
If you add a file or folder as Copilot context (#file or #folder), reference it in your prompt and the tool will target that path.
The server auto-detects common report files (infracost-diff.json, infracost-base.json, infracost.json), so you usually do not need to pass path for infracost_output, infracost_comment, or infracost_upload.

Quick prompts```text

@infracost run infracost_breakdown
@infracost run infracost_diff
@infracost run infracost_output
@infracost run infracost_comment with dryRun true
@infracost run infracost_upload


### Run breakdown (`infracost_breakdown`)```text
@infracost run infracost_breakdown

Expected output: Baseline cost estimate with command output, exit code, stdout, and stderr.

Run diff (infracost_diff)```text

@infracost run infracost_diff


Expected output: Cost delta from the planned change compared to current baseline.

### Render output (`infracost_output`)```text
@infracost run infracost_output with format html

Expected output: Formatted output from existing Infracost JSON (auto-detected when possible).

Post PR comment (infracost_comment)```text

@infracost run infracost_comment with repo owner/repo and pullRequest 123 and dryRun true


Expected output: Generated comment payload, or posted comment when not in dry-run mode. Platform defaults to `github`.

### Upload report (`infracost_upload`)```text
@infracost run infracost_upload

Expected output: Upload confirmation for Infracost Cloud ingestion.

Configure CLI (infracost_configure)```text

@infracost run infracost_configure with:
- set: currency=USD


Expected output: Configuration update confirmation from the CLI.

### Authenticate (`infracost_auth`)```text
@infracost run infracost_auth

Expected output: Authentication flow prompt or login success details.

Generate usage file (infracost_generate_usage)```text

@infracost run infracost_generate_usage with:
- resourceTypes: ["aws_lambda_function", "aws_s3_bucket", "aws_dynamodb_table"]
- outputFilePath: ./infracost-usage.json
- includeGuidance: true


Expected output: Pre-filled usage file JSON with sensible defaults, plus guidance on customization and usage. Use `onlyJson: true` to return only the JSON for programmatic handling.

## Dependencies

### System Dependencies

- Node.js `>=24.14.0`
- npm (bundled with Node.js)
- Infracost CLI installed and available in `PATH` (or via `INFRACOST_BINARY_PATH`)

### npm Dependencies

Runtime:

- `@modelcontextprotocol/sdk` (MCP server SDK)

Development:

- `typescript` (build/compile)
- `tsx` (development runner)
- `vitest` (unit test runner)
- `@types/node` (Node.js typings)

### Environment Variables

- `INFRACOST_API_KEY`: Infracost API key for cloud-backed features.
- `INFRACOST_BINARY_PATH`: Override path to Infracost binary.

## Installation```bash
npm install
npm run build

Configuration

Usage with VS Code Copilot Chat

This workspace is preconfigured in .vscode/mcp.json:```json
{
"servers": {
"infracost": {
"type": "stdio",
"command": "node",
"args": ["./dist/index.js"]
}
}
}


Reload VS Code (`Cmd+Shift+P` -> `Developer: Reload Window`) after changing MCP configuration.

Then query the server from Copilot Chat with `@infracost`, for example:```text
@infracost run infracost_breakdown
@infracost run infracost_diff

Usage with Other MCP Clients

Use stdio transport with the built entrypoint:```json
{
"name": "infracost-mcp-server",
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/infracost-mcp/dist/index.js"]
}


Build first with `npm run build`, then start your MCP client.

## Running```bash
npm start

Development mode:```bash
npm run dev


Built mode:```bash
npm run start

Debugging

Use .vscode/launch.json:

  • Debug MCP Server (runs npm run dev)
  • Debug MCP Server (Built) (runs dist/index.js after build)

Set breakpoints in src/index.ts, then press F5.

Testing

See docs/TESTING.md for Copilot Chat scenarios, manual JSON-RPC checks, and troubleshooting guidance.

Quick validation prompt in Copilot Chat:```text
@infracost run infracost_breakdown


## Interactive VS Code Workflows

### 1. PR Cost Impact Review

1. Generate a baseline:```text
@infracost run infracost_breakdown with:
- path: .
- format: json
  1. Generate a diff:```text
    @infracost run infracost_diff with:
    - path: .
    - format: diff

1. Draft a PR comment:```text
@infracost run infracost_comment with:
- platform: github
- path: infracost-diff.json
- repo: owner/repo
- pullRequest: 123
- dryRun: true

2. Reporting Pipeline Setup

  1. Render a report for humans:```text
    @infracost run infracost_output with:
    - path: infracost-diff.json
    - format: html

1. Upload for centralized tracking:```text
@infracost run infracost_upload with:
- path: infracost-diff.json

3. Environment Bootstrap

  1. Configure defaults:```text
    @infracost run infracost_configure with:
    - set: currency=USD

1. Authenticate:```text
@infracost run infracost_auth

Best Practices

  • Keep workingDirectory explicit when running inside monorepos.
  • Use --format json for machine processing and --format table for human triage.
  • Keep timeoutSeconds high enough for large Terraform plans.
  • Prefer infracost_comment with dryRun=true before posting to production PR threads.
  • Use infracost_upload for historical visibility in Infracost Cloud.

Additional Use Cases

  • Pre-merge cost gates in pull requests.
  • Scheduled baseline cost snapshots in CI.
  • Cost delta reporting for release trains.
  • Team-level FinOps dashboards based on uploaded reports.

Related Projects

Infracost Resources

  • Infracost website
  • Infracost documentation
  • Infracost CLI repository

Model Context Protocol

  • MCP official documentation
  • MCP TypeScript SDK
  • MCP servers registry

Community and Contributing

  • Contributing Guide
  • Code of Conduct
  • Security Policy
  • Testing Guide
  • Maintainer Guide

Attribution and License

Maintained by Carl Dawson under the Down At The Bottom Of The Mole Hole organization.

Development```bash

npm run lint
npm test
npm run build
```

License

Licensed under the MIT License.

常见问题

6 问
答案由本站依据条目字段整理,不引用上游原文
Infracost MCP 9b597a83 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Infracost MCP 9b597a83 怎么在 VS Code 里配置?

它的传输方式未标注,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Infracost MCP 9b597a83 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Infracost MCP 9b597a83 需要 API Key 吗?

资料标注需要Token认证,使用前准备好对应凭据,并按最小权限配置。

Infracost MCP 9b597a83 支持哪些客户端?

资料标注支持 VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Infracost MCP 9b597a83 能提供哪些能力?

资料显示约 8 个工具;能力标签包括 基础设施即代码、JavaScript、VS Code、云计算。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。