MCP server · Infrastructure

OfficialNot tested yet (sources checked)Read-writeMPL-2.0Updated November 2026

Terraform MCP Server

Official HashiCorp server for Terraform Registry docs, with optional HCP Terraform workspace and run tools. Shown here: registry docs only.

Quick verdict

A sound first install for anyone writing Terraform: run it registry-only and it is a read-only documentation lookup. Treat any token-backed setup as infrastructure access, widen one toolset at a time, and leave ENABLE_TF_OPERATIONS off.

  • MaintainerHashiCorp (official)
  • Security scopeRead-write
  • Transportsstdio, streamable-http
  • Install channeldocker · docker.io/hashicorp/terraform-mcp-server
  • EvidenceNot tested yet (sources checked)
  • LicenseMPL-2.0 · Open source

HashiCorp's official MCP server for Terraform. Its public Registry tools look up provider documentation, provider versions and capabilities, modules and Sentinel policies, so an assistant writes Terraform against current docs. With an HCP Terraform or Terraform Enterprise token it can also list organizations, manage projects, teams, workspaces, variables, variable sets, tags and policy-set attachments, read plans, applies and state versions, and start runs. Deleting projects, teams and workspaces, force-unlock, run approval and destroy runs stay off unless ENABLE_TF_OPERATIONS=true is set; deleting a variable from a variable set needs only the token. The configuration shown here runs the Docker image with --toolsets=registry and no token, which exposes only the read-only Registry tools.

MCP security best practices

Install Terraform MCP Server

Docker installed and running. --toolsets=registry is passed on purpose: the README says the default toolset is registry, but the code and HashiCorp's reference page set it to all, so a server started without the flag exposes the workspace, team, variable and run tools as soon as a TFE_TOKEN is added (the ENABLE_TF_OPERATIONS tools stay off until that flag is set). Prebuilt binaries (releases.hashicorp.com), go install and a Helm chart are the other local paths. HashiCorp also hosts a beta remote server at https://mcp.terraform.io/mcp that needs a token, has no OAuth, connects only to US HCP Terraform organizations and cannot be narrowed to a toolset.

docker run -i

Config entry (mcpServers)
{
  "mcpServers": {
    "terraform": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "docker.io/hashicorp/terraform-mcp-server",
        "--toolsets=registry"
      ]
    }
  }
}

Credentials

NameRequiredWhat it is for
TFE_TOKENOptionalHCP Terraform or Terraform Enterprise API token. Not used by this registry-only configuration. Only needed to widen to the registry-private or terraform toolsets; prefer a team token limited to the workspaces the agent needs over a user token, which acts across every organization the user belongs to.
TFE_ADDRESSOptionalHCP Terraform or Terraform Enterprise base URL including the protocol. Defaults to https://app.terraform.io; set it for Terraform Enterprise. Not used by this configuration.

Verified configurations

Not run by us yet. This profile is Not tested yet (sources checked): the install channel, config entry, credentials and license were checked against the source and upstream metadata, but no configuration has been installed, discovered and executed in a recorded environment. When one is, it appears here with the eight scope dimensions below.

Best for

Developers writing Terraform with an assistant who want current provider, module and policy documentation, and HCP Terraform users who want the assistant to read workspace, run and plan details under a tightly scoped token.

Why use it

It is HashiCorp's own server, so Registry lookups track the real Registry. The Registry tools need no account or token. Toolset and per-tool filters, plus the off-by-default ENABLE_TF_OPERATIONS gate, keep the surface small, and it supports HCP Terraform, Terraform Enterprise and fully self-hosted deployment.

Tradeoffs

Adding a token without --toolsets exposes every write tool that does not need ENABLE_TF_OPERATIONS, because the real default is all. Those tools act immediately with the token's permissions: they can create workspaces and teams, change variables, delete a variable from a variable set, grant team access and start runs. Reading the code, the refresh_state and allow_empty_apply run types do not set auto-apply off, so on a workspace with auto-apply enabled they may go ahead without a further confirmation step (not tested): a refresh-only run updates state, not resources, while an allow_empty_apply run with pending changes would apply them. Plan logs, plan JSON, variables and state versions can carry sensitive values, and the README warns that Terraform data may reach the MCP client and model. Nothing automated tracks the Docker image, so check it before relying on it. Terraform itself is BUSL-licensed; only this server is MPL-2.0.

Upstream state

repository active · in the official MCP Registry (active). Lifecycle is derived from a committed upstream snapshot at build time, never authored by hand.

Official MCP Registry name: io.github.hashicorp/terraform-mcp-server

Editorial details

EditorCJ ZwartLast updatedNovember 2026Sourceshashicorp/terraform-mcp-server README: Docker configs, env vars, toolsets, transports; hashicorp/terraform-mcp-server LICENSE (MPL-2.0); Tool registry source: toolsets, token and ENABLE_TF_OPERATIONS gates; CLI source: --toolsets flag default; HashiCorp docs: Terraform MCP server tool reference; HashiCorp docs: remote Terraform MCP server (beta); Official MCP Registry: io.github.hashicorp/terraform-mcp-server; Docker Hub: hashicorp/terraform-mcp-server

Grade B: Not tested yet (sources checked). Re-review is due by 2027-05-10. Config entries, credential names and package status can change upstream; verify against the source repository before granting an agent access.

Sources

Related guides

All MCP servers →