Skip to content
Skillpedia
βœ“ Official Β· HashiCorp● Free and open sourceπŸ’» LocalπŸ”“ No API keyCloud and servers

Terraform MCP Server

Lets your AI agent use Terraform Registry data and manage HCP Terraform and Terraform Enterprise workspaces.

1.6k stars on GitHubby HashiCorpLicense MPL-2.0Updated 18 days ago

How to install

This MCP is local: it runs on your computer.

It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Code…). Choose your app:

Paste in the terminal:

claude mcp add terraform -- docker run -i --rm -e "TFE_ADDRESS=<address>" -e "TFE_TOKEN=<token>" -e "ENABLE_TF_OPERATIONS=<enabled>" docker.io/hashicorp/terraform-mcp-server:1.4.1

Ready! Now test it

Restart the app and paste one of these requests in the chat:

Find the latest AWS provider resource for an S3 bucket and write the Terraform.
Create a new workspace called staging-network in my HCP Terraform organization.

What it is

The Terraform MCP Server connects your AI agent to the Terraform Registry, so it can look up providers, modules and policies and write more accurate Terraform. It also connects to HCP Terraform and Terraform Enterprise to manage workspaces, variables, tags and runs.

What it can do

  • Terraform Registry lookups for providers, modules and policies
  • Create, update and delete HCP Terraform workspaces
  • Manage workspace variables, tags and runs
  • List organizations and projects
  • Private registry access
  • OpenTelemetry metrics on tool usage in HTTP mode

When to use

  • β€ΊWhen you want your agent to write Terraform using current provider documentation.
  • β€ΊWhen you want to manage HCP Terraform workspaces from chat.
  • β€ΊWhen you want to review runs and variables across projects.

What you need

Docker installed and running, plus an AI app that supports MCP. For HCP Terraform or Terraform Enterprise you also need a TFE_TOKEN (and TFE_ADDRESS for Enterprise).

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

Frequently asked questions

Is it official?

Yes, it is the Terraform MCP Server from HashiCorp (the readme refers to IBM in its legal note).

Do I need a token?

A TFE_TOKEN is needed for HCP Terraform or Terraform Enterprise features. Public Registry lookups use public Terraform Registry APIs.

Which transports are supported?

Stdio (the default) and StreamableHTTP.

Is it safe to use with any model?

The readme warns that Terraform data may be exposed to the MCP client and LLM, so do not use it with untrusted clients or LLMs.

Should I trust its output?

The readme says outputs are generated dynamically and should be reviewed against your security, cost and compliance requirements.

Can I turn tools off?

Yes. There are --toolsets and --tools options, and a tool filtering section in the readme.

If it does not work

  • β€ΊMake sure Docker is installed and running before starting the server.
  • β€ΊSet TFE_TOKEN (and TFE_ADDRESS with https:// for Enterprise) for HCP Terraform features.
  • β€ΊBehind a corporate proxy with TLS inspection, see the readme's troubleshooting section; TFE_SKIP_TLS_VERIFY is available.

5 new skills a week. 1 minute to read.