Best for
- Teams using HCP Terraform or Terraform Enterprise
- Developers integrating Terraform into IDEs like VS Code and Cursor
- DevOps engineers automating IaC workflows
An official Terraform MCP server with comprehensive features, dual transport support, and broad client compatibility. Requires HCP Terraform or Terraform Enterprise credentials. Security considerations are important; use trusted MCP clients.
Strongest · Documentation 16/20 Weakest · Reliability 8/20
Static review · not runListed 2026-08-07
Read the FMRS scoring method →Runtime:Docker · Go
TFE_TOKEN
HCP Terraform / Terraform Enterprise API token for authenticating requests; generate it in your TFE user settings.
TF_MCP_SHARED_SECRET
Shared secret sent as the X-Tf-Mcp-Secret header to identify hosted deployments; set by the deployment operator, TLS only.
TFE_ADDRESS
Base URL of HCP Terraform or Terraform Enterprise, default https://app.terraform.io; see your TFE admin console.
TFE_SKIP_TLS_VERIFY
Set to true to skip TLS verification against HCP Terraform / TFE; testing only.
LOG_LEVEL
Logging level (trace/debug/info/warn/error/fatal/panic), default info.
LOG_FORMAT
Log format, text or , default text.
TRANSPORT_MODE
Set to streamable-http to enable HTTP transport; default stdio.
TRANSPORT_HOST
Host the HTTP server binds to, default 127.0.0.1; set 0.0.0.0 in containers.
TRANSPORT_PORT
HTTP server port, default 8080.
MCP_ENDPOINT
HTTP endpoint path, default /mcp.
MCP_REDIRECT_ROOT_URL
URL to redirect requests to / to.
MCP_KEEP_ALIVE
Keep-alive interval for SSE connections, e.g. 30s or 1m; 0 disables.
MCP_SESSION_MODE
Session mode, stateful or stateless; default stateful.
MCP_ALLOWED_ORIGINS
Comma-separated CORS allowed origins.
MCP_CORS_MODE
CORS mode: strict, development, or disabled; default strict.
MCP_TLS_CERT_FILE
Path to TLS cert file, required for non-localhost deployments.
MCP_TLS_KEY_FILE
Path to TLS key file, required for non-localhost deployments.
MCP_RATE_LIMIT_GLOBAL
Global rate limit, format rps:burst, default 10:20.
MCP_RATE_LIMIT_SESSION
Per-session rate limit, format rps:burst, default 5:10.
MCP_ORGANIZATION_ALLOWLIST
CSV list of HCP Terraform organization names allowed to access the HTTP server.
MCP_FORWARD_CLIENT_IP
Set to true to forward the client IP to TFE via X-Forwarded-For.
MCP_REMOTE_IP_METHOD
Client IP sourcing method: RemoteAddr, X-Real-IP, or X-Forwarded-For.
MCP_XFF_TRUSTED_HOPS
Number of trusted proxy hops counted from the right of the X-Forwarded-For chain.
ENABLE_TF_OPERATIONS
Set to true to enable Terraform execution tools requiring explicit approval.
OTEL_METRICS_ENABLED
Set to true to enable OTel tools and server metrics.
OTEL_METRICS_SERVICE_VERSION
Version identifier for metrics, default latest.
OTEL_METRICS_SERVICE_NAME
Metrics source identifier, default terraform-mcp-server.
OTEL_METRICS_EXPORT_INTERVAL
Metric flush frequency, default 2.
OTEL_METRICS_ENDPOINT
OTel Collector or backend URL, default localhost:4318.
INSTANA_ENABLED
Enable Instana instrumentation (metrics and HTTP tracing); requires a reachable Instana agent.
INSTANA_SERVICE_NAME
Service name in Instana, default terraform-mcp-server.
SSL_CERT_FILE
Path to a corporate CA certificate, used to fix certificate errors from TLS inspection proxies like Zscaler.
Run via Docker: docker run -i --rm hashicorp/terraform-mcp-server:1.2.0. Configure with TFE_ADDRESS and TFE_TOKEN environment variables. Alternatively, install from source: go install github.com/hashicorp/terraform-mcp-server/cmd/terraform-mcp-server@latest.
Run docker run -i --rm hashicorp/terraform-mcp-server:1.2.0 and confirm the server's Terraform tools (e.g., provider search tools) appear in your client's tool list; in streamable-http mode, curl http://localhost:8080/health to confirm the server is healthy.
Once connected, you can ask your AI assistant things like:
The Terraform MCP Server is an official MCP integration that seamlessly connects with Terraform Registry APIs, enabling advanced automation and interaction for Infrastructure as Code (IaC) development. It supports dual transports (Stdio and StreamableHTTP), full workspace management, organization/project listing, private registry access, and optional Terraform execution tools.
Upstash's official server providing up-to-date third-party library docs for AI coding assistants
AI-powered NPM package analysis MCP server
An independent control layer that gives AI coding agents budgets, brakes, and receipts
GitHub's official MCP server for managing repos, issues, PRs, and workflows via natural language
Source revision 66e223d8ba74 Data synced 2026-10-12 Read the FMRS scoring method