← Back to directory
T

tfmcp

Community
A local-first MCP server for Terraform.
Category
Dev Tools #60 of 438
Stars
★ 372 Very popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Rust 1.88.0+ · Prebuilt binary · Docker
Credentials
Optional API key
License
MIT
Last commit
Tools
82
64FMRS · C

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

Reliability
10/20
Security and permissions
14/20
Maintenance
12/20
Documentation
15/20
Setup experience
13/20
Why each score
Reliability 10/20
The supplied materials describe stdio and Streamable HTTP transports, MCP initialization and discovery methods, structured results, sessions, and error handling; the README also lists 82 tools and many external dependencies. However, no source code, CI workflows, or verifiable committed tests are provided to establish startup, handshake, tool behavior, or failure-path correctness. The broad declared surface cannot be cross-checked statically. Under the static calibration this remains at or below 12, with deductions for reproducibility, edge-case coverage, and dependency control evidence.
Security and permissions 14/20
The evidence shows apply/destroy and HCP/TFE write operations are disabled by default, with explicit operation and auto-approve gates, resource limits, directory validation, audit logging, sensitive logging disabled by default, organization allowlisting, Origin/Host validation, rate limits, and TLS configuration. TFE_TOKEN is marked secret and request-scoped credential overrides are rejected. Still, no source evidence proves these controls cover every path, and the materials do not clearly establish interactive confirmation for each destructive action, sensitive-output isolation, or an authentication model for remote HTTP. TFE_SKIP_TLS_VERIFY and extensive state/variable access also retain risk. No red-line issue is shown, but the score is reduced because the permission boundaries cannot be fully verified.
Maintenance 12/20
The repository is not archived, uses the MIT license, reports version 0.2.2, documents a release process with version synchronization and contribution checks, and reports zero open issues. This supports active versioning and a basic maintenance path. The supplied material does not provide commit cadence, CI status, dependency update history, a vulnerability response channel, or a clearly identified maintainer, and the README says the project remains under active development. A high sustained-maintenance score is therefore not justified.
Documentation 15/20
The README provides Cargo, source, and Docker installation paths; Claude Desktop configuration examples; categorized tools; resources; environment variables; security defaults; HTTP endpoints; troubleshooting; and a release process. Coverage is strong. Deductions apply because tool parameters and result/error contracts are incomplete, authentication, cost, platform compatibility, and operational limitations are only partly documented, and many capabilities are declarations without source or runtime evidence. Docker mount/permission behavior and automatic sample-project creation also lack deeper risk documentation.
Setup experience 13/20
Cargo, source, and Docker installation paths are provided, along with a Claude Desktop stdio configuration and a Streamable HTTP example. The basic connection flow is clear and defaults use a local directory and loopback binding. Setup is still dependent on Rust, a specified Terraform CLI, a client, and possibly Docker; Docker mounts and permissions require manual handling, remote HTTP authentication and production deployment are incompletely described, and no verifiable cross-platform or connection tests are supplied.

Static review · not runListed 2026-08-14

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesRuns commands or codeUses the networkChanges third-party account data

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.

Not for

  • Situations requiring infrastructure changes without human review.
  • Users without Terraform CLI or a usable Terraform project directory.
  • Production environments that cannot tolerate active-development software.

Required permissions

  • Read and operate on the Terraform project directory specified by TERRAFORM_DIR.
  • Access the Terraform CLI available in PATH.
  • Use configured TFE_ADDRESS and TFE_TOKEN for HCP Terraform/Terraform Enterprise queries.
  • Use appropriate Terraform or HCP/TFE permissions when write operations are enabled.

Risks and side effects

  • Apply and destroy are disabled by default but can change or destroy infrastructure when enabled.
  • Auto-approve is disabled by default; enabling it reduces manual confirmation.
  • Incorrect directories, credentials, permissions, or AI-generated plans can cause unintended changes.
  • Misconfigured Streamable HTTP can broaden network exposure; TFE_TOKEN and TLS private keys are sensitive.
  • The project is under active development, so review all operations before production use.

Setup

Before you start

Runtime:Rust 1.88.0+ · Prebuilt binary · Docker

TFE_TOKEN optionalsecret API token for HCP Terraform/TFE; generate it in your HCP Terraform account settings.
MCP_TLS_KEY_FILE optionalsecret PEM private key file for HTTPS Streamable HTTP.
Other optional settings (28)
TERRAFORM_DIR optional Terraform project directory to operate on; falls back to CLI args, config file, or ~/terraform.
TFMCP_LOG_LEVEL optional Log verbosity: debug, info, warn, or error.
TFMCP_DEMO_MODE optional Set to true to enable demo mode with extra safety features.
ENABLE_TF_OPERATIONS optional Set to true to unlock gated HCP Terraform/TFE write tools; disabled by default.
TFMCP_ALLOW_DANGEROUS_OPS optional Set to true to allow infrastructure-changing operations like apply/destroy; default false.
TFMCP_ALLOW_AUTO_APPROVE optional Set to true to allow auto-approve for dangerous operations; default false.
TFMCP_MAX_RESOURCES optional Maximum number of manageable resources; default 50.
TFMCP_AUDIT_ENABLED optional Set to false to disable audit logging; enabled by default.
TFMCP_AUDIT_LOG_FILE optional Custom audit log path; default ~/.tfmcp/audit.log.
TFMCP_AUDIT_LOG_SENSITIVE optional Set to true to include sensitive info in audit logs; default false.
TFE_ADDRESS optional HCP Terraform or Terraform Enterprise base URL; default https://app.terraform.io.
TFE_SKIP_TLS_VERIFY optional Set to true only for trusted private TFE installations with custom TLS.
TFE_MAX_RESPONSE_BYTES optional Max HCP/TFE response bytes returned to MCP clients before truncation; default 65536.
TRANSPORT_MODE optional MCP transport mode: stdio (default) or streamable-http.
TRANSPORT_HOST optional HTTP bind host for streamable-http mode; default 127.0.0.1.
TRANSPORT_PORT optional HTTP bind port for streamable-http mode; default 8080.
MCP_ENDPOINT optional Streamable HTTP MCP endpoint path; default /mcp.
MCP_HEALTH_ENDPOINT optional Health endpoint path; default /health.
MCP_METRICS_ENDPOINT optional OTel-compatible JSON metrics endpoint path; default /metrics.
MCP_SESSION_MODE optional stateful (default) or stateless; applies only to clients negotiating pre-2026-07-28 protocol versions.
MCP_HEARTBEAT_INTERVAL optional SSE keep-alive interval in seconds; 0 disables; default 15.
MCP_CORS_MODE optional CORS policy: strict (default), development, or disabled.
MCP_ALLOWED_ORIGINS optional Comma-separated allowed browser origins; defaults to loopback origins.
MCP_ALLOWED_HOSTS optional Comma-separated allowed HTTP Host values; defaults to rmcp loopback hosts.
MCP_ORGANIZATION_ALLOWLIST optional Comma-separated HCP/TFE organization names remote requests may access.
MCP_RATE_LIMIT_GLOBAL optional Max HTTP requests per minute server-wide; 0 or unset disables.
MCP_RATE_LIMIT_SESSION optional Max HTTP requests per minute per MCP session; 0 or unset disables.
MCP_TLS_CERT_FILE optional 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.

claude_desktop_config.json
{"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.

.vscode/mcp.json
{
  "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).

Terminal
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.

Check that it works

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.

Troubleshooting

  1. Verify the executable path and confirm Terraform CLI is installed and available in PATH.
  2. Check that TERRAFORM_DIR points to the intended project.
  3. If Claude Desktop cannot connect, inspect its MCP server log.
  4. When using Docker, verify volume mounts, paths, and permissions.
  5. For method-not-found errors, confirm the client is using MCP methods implemented by the server.

Things to try

Once connected, you can ask your AI assistant things like:

  • Inspect my Terraform project for likely root module entrypoints and analyze the configuration quality.
  • Generate an execution plan for the current project and give me risk scoring with recommendations.
  • Search the Terraform Registry for the AWS provider and show its latest version and docs.
  • Check the current state for drift candidates and list all managed resources.

Tools 82

init_terraform writes
Initialize the Terraform working directory.
get_terraform_plan read-only
Generate and show an execution plan.
analyze_plan read-only
Analyze a plan with risk scoring and recommendations.
apply_terraform destructive
Apply a Terraform configuration.
destroy_terraform destructive
Destroy Terraform-managed infrastructure.
validate_terraform read-only
Validate configuration syntax.
validate_terraform_detailed read-only
Run detailed validation with guidelines.
get_terraform_state read-only
Show the current state.
Show 74 more tools
analyze_state read-only
Analyze state and detect drift.
review_terraform_plan read-only
Review plan risks, blockers, and destructive changes.
summarize_plan_for_pr read-only
Generate a plan summary for PR comments.
run_terraform_quality_checks read-only
Run validation, module health, guideline, and lockfile checks.
inspect_state_safety read-only
Inspect state readability, drift risk, and blockers.
detect_drift_candidates read-only
Detect drift candidates without modifying infrastructure.
prepare_terraform_change read-only
Generate blockers, warnings, and a recommended change sequence.
list_terraform_resources read-only
List managed resources.
set_terraform_directory writes
Change the active project directory.
terraform_workspace writes
Manage Terraform workspaces.
terraform_import writes
Import existing resources.
terraform_taint writes
Taint or untaint resources.
terraform_refresh writes
Refresh state.
terraform_fmt writes
Format Terraform code.
terraform_graph read-only
Generate a dependency graph.
terraform_output read-only
Get output values.
terraform_providers read-only
Get provider and lockfile information.
check_provider_lockfile read-only
Check reproducible provider selections in the lockfile.
analyze_terraform read-only
Analyze Terraform configuration.
inspect_terraform_project read-only
Inspect local Terraform directories, modules, and entrypoints.
detect_terraform_entrypoints read-only
Detect likely root module entrypoints.
analyze_module_health read-only
Analyze module health, cohesion, and coupling.
get_resource_dependency_graph read-only
Get the resource dependency graph.
suggest_module_refactoring read-only
Suggest module refactoring.
get_security_status read-only
Run security scanning and secret detection.
search_providers read-only
Search providers.
search_terraform_providers read-only
Search Terraform providers.
get_provider_details read-only
Get provider details.
get_provider_info read-only
Get provider information.
get_provider_docs read-only
Get provider documentation.
get_provider_capabilities read-only
Get provider resources, data sources, functions, and guides.
search_modules read-only
Search modules.
search_terraform_modules read-only
Search Terraform modules.
get_module_details read-only
Get module details.
get_latest_module_version read-only
Get the latest module version.
get_latest_provider_version read-only
Get the latest provider version.
search_policies read-only
Search Sentinel/OPA policy libraries.
get_policy_details read-only
Get policy library details.
get_token_permissions read-only
Inspect token account details without exposing the token.
list_terraform_orgs read-only
List visible organizations.
list_terraform_projects read-only
List projects in an organization.
list_workspaces read-only
List workspaces in an organization.
get_workspace_details read-only
Get workspace details by ID or organization/name.
list_runs read-only
List workspace runs.
get_run_details read-only
Get run details.
get_plan_details read-only
Get plan details.
get_plan_logs read-only
Get plan logs.
get_plan_json_output
Get Terraform JSON plan output.
get_apply_details read-only
Get apply details.
get_apply_logs read-only
Get apply logs.
get_workspace_policy_sets read-only
Get policy sets attached to a workspace.
list_workspace_variables read-only
List workspace variables.
list_variable_sets read-only
List organization variable sets.
read_workspace_tags read-only
Read workspace tags.
list_stacks read-only
List Terraform stacks.
get_stack_details read-only
Get stack details.
search_private_modules read-only
Search private registry modules.
get_private_module_details read-only
Get private module details.
search_private_providers read-only
Search private registry providers.
get_private_provider_details read-only
Get private provider details.
create_workspace writes
Create a workspace when gated operations are enabled.
update_workspace writes
Update workspace settings when gated operations are enabled.
delete_workspace_safely destructive
Safely delete a workspace when gated operations are enabled.
create_run writes
Queue a run when gated operations are enabled.
action_run destructive
Apply, discard, cancel, or execute a run when gated operations are enabled.
create_workspace_variable writes
Create a workspace variable when gated operations are enabled.
update_workspace_variable writes
Update a workspace variable when gated operations are enabled.
attach_policy_set_to_workspace writes
Attach a policy set to a workspace when gated operations are enabled.
create_variable_set writes
Create a variable set when gated operations are enabled.
create_variable_in_variable_set writes
Create a variable in a variable set when gated operations are enabled.
delete_variable_in_variable_set destructive
Delete a variable from a variable set when gated operations are enabled.
attach_variable_set_to_workspaces writes
Attach a variable set to workspaces when gated operations are enabled.
detach_variable_set_from_workspaces writes
Detach a variable set from workspaces when gated operations are enabled.
create_workspace_tags writes
Create or attach workspace tags when gated operations are enabled.

Use cases

Read, validate, format, and analyze Terraform configurations.
Generate, review, and summarize Terraform plans.
Perform safety-gated local Terraform apply, destroy, and state operations.
Query Terraform Registry, HCP Terraform, and Terraform Enterprise.

Supported clients

Claude Desktop

Listed from the project's documentation, not tested by this site.

Overview

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.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 63.3k · Tools 2 Compare with this →

Source revision 3f6324ff91cf Data synced 2026-10-19 Read the FMRS scoring method