Skip to main content
Watch: I Built an AI App Without Leaving Databricks

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

Terraform MCP server

Self-hosted MCP server 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 TFE_TOKEN is supplied. It runs locally from docker.io/hashicorp/terraform-mcp-server (oci) with API key auth.

Last verified 15 tools6 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.3.0"
      ]
    }
  }
}

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.3.0"
        ]
      }
    },
    "inputs": [
      {
        "type": "promptString",
        "id": "tfe_token",
        "description": "Terraform API Token",
        "password": true
      },
      {
        "type": "promptString",
        "id": "tfe_address",
        "description": "Terraform Address",
        "password": false
      }
    ]
  }
}

Tools

search_providers
Find provider documentation by service name (renamed search_provider_docs in 1.3.1).
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 October 17, 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); no vendor-hosted endpoint.
  • 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).
  • Docs show no beta label on the 1.x line but give no explicit GA wording.
  • Install snippets come from the official GitHub README.

FAQ

What does the Terraform MCP server do?

Self-hosted MCP server 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 TFE_TOKEN is supplied. The vendor documents 15 tools, including search_providers, 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 October 17, 2026.

Sources

Last verified against 6 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.