Terraform MCP Server

Stabledevelopment
350 starsGohashicorp
GitHub
About

Overview

The Terraform MCP Server enables AI agents to work with Terraform for infrastructure as code. It provides tools for initializing workspaces, planning changes, applying configurations, viewing state, and managing resources. Supports all Terraform providers and state backends.
Capabilities

Tools & Capabilities

init

Initialize a Terraform workspace

plan

Create an execution plan

apply

Apply the planned changes

show_state

Show the current Terraform state

list_resources

List managed resources

validate

Validate Terraform configuration

Setup

Installation

bash
Install
go install github.com/hashicorp/terraform-mcp-server@latest
Examples

Example Usage

javascript
Usage
{
  "mcpServers": {
    "terraform": {
      "command": "terraform-mcp-server",
      "env": {
        "TF_WORKSPACE_DIR": "/path/to/terraform"
      }
    }
  }
}

Quick Info

Authorhashicorp
LanguageGo
StatusStable
Stars 350
Last UpdatedFeb 12, 2026

Need a Custom MCP Server?

Our team builds custom MCP servers tailored to your workflow.

Get in Touch

Need a Custom MCP Server?

Our team builds custom MCP servers tailored to your workflow. From proprietary data sources to internal tools, we have you covered.

Contact Us
CortexAgent Customer Service

Want to skip the form?

Our team is available to help you get started with CortexAgent.

This chat may be recorded for quality assurance. You can view our Privacy Policy.