MCP Directory

How to add Terraform MCP Server to Claude Desktop

HashiCorp's official server for Terraform Registry providers, modules, and IaC workflows. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.

Last updated June 15, 2026 ยท 1.4kโ˜… ยท stdio ยท no auth ยท official

Claude Desktop config for Terraform MCP Server

docker run -i --rm hashicorp/terraform-mcp-server
{
  "mcpServers": {
    "terraform-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "hashicorp/terraform-mcp-server"
      ]
    }
  }
}

Requires Docker to be installed and running.

Setup steps

  1. 1Open Claude Desktop โ†’ Settings โ†’ Developer โ†’ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
  2. 2Paste the Terraform MCP Server config below under the top-level "mcpServers" key.
  3. 3Fill in any placeholder secrets (API keys, paths) in the snippet.
  4. 4Save the file, then fully quit and reopen Claude Desktop.
  5. 5Open a chat and confirm Terraform MCP Server's tools appear under the ๐Ÿ”Œ tools menu.

Before you start

  • An MCP-compatible client (Claude, Cursor, VS Code Copilot, etc.)
  • Docker running, OR Go installed to build/install from source (`go install github.com/hashicorp/terraform-mcp-server/cmd/terraform-mcp-server@latest`)
  • Public Registry tools need no credentials
  • For private modules/providers and workspace tools: an HCP Terraform / Terraform Enterprise API token set as TFE_TOKEN (and TFE_ADDRESS for self-hosted TFE), created under your HCP Terraform user or team API tokens settings

What Terraform MCP Server can do in Claude Desktop

search_providers

Search the Terraform Registry for providers

get_provider_details

Get documentation and details for a provider

get_latest_provider_version

Resolve the latest published version of a provider

search_modules

Search the Registry for reusable modules

get_module_details

Get inputs, outputs, and docs for a module

search_policies

Search Sentinel/policy libraries in the Registry

list_workspaces

List HCP Terraform / TFE workspaces (requires token)

get_workspace_details

Inspect a specific workspace's configuration

Security

In default mode it only reads the public Terraform Registry, so risk is low; adding a TFE_TOKEN grants access to your Terraform Cloud/Enterprise org and should be scoped accordingly. Pin a specific image tag rather than latest for reproducible behavior.

Terraform MCP Server + Claude Desktop FAQ

Where is the Claude Desktop config file?

Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Terraform MCP Server config there under the "mcpServers" key and restart the client.

Is Terraform MCP Server safe to use with Claude Desktop?

In default mode it only reads the public Terraform Registry, so risk is low; adding a TFE_TOKEN grants access to your Terraform Cloud/Enterprise org and should be scoped accordingly. Pin a specific image tag rather than latest for reproducible behavior.

Do I need a Terraform Cloud token to use it?

No for public Registry lookups (search/get providers, modules, policies). Yes for the `terraform` and `registry-private` toolsets, which talk to HCP Terraform / Terraform Enterprise and require TFE_TOKEN.

Is it free?

The server is open source under MPL-2.0 and free to run. Registry access is free; workspace operations are governed by your HCP Terraform / Terraform Enterprise plan.

Can I run it remotely instead of stdio?

Yes. Set TRANSPORT_MODE=streamable-http to serve over HTTP (with optional TLS via MCP_TLS_CERT_FILE/MCP_TLS_KEY_FILE) for centralized deployments.

View repo Full Terraform MCP Server page