Skip to content
Terraform

Terraform

MPL-2.0
terraformhashicorpinfrastructure-as-codedevopsiaccloud

Summary

HashiCorp's official MCP server for the Terraform Registry, HCP Terraform and Terraform Enterprise — providers, modules, policies and workspace operations.

Features

  • Look up real provider, module and policy schemas from the Terraform Registry
  • HCP Terraform and Terraform Enterprise workspace create, update and delete
  • Manage workspace variables, tags and runs
  • List organisations and projects; reach the private registry
  • Both stdio and StreamableHTTP transports, stateful or stateless
  • OpenTelemetry metrics for tool-call volume, latency and failures

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it.
  3. Restart the agent — the "Terraform" tools will be available.
{
  "mcpServers": {
    "terraform": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "hashicorp/terraform-mcp-server:0.2.3"
      ]
    }
  }
}

Description

HashiCorp's official MCP server for infrastructure-as-code work. It puts the Terraform Registry and, optionally, your HCP Terraform or Terraform Enterprise organisation behind a tool interface, so an agent writing HCL can look up what actually exists instead of inventing provider arguments that do not.

Registry lookups are the point

Most agent-authored Terraform fails the same way: a plausible resource attribute that no version of the provider ever had. Direct integration with the public Terraform Registry APIs for providers, modules, and policies turns that guess into a lookup — the agent can check the real schema, find a module that fits, and cite the version it read.

Workspace operations

With TFE_ADDRESS and TFE_TOKEN configured, the server extends to HCP Terraform and Terraform Enterprise: creating, updating, and deleting workspaces, managing variables, tags, and runs, listing organisations and projects, and reaching private registry content alongside the public one.

Transports and operations

Both stdio and StreamableHTTP transports are supported, with configurable host, port, endpoint path, CORS, and stateful or stateless session modes — so the same binary serves a local desktop client and a hosted deployment. In HTTP mode it exports OpenTelemetry metrics for tool-call volume, latency, and failures, which is what you want before letting agents drive infrastructure at any scale.

Operating notes

HashiCorp is explicit that the server may surface Terraform data to whichever client and model you connect, and recommends against untrusted clients. Outputs are generated dynamically and vary by model and client, so review recommendations against your own security, cost, and compliance requirements before applying them. Distributed as a Docker image; the pinned tag shown in the docs at time of writing is 0.2.3.

Related MCP Servers

MCP: Grafana

by Grafana Labs

New

Official Grafana MCP server: search and edit dashboards, query Prometheus, Loki and Pyroscope, and work with alerts, incidents and on-call from an agent.

Cloud & Infrastructure

MCP: Netlify

by Netlify

New

Netlify's official MCP server, wrapping the Netlify API and CLI so agents can create projects, deploy, manage secrets, extensions and access controls.

Cloud & Infrastructure

MCP: DigitalOcean

by DigitalOcean

New

DigitalOcean's official MCP server — deploy apps and manage Droplets, databases, and storage conversationally.

Cloud & Infrastructure

MCP: Heroku

by Heroku

New

Heroku's official MCP server — manage apps, dynos, add-ons, config, and logs from an AI client.

Cloud & Infrastructure
Browse all MCP servers →