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,562 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.4.1.

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

Data as of from the GitHub API and the official MCP registry; description from the project's repository. Report an error

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.4.1"
      ],
      "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.4.1

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "terraform": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "TFE_TOKEN",
        "docker.io/hashicorp/terraform-mcp-server:1.4.1"
      ],
      "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.4.1"
      ],
      "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.

Tools (4)

Parsed from the Tools section of the README; check the repository for the current list.

  • error_code

    httpstatus

  • unauthorized

    401

  • not_found

    404

  • conflict

    409

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.

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.4.1 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 Nov 11, 2026. The latest release is v1.4.1, published Oct 23, 2026. appsgit only lists MCP servers with a commit in the last six months.