Skip to main content
Watch: Grok Bot Built My AI Video Arena While I Tested 8 Models

Cloud and hosting - official HashiCorp (Terraform, Vault) server

Terraform MCP server

MCP server, run locally or HashiCorp-hosted for HCP Terraform, that gives agents current Terraform Registry provider, module, and Sentinel policy documentation, plus HCP Terraform and Terraform Enterprise workspace, run, variable, team, and private registry management when a Terraform API token is supplied. HashiCorp (Terraform, Vault) hosts it at https://mcp.terraform.io/mcp, or you can run docker.io/hashicorp/terraform-mcp-server (oci) locally with API key auth.

Last verified 15 tools7 sources

Install

Terminal
claude mcp add terraform -s user -t stdio -- docker run -i --rm hashicorp/terraform-mcp-server
Terminal
codex mcp add terraform -- docker run -i --rm hashicorp/terraform-mcp-server
JSON
{
  "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.4.1"
      ]
    }
  }
}

VS Code

JSON
{
  "mcp": {
    "servers": {
      "terraform": {
        "command": "docker",
        "args": [
          "run",
          "-i",
          "--rm",
          "-e", "TFE_TOKEN=${input:tfe_token}",
          "-e", "TFE_ADDRESS=${input:tfe_address}",
          "hashicorp/terraform-mcp-server:1.4.1"
        ]
      }
    },
    "inputs": [
      {
        "type": "promptString",
        "id": "tfe_token",
        "description": "Terraform API Token",
        "password": true
      },
      {
        "type": "promptString",
        "id": "tfe_address",
        "description": "Terraform Address",
        "password": false
      }
    ]
  }
}

Tools

search_provider_docs
Search documentation within a provider (named search_providers before 1.4.0).
get_provider_details
Retrieve complete documentation for a specific provider component.
get_provider_capabilities
Discover all resource types a provider supports.
get_latest_provider_version
Retrieve the latest version of a provider.
search_modules
Find modules by name or functionality.
get_module_details
Get module inputs, outputs, examples, and submodules.
search_policies
Find Sentinel policies by topic or requirement.
get_policy_details
Retrieve detailed Sentinel policy documentation.
search_private_modules
Find private modules in your HCP Terraform or Terraform Enterprise organization.
list_terraform_orgs
Fetch all Terraform organizations the token can access.
list_workspaces
Search and list workspaces in an organization.
create_workspace
Create a new Terraform workspace.
create_run
Create a new Terraform run.
action_run
Apply, discard, or cancel runs (requires ENABLE_TF_OPERATIONS=true).
get_plan_json_output
Retrieve the structured JSON output of a Terraform plan.

As documented on November 2, 2026. A running server reports its current list through tools/list.

Notes and caveats

  • Runs locally (Docker image or prebuilt binaries from releases.hashicorp.com), self-hosted, or as the HashiCorp-hosted remote server at https://mcp.terraform.io/mcp, which HashiCorp labels beta.
  • The remote server needs an HCP Terraform API token as a Bearer header on every request, connects only to HCP Terraform organizations in the United States, leaves out the destructive tools, and limits each session to 5 requests per second with bursts of 10.
  • Locally, public registry tools need no auth; registry-private and terraform toolsets register only with a valid TFE_TOKEN (optional TFE_ADDRESS, default https://app.terraform.io).
  • Destructive tools are disabled unless ENABLE_TF_OPERATIONS=true.
  • Streamable HTTP mode via TRANSPORT_MODE=streamable-http (default port 8080, /mcp).
  • The docs list 61 tools; 15 shown.
  • Release 1.4.0 renamed search_providers to search_provider_docs, though the docs reference page still shows the old name.
  • Install snippets come from the official GitHub README.

FAQ

What does the Terraform MCP server do?

MCP server, run locally or HashiCorp-hosted for HCP Terraform, that gives agents current Terraform Registry provider, module, and Sentinel policy documentation, plus HCP Terraform and Terraform Enterprise workspace, run, variable, team, and private registry management when a Terraform API token is supplied. The vendor documents 15 tools, including search_provider_docs, get_provider_details, get_provider_capabilities and get_latest_provider_version.

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, copied from HashiCorp (Terraform, Vault)'s docs. This page also has snippets for Codex, Cursor and VS Code.

Does the Terraform MCP server need authentication?

Yes, API key. Transport: stdio, Streamable HTTP. Status: Unlabelled, last checked November 2, 2026.

Sources

Last verified against 7 HashiCorp (Terraform, Vault) pages, then re-checked independently.

Newsletter

New MCP servers, the week they ship

One email per week. New official MCP servers, the coding tools that support them and how developers wire them up.