Back to Home
hashicorp icon

terraform-mcp-server

Verified Safe

by hashicorp

Overview

The Terraform MCP Server provides seamless integration with Terraform Registry APIs and HCP Terraform/Terraform Enterprise, enabling AI assistants (LLMs) to generate high-quality Terraform code and automate IaC workflows.

Installation

Run Command
docker run -i --rm hashicorp/terraform-mcp-server:0.3.3

Environment Variables

  • TFE_ADDRESS
  • TFE_TOKEN
  • TFE_SKIP_TLS_VERIFY
  • TRANSPORT_MODE
  • TRANSPORT_HOST
  • TRANSPORT_PORT
  • MCP_ENDPOINT
  • MCP_SESSION_MODE
  • MCP_ALLOWED_ORIGINS
  • MCP_CORS_MODE
  • MCP_TLS_CERT_FILE
  • MCP_TLS_KEY_FILE
  • MCP_RATE_LIMIT_GLOBAL
  • MCP_RATE_LIMIT_SESSION
  • ENABLE_TF_OPERATIONS

Security Notes

The project implements good security practices including CORS configuration with allowed origins, TLS support for HTTP transport (required for non-localhost), and clear warnings against using with untrusted clients/LLMs. Sensitive values like TFE_TOKEN are expected via environment variables and are explicitly prevented from being passed via URL query parameters. Rate limiting is also implemented. The default Docker base image uses 'scratch' for a smaller attack surface. Some tools are marked as 'destructive' but require explicit enablement via `ENABLE_TF_OPERATIONS` environment variable and user confirmation for critical actions, but the overall security relies on the calling LLM's adherence to these confirmations.

Similar Servers

Stats

Interest Score100
Security Score8
Cost ClassMedium
Avg Tokens750
Stars1086
Forks111
Last Update2025-12-05

Tags

TerraformIaCAutomationMCPAI/LLMHashiCorpRegistry