Server profile

Terraform MCP Server

Connect MCP assistants to Terraform Registry data and HCP Terraform or Terraform Enterprise. It supports infrastructure research, private registry access, and workspace operations with selectable tools and deployment transports.

Server facts

Terraform MCP Server

Project

Author
hashicorp
License
MPL-2.0

Tech

Runtime / language
goGo
Transports
stdio
Remote available
No
Authentication
Not specified

Activity

GitHub stars
1,550
Last commit
Data as of

Tags

  • Go
  • Infrastructure As Code
  • Terraform
  • Terraform Registry
  • Workspace Management

Overview

Terraform MCP Server brings Terraform information and platform operations into assistant-driven infrastructure workflows. It integrates with public Registry APIs for providers, modules, and policies, while also connecting to HCP Terraform and Terraform Enterprise. The README describes organization and project listing, private registry access, and workspace management. This makes the server relevant both when researching infrastructure components and when working with an existing Terraform platform environment.

Workspace capabilities include creating, updating, and deleting workspaces, plus handling variables, tags, and runs. Tool filtering allows deployments to select groups or individual operations rather than exposing the entire surface. Operations requiring explicit approval are controlled by a separate setting that defaults to disabled. The documentation also warns that queried Terraform data may be passed to the client and language model, and recommends reviewing generated recommendations against security, cost, and compliance requirements before implementation.

The server supports stdio and streamable HTTP. Docker examples cover common assistant clients, and Go installation is documented for a native executable. Platform address and token settings configure HCP Terraform or Enterprise access. HTTP settings include session behavior, allowed origins, TLS files, organization restrictions, and rate limits. Optional OpenTelemetry metrics report tool activity and HTTP behavior in network mode. The README links out to a fuller tool reference; the supplied text itself names provider search and detail tools in a filtering example but does not provide the complete catalog.

Install & configure

Requirements

  • Docker installed and running
  • An MCP-compatible assistant
Documented launch / install command
docker run -i --rm hashicorp/terraform-mcp-server

This command is the README's local Claude Code Docker launch. HCP Terraform or Enterprise access additionally uses TFE_ADDRESS and TFE_TOKEN, which must be forwarded into the container as shown in the README's client-specific examples. Public Registry use and platform access are distinct configurations.

Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.

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

Read the Claude Desktop setup guide

Config file · Project: .cursor/mcp.json

User: ~/.cursor/mcp.json

The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.

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

Read the Cursor setup guide

Config file · Workspace: .vscode/mcp.json

For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.

VS Code configuration
{
  "servers": {
    "terraform-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "hashicorp/terraform-mcp-server"
      ],
      "env": {}
    }
  }
}

Read the VS Code setup guide

Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json

Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json

Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.

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

Read the Windsurf setup guide

Config file · Project scope: .mcp.json at the repository root

The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.

Claude Code configuration
{
  "mcpServers": {
    "terraform-mcp-server": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "hashicorp/terraform-mcp-server"
      ],
      "env": {}
    }
  }
}

Read the Claude Code setup guide

Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.

Tools

Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.

ToolWhat it does
search_providersSearch Terraform providers; named in the README's tool-filtering example.
get_provider_detailsRetrieve provider details; named in the README's tool-filtering example.

Names, permissions, and defaults can change. Check the current upstream documentation before granting access.

Use cases

  • Look up provider and module information while drafting Terraform configuration.
  • Access private registry information for an existing organization.
  • Manage Terraform workspaces, variables, tags, and runs.
  • Expose selected Terraform capabilities to a shared HTTP MCP client.

Strengths

  • Combines public Registry access with HCP Terraform and Enterprise integration.
  • Supports local stdio and configurable streamable HTTP.
  • Offers tool selection and optional OpenTelemetry metrics.

Limitations

  • Connected clients and models may receive sensitive Terraform data.
  • Write-capable platform operations need deliberate permission and tool configuration.
  • The complete tool catalog is linked externally rather than included in the supplied README.

Frequently asked questions

No. The README also documents HCP Terraform and Terraform Enterprise workspace and private registry features.

Stdio and streamable HTTP are documented.

Yes. The server accepts toolset and individual-tool filters.

Optional OpenTelemetry metrics cover tool calls, failures, and durations, plus HTTP metrics in streamable HTTP mode.

Independent listing, not an affiliation or security review. Grant the least access needed and verify the upstream instructions before running code.

Related MCP servers

Unla MCP Gateway

MCP Gateways & Proxies

Unla is a Go gateway that exposes existing APIs and MCP servers through MCP endpoints using configuration. It includes a management interface, recoverable sessions, multi-tenant support, and deployment options for containers or Kubernetes.

EdgeOne Makers MCP

Cloud & DevOps

EdgeOne Makers MCP publishes full-stack projects and gives users a public address for the result. A separate hosted connection handles lightweight HTML previews without running the package locally.

Open Source MCP Servers for AWS

Cloud & DevOps

This AWS Labs repository collects specialized MCP servers for AWS documentation, cloud development, and operational workflows. It is a suite to choose from rather than one server exposing a single fixed tool catalog.

Cloudflare MCP Server

Cloud & DevOps

Cloudflare MCP Server is a collection of product-specific remote servers for Cloudflare accounts. It brings configuration, logs, analytics, documentation, and selected management workflows into compatible AI clients.

Kubernetes MCP Server

Cloud & DevOps

Give MCP assistants direct Kubernetes and OpenShift API access. The native Go server supports resource operations, pod diagnostics, Helm releases, and Tekton tasks, with configurable restrictions and multi-cluster support.

MCP Server Kubernetes

Cloud & DevOps

MCP Server Kubernetes lets assistants inspect and manage clusters through kubectl-oriented tools. It covers resources, logs, rollouts, Helm releases, port forwarding, and diagnostics using an existing Kubernetes context.

kubectl-mcp-server

Cloud & DevOps

kubectl-mcp-server connects assistants to Kubernetes inspection and management workflows. It covers pod diagnostics, deployments, networking, Helm, security reviews, resource analysis, and optional dashboards.

Cloud Run MCP Server

Cloud & DevOps

Cloud Run MCP Server connects agents to application deployment and service inspection on Google Cloud Run. It offers a local credential-based setup, Gemini CLI integration, and authenticated remote operation with specific limits.