Terraform MCP Server

HashiCorp Terraform MCP server for Infrastructure as Code workflows, including provider and module discovery through the Terraform Registry.

Remote serverstreamable-httpGo

What is the Terraform MCP Server?

The terraform mcp server connects Terraform to AI assistants that speak the Model Context Protocol. HashiCorp Terraform MCP server for Infrastructure as Code workflows, including provider and module discovery through the Terraform Registry.

What Terraform does

The Terraform MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with Terraform Registry APIs, enabling advanced automation and interaction capabilities for Infrastructure as Code (IaC) development.

Key capabilities

  • Dual Transport Support — Both Stdio and StreamableHTTP transports with configurable endpoints
  • Terraform Registry Integration — Direct integration with public Terraform Registry APIs for providers, modules, and policies
  • HCP Terraform & Terraform Enterprise Support — Full workspace management, organization/project listing, and private registry access
  • Workspace Operations — Create, update, delete workspaces with support for variables, tags, and run management
  • OTel metrics for monitoring tool usage — Integration with open telemetry meters to track tool-call volume, latency and failures in Streamable HTTP mode. Also exposes default http server metrics when this feature is enabled

Requirements

  1. Ensure Docker is installed and running to use the server in a containerized environment. 1. Install an AI assistant that supports the Model Context Protocol (MCP).

Good to know

  • Written in Go.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

How to install the Terraform MCP Server

{
  "mcpServers": {
    "terraform": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TFE_ADDRESS=<<PASTE_TFE_ADDRESS_HERE>>",
        "-e",
        "TFE_TOKEN=<<PASTE_TFE_TOKEN_HERE>>",
        "hashicorp/terraform-mcp-server:1.3.0"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

  1. Ensure Docker is installed and running to use the server in a containerized environment. 1. Install an AI assistant that supports the Model Context Protocol (MCP).

Frequently asked questions

HashiCorp Terraform MCP server for Infrastructure as Code workflows, including provider and module discovery through the Terraform Registry. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.