Infracost

MCP server enabling Claude to estimate Terraform costs, manage tagging policies, guardrails, and PR integrations with Infracost Cloud.
  • typescript

2

GitHub Stars

typescript

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "phildougherty-infracost_mcp": {
      "command": "node",
      "args": [
        "/absolute/path/to/infracost_mcp/dist/index.js"
      ],
      "env": {
        "INFRACOST_ORG": "your_org_slug",
        "INFRACOST_SERVICE_TOKEN": "ics_v1_your_token_here"
      }
    }
  }
}

This MCP server lets Claude interact with Infracost for Terraform cost estimation and governance. It enables cost breakdowns, comparisons, tagging policies, guardrails, PR integrations, and usage templates, all accessible from Claude Code or Claude Desktop.

How to use

Use Claude Code or Claude Desktop to run cost estimations and governance workflows with Infracost through this MCP server. You can generate a cost breakdown for a Terraform configuration, compare costs across configurations or branches, enforce tagging policies, set guardrails to block or warn on costly changes, post cost comments to PRs, and upload custom properties for resource classification.

Claude Code: The server is ready out of the box and the Infracost tools are available when you open the project in Claude Code. You can run cost-related commands directly inside the editor experience.

Claude Desktop: Add the MCP server as a local process. Create or update your Claude Desktop config to point to the local runtime and provide your Infracost Cloud token. Restart Claude Desktop after updating the config.

How to install

# Prerequisites
- Node.js >= 18
- Infracost CLI (for cost estimation tools)
- Infracost service token from Infracost Cloud > Org Settings > API tokens

# Install the MCP server locally
git clone <repo-url> infracost_mcp
cd infracost_mcp
npm install
npm run build

Configuration and usage notes

Create a configuration file in your project root to run the MCP server locally. The following environment variables are required for the server to interact with Infracost Cloud:

INFRACOST_SERVICE_TOKEN is the API token you obtain from the Infracost Cloud dashboard. INFRACOST_ORG is your organization slug.

INFRACOST_SERVICE_TOKEN=ics_v1_your_token_here
INFRACOST_ORG=your_org_slug

Using with Claude Desktop

Add the MCP server to Claude Desktop by placing the runtime configuration in your Claude Desktop config file.

macOS path example: ~/Library/Application Support/Claude/claude_desktop_config.json

Linux path example: ~/.config/Claude/claude_desktop_config.json

Windows path example: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "infracost": {
      "command": "node",
      "args": ["/absolute/path/to/infracost_mcp/dist/index.js"],
      "env": {
        "INFRACOST_SERVICE_TOKEN": "ics_v1_your_token"
      }
    }
  }
}

Examples you can run

Cost estimation for Terraform configurations, cost comparisons, tagging policies, and guardrails described in practical examples help you validate changes before merging.

Notes on usage templates

The MCP server provides predefined usage templates that you can reference to model typical costs for development, staging, and production environments.

Available tools

infracost_breakdown

Generate a cost breakdown for Terraform infrastructure.

infracost_diff

Show cost differences between two configurations.

infracost_output

Combine and format Infracost JSON files for reporting.

infracost_upload

Upload cost estimates to Infracost Cloud.

infracost_comment

Post cost comments to pull requests.

infracost_cloud_list_tagging_policies

List all tagging policies in Infracost Cloud.

infracost_cloud_get_tagging_policy

Get a specific tagging policy.

infracost_cloud_create_tagging_policy

Create a new tagging policy.

infracost_cloud_update_tagging_policy

Update an existing tagging policy.

infracost_cloud_delete_tagging_policy

Delete a tagging policy.

infracost_cloud_list_guardrails

List all guardrails in Infracost Cloud.

infracost_cloud_get_guardrail

Get a specific guardrail.

infracost_cloud_create_guardrail

Create a new cost guardrail.

infracost_cloud_update_guardrail

Update an existing guardrail.

infracost_cloud_delete_guardrail

Delete a guardrail.

infracost_cloud_upload_custom_properties

Upload custom property values via CSV.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
Infracost MCP Server - phildougherty/infracost_mcp | VeilStrat