tfmcp: Terraform Model Context Protocol Tool
⚠️ 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. ⚠️
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:
🎮 Demo
See tfmcp in action with Claude Desktop:

- Reading Terraform configuration files
- Analyzing Terraform plan outputs
- Applying Terraform configurations
- Managing Terraform state
- Creating and modifying Terraform configurations
🎉 Latest Release
The latest version of tfmcp (v0.1.9) is now available on Crates.io! You can easily install it using Cargo:
cargo install tfmcp🆕 What's New in v0.1.9
- 📊 Plan Analysis: Structured plan analysis with risk scoring and recommendations
- 🔍 State Analysis: Deep state inspection with drift detection
- 📁 Workspace Management: Full terraform workspace support (list, show, new, select, delete)
- 📥 Import Helper: Guided resource import with config generation
- ✨ Code Formatting: terraform fmt integration
- 🔗 Dependency Graph: terraform graph visualization with DOT output
- 📤 Output Management: terraform output access
- 🏷️ Taint/Untaint: Resource taint management (with deprecation notices for 1.5+)
- 🔄 State Refresh: Explicit state refresh operations
- 📦 Provider Info: Detailed provider information with lock file parsing
- 🦀 Rust Edition 2024: Migrated to Rust Edition 2024 (requires Rust 1.85.0+)






