Best for
- Developers who need AI-assisted Terraform project and plan inspection.
- Users managing local Terraform directories through Claude Desktop.
- Teams needing plan-risk, state-drift, module-health, or security checks.
An unofficial MIT-licensed Terraform MCP server with broad capabilities and default-off dangerous operations, audit logging, directory protections, and remote-access security controls. It is suitable for inspection and assisted operations, but infrastructure writes require human plan review.
Strongest · Documentation 15/20 Weakest · Reliability 10/20
Static review · not runListed 2026-08-14
Read the FMRS scoring method →Runtime:Rust 1.88.0+ · Prebuilt binary · Docker
TFE_TOKEN
API token for HCP Terraform/TFE; generate it in your HCP Terraform account settings.
MCP_TLS_KEY_FILE
PEM private key file for HTTPS Streamable HTTP.
TERRAFORM_DIR
Terraform project directory to operate on; falls back to CLI args, config file, or ~/terraform.
TFMCP_LOG_LEVEL
Log verbosity: debug, info, warn, or error.
TFMCP_DEMO_MODE
Set to true to enable demo mode with extra safety features.
ENABLE_TF_OPERATIONS
Set to true to unlock gated HCP Terraform/TFE write tools; disabled by default.
TFMCP_ALLOW_DANGEROUS_OPS
Set to true to allow infrastructure-changing operations like apply/destroy; default false.
TFMCP_ALLOW_AUTO_APPROVE
Set to true to allow auto-approve for dangerous operations; default false.
TFMCP_MAX_RESOURCES
Maximum number of manageable resources; default 50.
TFMCP_AUDIT_ENABLED
Set to false to disable audit logging; enabled by default.
TFMCP_AUDIT_LOG_FILE
Custom audit log path; default ~/.tfmcp/audit.log.
TFMCP_AUDIT_LOG_SENSITIVE
Set to true to include sensitive info in audit logs; default false.
TFE_ADDRESS
HCP Terraform or Terraform Enterprise base URL; default https://app.terraform.io.
TFE_SKIP_TLS_VERIFY
Set to true only for trusted private TFE installations with custom TLS.
TFE_MAX_RESPONSE_BYTES
Max HCP/TFE response bytes returned to MCP clients before truncation; default 65536.
TRANSPORT_MODE
MCP transport mode: stdio (default) or streamable-http.
TRANSPORT_HOST
HTTP bind host for streamable-http mode; default 127.0.0.1.
TRANSPORT_PORT
HTTP bind port for streamable-http mode; default 8080.
MCP_ENDPOINT
Streamable HTTP MCP endpoint path; default /mcp.
MCP_HEALTH_ENDPOINT
Health endpoint path; default /health.
MCP_METRICS_ENDPOINT
OTel-compatible JSON metrics endpoint path; default /metrics.
MCP_SESSION_MODE
stateful (default) or stateless; applies only to clients negotiating pre-2026-07-28 protocol versions.
MCP_HEARTBEAT_INTERVAL
SSE keep-alive interval in seconds; 0 disables; default 15.
MCP_CORS_MODE
CORS policy: strict (default), development, or disabled.
MCP_ALLOWED_ORIGINS
Comma-separated allowed browser origins; defaults to loopback origins.
MCP_ALLOWED_HOSTS
Comma-separated allowed HTTP Host values; defaults to rmcp loopback hosts.
MCP_ORGANIZATION_ALLOWLIST
Comma-separated HCP/TFE organization names remote requests may access.
MCP_RATE_LIMIT_GLOBAL
Max HTTP requests per minute server-wide; 0 or unset disables.
MCP_RATE_LIMIT_SESSION
Max HTTP requests per minute per MCP session; 0 or unset disables.
MCP_TLS_CERT_FILE
PEM certificate file for HTTPS Streamable HTTP.
Install Rust 1.88.0 or newer and Terraform CLI 1.15.8, then install tfmcp with Cargo or build it from source. Replace the executable path and optional TERRAFORM_DIR in the configuration with actual values, save it in the Claude Desktop configuration file, and restart Claude Desktop. Docker is also supported.
{"mcpServers":{"tfmcp":{"command":"/path/to/your/tfmcp","args":["mcp"],"env":{"HOME":"/Users/yourusername","PATH":"/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin","TERRAFORM_DIR":"/path/to/your/terraform/project"}}}}
Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.
{
"servers": {
"tfmcp": {
"command": "/path/to/your/tfmcp",
"args": [
"mcp"
],
"env": {
"HOME": "/Users/yourusername",
"PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
"TERRAFORM_DIR": "/path/to/your/terraform/project"
}
}
}
}
Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).
claude mcp add tfmcp -e HOME=/Users/yourusername -e PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin -e TERRAFORM_DIR=/path/to/your/terraform/project -- /path/to/your/tfmcp mcp
Run it in a terminal; replace any <…> placeholders with your own values first.
After setup, tfmcp's 82 tools (e.g. init_terraform, analyze_plan) should appear in Claude Desktop's tool list. You can also run `tfmcp --help` to confirm the CLI works, or hit http://127.0.0.1:8080/health in streamable-http mode.
Once connected, you can ask your AI assistant things like:
No matching tools
Listed from the project's documentation, not tested by this site.
tfmcp is an experimental command-line MCP server that lets AI assistants read and analyze Terraform configurations and plans, perform configuration and state workflows, and query public or private Terraform registries. It supports stdio and Streamable HTTP, plus read-only HCP Terraform/Terraform Enterprise tools and safety-gated write tools. The project remains under active development.
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 3f6324ff91cf Data synced 2026-10-19 Read the FMRS scoring method