Terraform MCP Server
HashiCorp's official Terraform MCP server: search the public Terraform Registry for providers, modules and policies, and with an API token work with HCP Terraform and Terraform Enterprise workspaces, runs and your private registry. Run it locally with Docker (TFE_TOKEN and TFE_ADDRESS are only needed for HCP Terraform or Terraform Enterprise tools), or use HashiCorp's hosted server at https://mcp.terraform.io/mcp (beta): it needs an HCP Terraform user or team API token in an Authorization: Bearer header on every request (HCP Terraform doesn't offer OAuth sign-in), works only with U.S. HCP Terraform organizations (not Terraform Enterprise or HCP Europe), and leaves out destructive tools such as delete_workspace_safely. As of Nov 26, 2026 the README already shows image tag 1.5.0, but HashiCorp hasn't published that release yet: there is no 1.5.0 tag on Docker Hub or GitHub, so docker run with :1.5.0 fails until it ships. The command here pins 1.4.1 (Oct 23, 2026), the latest published image. The changelog lists what 1.5.0 will bring, including Terraform Search tools and a fix that makes create_no_code_workspace work with clients on MCP protocol 2026-07-28.
Install
docker run -i --rm -e TFE_TOKEN -e TFE_ADDRESS hashicorp/terraform-mcp-server:1.4.1Source: official setup docs
Remote server (hosted)
HashiCorp hosts the server at https://mcp.terraform.io/mcp (beta, U.S. HCP Terraform organizations only). There's no OAuth sign-in: create an HCP Terraform user or team API token and send it as a Bearer header. The server can do only what that token allows.
{
"mcpServers": {
"terraform": {
"url": "https://mcp.terraform.io/mcp",
"headers": {
"Authorization": "Bearer "
}
}
}
} Example for Cursor mcp.json. Claude Code:
claude mcp add terraform -s user -t http \
--header "Authorization: Bearer " \
https://mcp.terraform.io/mcp Codex has no header flag on codex mcp add, so add url and http_headers (or bearer_token_env_var) to [mcp_servers.terraform] in ~/.codex/config.toml. Sources: Connect to the remote Terraform MCP server, README.
Example config (Cursor / Claude Desktop)
{
"mcpServers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"TFE_TOKEN",
"-e",
"TFE_ADDRESS",
"hashicorp/terraform-mcp-server:1.4.1"
],
"env": {
"TFE_TOKEN": "<your-value>",
"TFE_ADDRESS": "<your-value>"
}
}
}
}The same mcpServers block works in Cursor, Claude Desktop and Devin Desktop. VS Code (Copilot) uses a "type" field, Claude Code is easiest with claude mcp add, and Codex uses TOML: see the setup guide for your app. On Windows, wrap npx with cmd /c (fix).
At a glance
| Repository | hashicorp/terraform-mcp-server |
| GitHub stars | 1,563 |
| Last commit | 2026-11-24 (6 days ago) |
| Status | maintained |
| Security advisories | No published advisories found as of 2026-11-30. Details |
| Clients mentioned in README | Claude Desktop, Claude Code, Cursor, VS Code, Codex |
| Auth | HCP Terraform or Terraform Enterprise API token (optional locally for public registry tools; required by the hosted server) · TFE_TOKEN TFE_ADDRESS |
| Language / License | Go / MPL-2.0 |
| Official MCP registry | Listed ✓ |
Security advisories
No published advisories found as of 2026-11-30.
Checked 2026-11-30 in the repo's GitHub security advisories and OSV.dev for github.com/hashicorp/terraform-mcp-server (Go). No advisory doesn't prove a server is safe. How to stay updated.