# Terraform (MCP server)

> 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 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.

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/hashicorp/terraform-mcp-server |
| GitHub stars | 1,544 |
| License | MPL-2.0 |
| Language | Go |
| Transport | stdio |
| Packages | docker: docker.io/hashicorp/terraform-mcp-server:1.0.0 |
| Remote URL | none |
| Needs API key | yes |
| Official | yes |
| Works with | Claude Desktop, Claude Code, Cursor, VS Code |
| Category | Cloud & DevOps |
| Latest release | v1.3.0 (Aug 26, 2026) |
| Last commit | Oct 6, 2026 |
| MCP registry name | io.github.hashicorp/terraform-mcp-server |

## Install

### Claude Desktop (claude_desktop_config.json)

```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

```sh
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)

```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)

```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 2026-10-07.

## Environment variables

- `TFE_ADDRESS`: HCP Terraform or Terraform Enterprise base URL.
- `TFE_TOKEN` (secret): HCP Terraform or Terraform Enterprise API token used to authenticate requests.
- `ENABLE_TF_OPERATIONS`: Set to true to enable tools that execute Terraform operations requiring explicit approval.

## Similar MCP servers

- [Worldmonitor](https://appsgit.com/mcp-servers/worldmonitor): Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface. (87,920 stars, AGPL-3.0)
- [Netdata](https://appsgit.com/mcp-servers/netdata): Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection. (80,817 stars, GPL-3.0, needs API key)
- [openstatus](https://appsgit.com/mcp-servers/openstatus): Manage monitors, status pages, incidents and maintenances in your openstatus workspace. (9,171 stars, AGPL-3.0, official)
- [MCP Server Cloudflare](https://appsgit.com/mcp-servers/mcp-server-cloudflare): Model Context Protocol (MCP) is a new, standardized protocol for managing context between large language models (LLMs) and external systems. (4,360 stars, Apache-2.0, official, needs API key)
- [Dagu](https://appsgit.com/mcp-servers/dagu): Self-hostable workflow orchestrator for teams whose main work isn't orchestration. (4,289 stars, GPL-3.0)
- [Azure MCP Server](https://appsgit.com/mcp-servers/azure-mcp-server): All Azure MCP tools to create a seamless connection between AI agents and Azure services. (3,738 stars, MIT, official)

---

Canonical page: https://appsgit.com/mcp-servers/terraform
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed nightly.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
