# Infracost MCP for AI Agents AI Agent Connect

> Infracost MCP. Manage cloud cost guardrails, tagging policies, and enterprise price books directly through your AI agent. It gives you financial visibility over your Terraform plans before you hit apply, helping you stop cloud bill surprises before they happen.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_xeAIkzobHaNXul6wABfvaOhG1zW1KbvYBWGhp0O0/ai-agent-connect
- **Tags:** terraform, cloud-cost, finops, cost-estimation, governance, pull-request, infrastructure-as-code

## Description

Infracost is the connection you need to stop cloud bill surprises before they hit your invoice. This Connector lets you bring financial visibility and governance directly into your Infrastructure as Code workflows. Instead of manually checking every change in a separate dashboard, you can let your AI agent handle the heavy lifting of cost monitoring. You can set up guardrails that automatically flag or block pull requests if the proposed infrastructure costs exceed your specific thresholds. It also takes the headache out of organizational standards by enforcing tagging policies across all your resources. If your company has negotiated enterprise discounts, you can manage those custom price books so your estimates actually reflect your real costs. You can even map cloud spend to your internal hierarchy by feeding in properties from systems like ServiceNow or Backstage. It turns your AI into a FinOps partner that understands your specific rules and pricing. You'll find it much easier to keep your infrastructure in check when your agent can see the same financial data you do. Getting this set up in the Vinkius catalog makes it simple to plug into your existing workflow and start enforcing these rules immediately. You get a clear picture of the financial impact of every change, helping you stay on budget without the manual spreadsheet work.

## Tools

### delete_guardrail
Remove a cost rule that is no longer needed. This keeps your governance rules clean and relevant.

### create_price_book
Build a custom price book for your enterprise. This ensures your estimates reflect your actual negotiated discounts.

### get_guardrail
Pull details for a specific cost rule using its ID. This is useful for auditing specific budget constraints.

### get_price_book_files_url
Get a link to upload your price book CSV file. Use this to start the process of updating your pricing data.

### get_price_book
Check the status of a price book upload or update. This lets you know when your custom pricing is ready to use.

### ingest_price_book
Start the process of importing your uploaded CSV data. This activates your custom enterprise pricing.

### query_pricing
Run GraphQL queries to get specific cloud pricing data. Use this to compare costs across different regions and resource types.

### update_organization
Activate a custom price book in your settings. This applies your negotiated discounts to all future estimates.

### update_tagging_policy
Change the allowed values for your tagging rules. This keeps your resource attribution accurate and consistent.

### upload_custom_properties
Send CSV data from ServiceNow or Backstage for cost mapping. This connects your cloud spend to your internal hierarchy.

### list_guardrails
See all active cost rules for your organization. This helps you stay aware of existing limits across your infrastructure.

### create_guardrail
Set up a new rule to alert or block high-cost changes. This prevents unexpected spending before it happens.

### update_guardrail
Modify an existing cost rule's parameters. Use this to adjust your budget thresholds as your needs change.

## Prompt Examples

**Prompt:** 
```
Are there any guardrails that would block a $1,000 increase in our production environment?
```

**Response:** 
```
I've checked the active rules for your production environment. You have one guardrail currently active:

* **Threshold:** $500 increase
* **Action:** Block Pull Request

Since the proposed change exceeds this $500 limit, the PR will be automatically blocked until an override is approved.
```

**Prompt:** 
```
Update the tagging policy for our project to require a 'CostCenter' tag.
```

**Response:** 
```
I've updated the tagging policy for your project. The **CostCenter** tag is now marked as mandatory. All new resources must include this tag to be deployed.
```

**Prompt:** 
```
What is the estimated cost difference between running this in us-east-1 vs eu-west-1?
```

**Response:** 
```
Based on current pricing, here is the cost comparison for the requested resources:

| Region | Estimated Monthly Cost |
| :--- | :--- |
| **us-east-1** | $450.00 |
| **eu-west-1** | $512.50 |

Running in **us-east-1** is approximately **12.2% cheaper** for this specific configuration.
```

## Capabilities

### Block expensive pull requests
Automatically flag or block infrastructure changes that exceed your defined cost thresholds.

### Enforce tagging standards
Apply mandatory tagging policies to ensure every resource is correctly attributed to a department.

### Apply actual enterprise discounts
Update your price books so your cost estimates reflect your real negotiated contracts.

### Map costs to internal departments
Upload custom properties from external systems to link cloud spend to your organizational hierarchy.

### Compare cloud resource costs
Query specific pricing data to compare costs across different regions and resource types.

## Use Cases

### Preventing budget overruns on new features
A developer wants to spin up a massive database but doesn't know the cost. They ask their agent to check the cost and see if it violates any guardrails.

### Applying new enterprise discounts
The company just signed a new discount deal with a cloud provider. The FinOps lead uses create_price_book to update the agent's pricing data.

### Fixing missing resource tags
Resources are being created without proper tags. The DevOps lead uses update_tagging_policy to make specific tags mandatory for all new infrastructure.

### Mapping spend to departments
The finance team needs to see spend by department. The admin uses upload_custom_properties to map costs to ServiceNow data.

## Benefits

- Stop overspending by using create_guardrail to block pull requests that exceed your budget.
- Get accurate estimates with create_price_book to reflect your real enterprise discounts.
- Keep your resources organized by enforcing rules with update_tagging_policy.
- Connect your infrastructure to your business hierarchy using upload_custom_properties.
- Save time on research by running query_pricing to compare different regions and resources.

## How It Works

The bottom line is you get automated cloud cost governance without the manual spreadsheet work.

1. Subscribe to the Infracost MCP in the Vinkius catalog.
2. Enter your Infracost API Token in your client settings.
3. Ask your agent to check costs, set guardrails, or update policies.

## Frequently Asked Questions

**How does the Infracost MCP help with cloud spending?**
It connects your AI agent to Infracost to manage cost guardrails and pricing. You can set rules to block expensive changes and get accurate estimates based on your real contracts.

**Can I use the Infracost MCP to see my actual enterprise discounts?**
Yes. You can upload custom price books so your AI agent knows your specific negotiated rates, ensuring your cost estimates are accurate to your actual spend.

**Does the Infracost MCP support tagging policies?**
It does. You can use it to enforce organizational tagging standards, making sure every resource is correctly attributed to the right department or project.

**How do I prevent my team from overspending on new infrastructure?**
You can create cost guardrails that trigger alerts or block pull requests if a proposed change exceeds your budget thresholds, stopping overspending before it happens.

**Can I connect my ServiceNow data to Infracost?**
Yes, you can upload custom properties from systems like ServiceNow to map your cloud costs to your internal organizational hierarchy.

**Will the Infracost MCP block my Pull Requests automatically?**
It can. When you set up guardrails with specific cost thresholds, the AI agent can trigger actions to block any pull request that exceeds those limits.

**How can I see all active cost guardrails for my organization?**
You can use the `list_guardrails` tool by providing your organization slug. The agent will return a list of all configured thresholds, including cost increase limits and whether they block PRs.

**Can I enforce mandatory tags for my cloud resources using this server?**
Yes! Use the `update_tagging_policy` tool to define mandatory tag keys and allowed values. This helps maintain standards across all your repositories.

**Is it possible to block expensive Pull Requests automatically?**
Absolutely. When using `create_guardrail` or `update_guardrail`, you can set the `blockPr` parameter to true. This ensures that any infrastructure change exceeding your budget cannot be merged without review.