==================
      
       /// MCP ///
      /// TFM ///
        
    ==================
        
    [server:online]
    [protocol:ready]

tfmcp

by nwiizo

Terraform Model Context Protocol (MCP) CLI/server that lets AI assistants analyse, plan and apply Terraform with enterprise-grade security.

328
20
Open Source

01

mcp

Launch tfmcp as a Model Context Protocol (MCP) server

02

analyze

Analyze Terraform configurations and provide validation and best-practice recommendations

03

help

Display help information for tfmcp or one of its subcommands

04

resources/list

Return a list of Terraform resources available in the current project via the MCP API

05

prompts/list

Return a list of available prompts/templates that can be used through the MCP API

06

set_terraform_directory

Change the active Terraform project directory at runtime

Installation

1. Prerequisites
• Rust tool-chain (stable, v1.74 or newer)
• Terraform CLI installed and on your PATH (v1.6+ recommended)
• A Unix-like shell or PowerShell
2. Install the CLI from crates.io
cargo install tfmcp
The installer will download, compile and place the binary under `~/.cargo/bin/tfmcp`.
3. Verify installation
tfmcp --help tfmcp --version
4. (Optional) Enable Claude Desktop integration
Set your Claude session token so the tool can ask Claude for plan reviews:
export CLAUDE_SESSION_TOKEN="<your_token>"
5. Initialise a Terraform workspace and let tfmcp create its context file
terraform init tfmcp context init # writes .tfmcp.toml
6. Typical workflow
tfmcp read-config . # parse *.tf files tfmcp plan . # run and store plan JSON tfmcp apply . # apply with safety checks tfmcp state push state.tfstate
7. Upgrading
cargo install tfmcp --force

Documentation

License: MIT License
Updated 7/30/2025

Table of Contents

tfmcp - MCP Server Registry - Augment Code