$git clone https://github.com/nwiizo/tfmcp*⚠️ This project includes production-ready security features but is still under active development. While the security system provides robust protection, please review all operations carefully in production environments. ⚠️*
| 1 | # tfmcp: Terraform Model Context Protocol Tool |
| 2 | |
| 3 | [](https://archestra.ai/mcp-catalog/nwiizo__tfmcp) |
| 4 | |
| 5 | *⚠️ This project includes production-ready security features but is still under active development. While the security system provides robust protection, please review all operations carefully in production environments. ⚠️* |
| 6 | |
| 7 | tfmcp is a command-line tool that helps you interact with Terraform via the Model Context Protocol (MCP). It allows LLMs to manage and operate your Terraform environments, including: |
| 8 | |
| 9 | ## 🎮 Demo |
| 10 | |
| 11 | See tfmcp in action with Claude Desktop: |
| 12 | |
| 13 |  |
| 14 | |
| 15 | - Reading Terraform configuration files |
| 16 | - Analyzing Terraform plan outputs |
| 17 | - Applying Terraform configurations |
| 18 | - Managing Terraform state |
| 19 | - Creating and modifying Terraform configurations |
| 20 | |
| 21 | ## 🎉 Latest Release |
| 22 | |
| 23 | The latest version of tfmcp (v0.1.9) is now available on Crates.io! You can easily install it using Cargo: |
| 24 | |
| 25 | ```bash |
| 26 | cargo install tfmcp |
| 27 | ``` |
| 28 | |
| 29 | ### 🆕 What's New in v0.1.9 |
| 30 | - **📊 Plan Analysis**: Structured plan analysis with risk scoring and recommendations |
| 31 | - **🔍 State Analysis**: Deep state inspection with drift detection |
| 32 | - **📁 Workspace Management**: Full terraform workspace support (list, show, new, select, delete) |
| 33 | - **📥 Import Helper**: Guided resource import with config generation |
| 34 | - **✨ Code Formatting**: terraform fmt integration |
| 35 | - **🔗 Dependency Graph**: terraform graph visualization with DOT output |
| 36 | - **📤 Output Management**: terraform output access |
| 37 | - **🏷️ Taint/Untaint**: Resource taint management (with deprecation notices for 1.5+) |
| 38 | - **🔄 State Refresh**: Explicit state refresh operations |
| 39 | - **📦 Provider Info**: Detailed provider information with lock file parsing |
| 40 | - **🦀 Rust Edition 2024**: Migrated to Rust Edition 2024 (requires Rust 1.85.0+) |
| 41 | |
| 42 | ## Features |
| 43 | |
| 44 | - 🚀 **Terraform Integration** |
| 45 | Deeply integrates with the Terraform CLI to analyze and execute operations. |
| 46 | |
| 47 | - 📄 **MCP Server Capabilities** |
| 48 | Runs as a Model Context Protocol server, allowing AI assistants to access and manage Terraform. |
| 49 | |
| 50 | - 🔬 **Module Health Analysis** |
| 51 | Whitebox approach to Infrastructure as Code with cohesion/coupling analysis, health scoring, and refactoring suggestions based on software engineering principles. |
| 52 | |
| 53 | - 📊 **Resource Dependency Graph** |
| 54 | Visualize resource relationships including explicit depends_on and implicit reference dependencies. |
| 55 | |
| 56 | - 📦 **Module Registry Integration** |
| 57 | Search and explore Terraform modules from the registry, get module details and versions. |
| 58 | |
| 59 | - 🔐 **Enterprise Security** |
| 60 | Production-ready security controls with configurable policies, audit logging, and access restrictions. |
| 61 | |
| 62 | - 📊 **Advanced Analysis** |
| 63 | Detailed Terraform configuration analysis with best practice recommendations and security checks. |
| 64 | |
| 65 | - 📋 **Guideline Compliance** (v0.1.8) |
| 66 | Future Architect Terraform guidelines integration with compliance scoring, secret detection, and variable quality checks. |
| 67 | |
| 68 | - ⚡️ **Blazing Fast** |
| 69 | High-speed processing powered by the Rust ecosystem with optimized parsing and caching. |
| 70 | |
| 71 | - 🛠️ **Automatic Setup** |
| 72 | Automatically creates sample Terraform projects when needed, ensuring smooth operation even for new users. |
| 73 | |
| 74 | - 🐳 **Docker Support** |
| 75 | Run tfmcp in a containerized environment with all dependencies pre-installed. |
| 76 | |
| 77 | ## Installation |
| 78 | |
| 79 | ### From Source |
| 80 | ```bash |
| 81 | # Clone the repository |
| 82 | git clone https://github.com/nwiizo/tfmcp |
| 83 | cd tfmcp |
| 84 | |
| 85 | # Build and install |
| 86 | cargo install --path . |
| 87 | ``` |
| 88 | |
| 89 | ### From Crates.io |
| 90 | ```bash |
| 91 | cargo install tfmcp |
| 92 | ``` |
| 93 | |
| 94 | ### Using Docker |
| 95 | ```bash |
| 96 | # Clone the repository |
| 97 | git clone https://github.com/nwiizo/tfmcp |
| 98 | cd tfmcp |
| 99 | |
| 100 | # Build the Docker image |
| 101 | docker build -t tfmcp . |
| 102 | |
| 103 | # Run the container |
| 104 | docker run -it tfmcp |
| 105 | ``` |
| 106 | |
| 107 | ## Requirements |
| 108 | |
| 109 | - Rust (edition 2021) |
| 110 | - Terraform CLI installed and available in PATH |
| 111 | - Claude Desktop (for AI assistant integration) |
| 112 | - Docker (optional, for containerized deployment) |
| 113 | |
| 114 | ## Usag |