Infracost MCP Server

MCP server for Infracost CLI integration - cloud cost estimates for Infrastructure as Code

Local serverstdioTypeScript

What is the Infracost MCP server?

Infracost MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. MCP server for Infracost CLI integration - cloud cost estimates for Infrastructure as Code.

What you get

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.

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

Setting it up

The server ships on npm as npm, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What the assistant can call

Once Infracost is connected, these are the calls the assistant has available:

  • resourceTypes — ["aws_lambda_function", "aws_s3_bucket", "aws_dynamodb_table"]
  • outputFilePath — ./infracost-usage.json
  • includeGuidance — true
  • infracost_breakdown — The infracost_breakdown tool exposed by this server
  • infracost_diff — The infracost_diff tool exposed by this server
  • infracost_output — The infracost_output tool exposed by this server
  • infracost_comment — The infracost_comment tool exposed by this server
  • infracost_upload — The infracost_upload tool exposed by this server
  • infracost_configure — The infracost_configure tool exposed by this server
  • infracost_auth — The infracost_auth tool exposed by this server
  • 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

Configuration and credentials

You will need 2 environment variables: INFRACOST_BINARY_PATH, INFRACOST_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 11 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Infracost.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the infracost mcp server does with a few real requests.

Choosing this one

Plenty of cloud and infrastructure servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Infracost's toolset — resourceTypes, outputFilePath, includeGuidance and 8 more — is a fair guide to whether it matches your workflow. It is maintained by DownAtTheBottomOfTheMoleHole; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
resourceTypes["aws_lambda_function", "aws_s3_bucket", "aws_dynamodb_table"]
outputFilePath./infracost-usage.json
includeGuidancetrue
infracost_breakdownThe infracost_breakdown tool exposed by this server.
infracost_diffThe infracost_diff tool exposed by this server.
infracost_outputThe infracost_output tool exposed by this server.
infracost_commentThe infracost_comment tool exposed by this server.
infracost_uploadThe infracost_upload tool exposed by this server.
infracost_configureThe infracost_configure tool exposed by this server.
infracost_authThe infracost_auth tool exposed by this server.
infracost_generate_usageGenerates 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. R

How to install the Infracost MCP server

{
  "mcpServers": {
    "infracost": {
      "command": "npx",
      "args": ["-y", "npm"],
      "env": {
        "INFRACOST_BINARY_PATH": "your-value",
        "INFRACOST_API_KEY": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
INFRACOST_BINARY_PATHFilesystem location the server is allowed to use.Optional
INFRACOST_API_KEYCredential the server authenticates with.Yes

Example prompts to try

  • Use Infracost to resourceTypes.
  • Use Infracost to outputFilePath.
  • Use Infracost to includeGuidance.

Frequently asked questions

It connects Infracost to MCP-compatible AI assistants such as Claude and Cursor, exposing 11 tools (resourceTypes, outputFilePath, includeGuidance, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Infracost directly.