Skip to content
appsgit

Terraform

Terraform is an MCP server that generates more accurate Terraform and automate workflows for HCP Terraform and Terraform Enterprise. It has 1,544 GitHub stars, is released under the MPL-2.0 license and runs locally with docker run -i --rm -e TFE_TOKEN docker.io/hashicorp/terraform-mcp-server:1.0.0.

github.com/hashicorp/terraform-mcp-server (opens in a new tab)

Install Terraform

Generated from the server's MCP registry entry. Replace your-value with your own values.

Claude Desktop

claude_desktop_config.json
{
  "mcpServers": {
    "terraform": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TFE_TOKEN",
        "docker.io/hashicorp/terraform-mcp-server:1.0.0"
      ],
      "env": {
        "TFE_TOKEN": "your-value"
      }
    }
  }
}

Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.

Claude Code

claude mcp add --env TFE_TOKEN=your-value --transport stdio terraform -- docker run -i --rm -e TFE_TOKEN docker.io/hashicorp/terraform-mcp-server:1.0.0

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "terraform": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TFE_TOKEN",
        "docker.io/hashicorp/terraform-mcp-server:1.0.0"
      ],
      "env": {
        "TFE_TOKEN": "your-value"
      }
    }
  }
}

Project file; use ~/.cursor/mcp.json to enable it in every project.

VS Code

.vscode/mcp.json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "tfe_token",
      "description": "TFE_TOKEN",
      "password": true
    }
  ],
  "servers": {
    "terraform": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TFE_TOKEN",
        "docker.io/hashicorp/terraform-mcp-server:1.0.0"
      ],
      "env": {
        "TFE_TOKEN": "${input:tfe_token}"
      }
    }
  }
}

Config formats checked against the official docs on Oct 7, 2026: modelcontextprotocol.io (opens in a new tab), code.claude.com (opens in a new tab), cursor.com (opens in a new tab), code.visualstudio.com (opens in a new tab).

Environment variables

Variables the server reads at startup.

NameRequiredDescription
TFE_ADDRESSNoHCP Terraform or Terraform Enterprise base URL.
TFE_TOKENsecretNoHCP Terraform or Terraform Enterprise API token used to authenticate requests.
ENABLE_TF_OPERATIONSNoSet to true to enable tools that execute Terraform operations requiring explicit approval.

About Terraform

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

FAQ

Terraform FAQ

Still curious? Email info@appsgit.com.

What is Terraform?

Terraform is an MCP server that generates more accurate Terraform and automate workflows for HCP Terraform and Terraform Enterprise. It has 1,544 GitHub stars, is released under the MPL-2.0 license and runs locally with docker run -i --rm -e TFE_TOKEN docker.io/hashicorp/terraform-mcp-server:1.0.0. The source code is at github.com/hashicorp/terraform-mcp-server.

How do I install the Terraform MCP server?

Add the command docker run -i --rm -e TFE_TOKEN docker.io/hashicorp/terraform-mcp-server:1.0.0 to your MCP client: put it in claude_desktop_config.json for Claude Desktop, run claude mcp add for Claude Code, or add it to .cursor/mcp.json (Cursor) or .vscode/mcp.json (VS Code). The snippets on this page are ready to paste.

Is Terraform free?

The server is open source under the MPL-2.0 license, so running it is free. It needs credentials (TFE_TOKEN) for the service it connects to, which may require a paid account.

Is Terraform actively maintained?

The most recent commit was on Oct 6, 2026. The latest release is v1.3.0, published Aug 26, 2026. appsgit only lists MCP servers with a commit in the last six months and re-checks every server daily.