Skip to main content
Glama
hashicorp

Terraform MCP Server

Official
by hashicorp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
LOG_LEVELNoLogging level: trace, debug, info, warn, error, fatal, panic (overrides --log-level flag)info
TFE_TOKENNoTerraform Enterprise API token
LOG_FORMATNoLogging format: text or json (overrides --log-format flag)text
TFE_ADDRESSNoSets the Terraform Enterprise/HCP Terraform address for API calls. Must include the protocol (e.g., https://app.terraform.io). In streamable-http mode this is the only way to set the address; it cannot be supplied by clients via header or query parameter.
MCP_ENDPOINTNoHTTP server endpoint path/mcp
MCP_CORS_MODENoCORS mode: strict, development, or disabledstrict
MCP_KEEP_ALIVENoKeep-alive interval for SSE connections (e.g., 30s, 1m). 0 to disable0
TRANSPORT_HOSTNoHost to bind the HTTP server127.0.0.1
TRANSPORT_MODENoSet to streamable-http to enable HTTP transport (legacy http value still supported)stdio
TRANSPORT_PORTNoHTTP server port8080
INSTANA_ENABLEDNoEnable Instana instrumentation (metrics and HTTP request tracing) for the streamable-http server. Requires an Instana agent that is reachable by the server.false
MCP_SESSION_MODENoSession mode: stateful or statelessstateful
MCP_TLS_KEY_FILENoPath to TLS key file, required for non-localhost deployment (e.g. /path/to/key.pem)
MCP_TLS_CERT_FILENoPath to TLS cert file, required for non-localhost deployment (e.g. /path/to/cert.pem)
MCP_ALLOWED_ORIGINSNoComma-separated list of allowed origins for CORS
TFE_SKIP_TLS_VERIFYNoSkip HCP Terraform or Terraform Enterprise TLS verificationfalse
ENABLE_TF_OPERATIONSNoEnable tools that require explicit approvalfalse
INSTANA_SERVICE_NAMENoIf Instana instrumentation is enabled, the service name to use for the MCP serverterraform-mcp-server
MCP_REMOTE_IP_METHODNoHow the client IP is sourced when forwarding is enabled: RemoteAddr (direct connection only), X-Real-IP, or X-Forwarded-ForRemoteAddr
MCP_XFF_TRUSTED_HOPSNoNumber of trusted proxy hops counted from the right of the X-Forwarded-For chain. Only used when MCP_REMOTE_IP_METHOD=X-Forwarded-For0
OTEL_METRICS_ENABLEDNoEnable tools and server metrics using otelfalse
TF_MCP_SHARED_SECRETNoShared secret sent as the X-Tf-Mcp-Secret header on requests to HCP Terraform / TFE, used to identify requests originating from a hosted MCP deployment. Should only be used over TLS.
MCP_FORWARD_CLIENT_IPNoForward the client IP to HCP Terraform / TFE via X-Forwarded-For. Set to true to enablefalse
MCP_RATE_LIMIT_GLOBALNoGlobal rate limit (format: rps:burst)10:20
MCP_REDIRECT_ROOT_URLNoURL to redirect requests to / to
OTEL_METRICS_ENDPOINTNoURL of your OTel Collector or backendlocalhost:4318
MCP_RATE_LIMIT_SESSIONNoPer-session rate limit (format: rps:burst)5:10
OTEL_METRICS_SERVICE_NAMENoIdentifies the source of the metrics (e.g., "terraform-mcp-server")terraform-mcp-server
MCP_ORGANIZATION_ALLOWLISTNoCSV list of HCP Terraform organization names allowed to access the HTTP server
OTEL_METRICS_EXPORT_INTERVALNoControls the frequency of metric flushes2
OTEL_METRICS_SERVICE_VERSIONNoVersion of the terraform-mcp-server sending metrics, which is used to set metric attributes. It also helps track metrics across different deploymentslatest

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Server capabilities have not been inspected yet.

Tools

Functions exposed to the LLM to take actions

NameDescription

No tools

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hashicorp/terraform-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server