
tfmcp
by nwiizo·★ 364·Score 52
tfmcp is a comprehensive Terraform MCP server enabling AI assistants to manage infrastructure with 31 specialized tools.
Overview
tfmcp is a Rust-based command-line tool that extends Terraform capabilities through the Model Context Protocol. It provides comprehensive infrastructure management tools including configuration analysis, plan execution, state management, and workspace operations. The tool features robust security controls with configurable policies, audit logging, and operation restrictions, making it suitable for production environments. Its advanced analysis capabilities include module health scoring, dependency graph visualization, and compliance checking against Future Architect Terraform guidelines.
Try asking AI
After installing, here are 7 things you can ask your AI assistant:
When to choose this
Choose tfmcp when you need comprehensive Terraform management through AI assistants, especially if you're already using Claude Desktop and require enterprise-grade security features.
When NOT to choose this
Avoid tfmcp if you need MCP server support for cloud providers other than Terraform, or if you require write capabilities beyond Terraform operations.
Tools this server exposes
12 tools extracted from the READMEinit_terraformInitialize Terraform working directory
get_terraform_planGenerate and show execution plan
apply_terraformApply Terraform configuration
destroy_terraformDestroy Terraform-managed infrastructure
validate_terraformValidate configuration syntax
analyze_planAnalyze plan with risk scoring and recommendations
terraform_workspaceManage Terraform workspaces (list, show, new, select, delete)
terraform_importImport existing resources into Terraform state
analyze_terraformAnalyze Terraform configuration
terraform_graphGenerate dependency graph of Terraform resources
search_terraform_modulesSearch Terraform modules in the registry
get_security_statusPerform security scan with secret detection
Comparable tools
Installation
Installation
From Crates.io
cargo install tfmcpUsing Docker
git clone https://github.com/nwiizo/tfmcp
cd tfmcp
docker build -t tfmcp .
docker run -it tfmcpClaude Desktop Integration
Add to ~/Library/Application Support/Claude/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"
}
}
}
}FAQ
- How do I enable dangerous operations like terraform apply?
- Set environment variable: TFMCP_ALLOW_DANGEROUS_OPS=true. For auto-approval, also set TFMCP_ALLOW_AUTO_APPROVE=true.
- Where are the audit logs stored?
- By default, audit logs are stored at ~/.tfmcp/audit.log. You can customize the path with TFMCP_AUDIT_LOG_FILE.
On Hacker News
Recent discussion from the developer community.
- Story by lockedinspace · 2025-04-22
Compare tfmcp with
Last updated · Auto-generated from public README + GitHub signals.