PlugWiki
Terraform logo

Terraform MCP Server: Setup for Claude, Cursor and Other Apps

OfficialRemoteLocal
GetDockerhashicorp/terraform-mcp-serverhashicorp/terraform-mcp-server

Lets your assistant look up Terraform providers and modules, and manage HCP Terraform or Terraform Enterprise workspaces and runs.

This is HashiCorp's own server. With no sign-in it gives 9 read-only tools for the public Terraform Registry. With an HCP Terraform or Terraform Enterprise API token it adds tools to manage your account.

Run it on your computer with Docker, or use HashiCorp's hosted server with your token in a header. Tools that delete things or approve runs stay off until you set ENABLE_TF_OPERATIONS to true.

Good for

  • Engineers writing Terraform who want current provider and module docs in the assistant
  • Platform teams managing HCP Terraform workspaces, variables and runs
  • Reviewers who want a plan or apply log read and summarised

Works in

14 should work

Tap an app to see how to set it up and any known problems.

Install Terraform MCP

Claude Code

  1. 1

    Copy this prompt.

    Add the Terraform MCP server to Claude Code. Run this command:
    
    claude mcp add --transport http terraform https://mcp.terraform.io/mcp --header "Authorization: Bearer <TFE_TOKEN>"
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires API token.

Read-only mode: Leave out the token to load only the 9 public registry tools, and do not set ENABLE_TF_OPERATIONS. To keep a token but expose only registry tools, add `--toolsets registry` after the image name.

Docker runs the server on your machine. Add -e TFE_ADDRESS=<address> for Terraform Enterprise or a non-default HCP Terraform address. The hosted server needs an HCP Terraform or Terraform Enterprise API token sent as a Bearer header. Without a token only the 9 public registry tools load. Keep the token out of shared config files.

Built from the package data we hold. Not yet tested by us.

Tools

  • Finds provider documentation

    Looks up documentation pages in the public Terraform Registry for a provider service, such as resources, data sources, functions and guides, and returns their IDs and titles.

    Try: “Find the docs for the aws_s3_bucket resource in the AWS provider.”

    Network · search_provider_docs

  • Reads one provider doc page

    Returns the full text of one provider documentation page. You get the page ID from search_provider_docs first.

    Try: “Show me how to configure versioning on an S3 bucket.”

    Network · get_provider_details

  • Gets a provider's newest version

    Returns the latest published version of a provider in the public registry.

    Try: “What is the latest version of the hashicorp/google provider?”

    Network · get_latest_provider_version

  • Lists what a provider supports

    Lists the resource types, data sources, functions and guides that a provider offers, so you can see what exists before looking up one.

    Try: “What resources does the Azure provider support for networking?”

    Network · get_provider_capabilities

  • Searches public modules

    Searches the public registry for modules by name or purpose and returns matches with download counts and verification status. It also gives the module ID that get_module_details needs.

    Try: “Find popular modules for a Kubernetes cluster on AWS.”

    Network · search_modules

  • Reads a module's docs

    Returns a module's documentation: inputs, outputs, examples and submodules. Run search_modules first to get the ID.

    Try: “Show the inputs and outputs of the terraform-aws-modules/vpc module.”

    Network · get_module_details

  • Gets a module's newest version

    Returns the latest published version of a public registry module.

    Try: “What is the newest version of the aws vpc module?”

    Network · get_latest_module_version

  • Searches Sentinel policies

    Searches the registry for Sentinel governance policies by topic and returns IDs, names and download counts.

    Try: “Find Sentinel policies that enforce encryption on storage.”

    Network · search_policies

  • Reads a policy's docs

    Returns the documentation for one registry policy. Run search_policies first to get its ID.

    Try: “Explain how the first policy you found is used.”

    Network · get_policy_details

  • Searches your private modules

    Searches the private registry of your HCP Terraform or Terraform Enterprise organisation for modules. It needs a token.

    Try: “Search our private registry for a network module.”

    Network · search_private_modules

  • Reads a private module

    Returns a private module's inputs, outputs, dependencies, versions, submodules and usage examples.

    Try: “Show how to use our private rds module.”

    Network · get_private_module_details

  • Searches your private providers

    Searches your organisation's private registry for providers.

    Try: “List our private providers.”

    Network · search_private_providers

Read from the source code

Permissions

high risk · 5 things to watch

High risk

With a token, the assistant can change HCP Terraform: create workspaces, edit variables, start runs and delete variables from a variable set. Use a token that is limited to what you need, leave ENABLE_TF_OPERATIONS off, and start without a token if you only want registry docs.

What it can do

Watch out for

  • A token lets it delete a variable and change workspaces

    With a token, delete_variable_in_variable_set is on even without ENABLE_TF_OPERATIONS, and so are the tools that create, edit and tag workspaces and start runs. Use a token limited to the organisation or workspaces you need. github.com

  • ENABLE_TF_OPERATIONS adds delete and apply tools

    Setting it to true turns on delete_project, delete_team, delete_workspace_safely, force_unlock_workspace and action_run (approve and apply). It also lets create_run auto-approve and destroy. Leave it off unless you review every call. github.com

  • All toolsets load by default

    The README says the default toolset is registry, but the code in the current release defaults the flag to all. A token therefore turns on every account tool unless you pass --toolsets registry. github.com

  • Logs, plans and state can contain secrets

    get_plan_logs, get_apply_logs, get_plan_json_output and get_state_version return raw content from your infrastructure. The README warns the server may expose Terraform data to the client and model, so do not use untrusted clients. github.com

  • Docker with a token puts it in your config file

    The Docker setup passes the token with -e in your client config. Keep that file private, or pass the token from the environment. github.com

Security advisories

No published security advisories as of Nov 1, 2026.

Technical details
Turning on read-onlyLeave TFE_TOKEN unset, or start the server with --toolsets registry, so only the 9 public registry tools load. Tools such as delete_workspace_safely, delete_team, delete_project, force_unlock_workspace and action_run also stay off unless ENABLE_TF_OPERATIONS=true. With a token and no flag, create and edit tools remain on.
Talks toregistry.terraform.io (public registry tools). app.terraform.io or the address in TFE_ADDRESS (account tools). mcp.terraform.io if you use the hosted server
Sign-in and keysThe token sits in your client config, or in the TFE_TOKEN environment variable. For the hosted server it is sent as a Bearer header.
Scopes
  • HCP Terraform or Terraform Enterprise API token (TFE_TOKEN): whatever that token can do, so use a team or user token with limited access

  • No token needed for the 9 public registry tools

Questions

Is the Terraform MCP server official?

Yes. HashiCorp publishes it from its own GitHub organisation and ships the Docker image hashicorp/terraform-mcp-server. The README links HashiCorp's Terraform docs for the tool reference.

What is the Terraform MCP server URL?

The hosted server is at https://mcp.terraform.io/mcp. The README sends your HCP Terraform or Terraform Enterprise token in an Authorization Bearer header.

Do I need a Terraform account or token?

No for the 9 public registry tools. Yes for everything else: you need an HCP Terraform or Terraform Enterprise API token, and for Terraform Enterprise also its address.

Can it delete my workspaces?

Only if you set ENABLE_TF_OPERATIONS to true. That turns on delete_workspace_safely, which refuses to delete a workspace that still manages resources. With a token it can already delete a variable from a variable set.

Can it apply changes to my infrastructure?

It can start runs with a token. Approving a run needs ENABLE_TF_OPERATIONS. In the default mode create_run cannot auto-approve or destroy.

Can I make it read-only?

Mostly. Start it without a token, or with --toolsets registry, for the public registry tools only. There is no flag that keeps the account tools but removes all writes.

Should I use the hosted server or Docker?

Both need the same token for account tools. Docker runs on your machine, so it also works with Terraform Enterprise behind your firewall. The hosted server needs no Docker, and the README documents it for clients that can send a header.

Does it list all 61 tools to my assistant?

Not always. The 9 registry tools load without a token. The 4 private registry tools and 48 account tools need a token, and 5 of those also need ENABLE_TF_OPERATIONS.

Information

updated Nov 2, 2026

Publisher
Official
Package
hashicorp/terraform-mcp-server
Registry
Docker
Transport
stdio, Streamable HTTP
Auth
API key
Version
1.4.1
License
MPL-2.0
Last commit
Oct 30, 2026
Open issues
11
Listed in
Official MCP registry, Docker MCP Catalog

GitHubDockerOfficial MCP RegistryChangelogIssues

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 6
  1. README.md · github.com
  2. registry.go · github.com
  3. toolsets.go · github.com
  4. commands.go · github.com
  5. factories.go · github.com
  6. reference · developer.hashicorp.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.