OfficialCloud & infralocal stdio / remote HTTP

Terraform MCP Server

Gives agents Terraform Registry provider and module docs, plus HCP Terraform workspace tools.

Install

Claude Code

claude mcp add terraform -s user -t stdio -- docker run -i --rm hashicorp/terraform-mcp-server

Codex

codex mcp add terraform -- docker run -i --rm hashicorp/terraform-mcp-server

Gemini CLI

gemini extensions install https://github.com/hashicorp/terraform-mcp-server

Cursor

{"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"]}}}

Claude Desktop

{"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"]}}}

Commands and configuration as given in the server’s documentation (Documentation). Replace placeholders such as API keys with your own values.

HashiCorp’s official MCP server for Terraform Registry docs and HCP Terraform workspaces.

The Terraform MCP server is HashiCorp’s official, MPL-2.0-licensed server. It gives agents Terraform Registry provider and module docs, plus HCP Terraform workspace tools. It runs over stdio or Streamable HTTP from a Docker image or a binary. The public registry needs no authentication; HCP Terraform and Terraform Enterprise need a TFE_TOKEN. Setup is shown for Claude Code, Codex, Gemini CLI, Cursor and Claude Desktop.

Registry tools look up providers, resources, modules and policies so generated HCL matches current docs. With a TFE token it can also list and manage HCP Terraform or Terraform Enterprise workspaces, runs and variables. You can enable tool groups selectively.

Questions

How do I add the Terraform MCP server to Claude Code?
Run claude mcp add terraform -s user -t stdio -- docker run -i --rm hashicorp/terraform-mcp-server.
Does the Terraform MCP server need a token?
Not for the public registry. HCP Terraform and Terraform Enterprise need a TFE_TOKEN.
Can the Terraform MCP server manage HCP Terraform workspaces?
Yes. With a TFE token it can list and manage HCP Terraform or Terraform Enterprise workspaces, runs and variables.
How is the Terraform MCP server distributed?
As a Docker image or a binary; Gemini CLI installs it as an extension from the GitHub repository.

Sources

Checked October 2, 2026.

Cloud & infra

View all
Aftergradient

What are you looking for?

Search commands, errors, tools