MCP Catalogs
Hometfmcp screenshot

tfmcp

by nwiizo·364·Score 52

tfmcp is a comprehensive Terraform MCP server enabling AI assistants to manage infrastructure with 31 specialized tools.

ops-infradeveloper-toolssecurity
28
Forks
0
Open issues
2 mo ago
Last commit
2d ago
Indexed

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:

you:AI assistant managing Terraform infrastructure through natural language commands
you:Infrastructure as Code analysis and refactoring recommendations
you:Automated Terraform plan review and risk assessment
you:Workspace management across multiple environments
you:Terraform module search and integration assistance
you:How do I enable dangerous operations like terraform apply?
you:Where are the audit logs stored?

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 README
  • init_terraform

    Initialize Terraform working directory

  • get_terraform_plan

    Generate and show execution plan

  • apply_terraform

    Apply Terraform configuration

  • destroy_terraform

    Destroy Terraform-managed infrastructure

  • validate_terraform

    Validate configuration syntax

  • analyze_plan

    Analyze plan with risk scoring and recommendations

  • terraform_workspace

    Manage Terraform workspaces (list, show, new, select, delete)

  • terraform_import

    Import existing resources into Terraform state

  • analyze_terraform

    Analyze Terraform configuration

  • terraform_graph

    Generate dependency graph of Terraform resources

  • search_terraform_modules

    Search Terraform modules in the registry

  • get_security_status

    Perform security scan with secret detection

Comparable tools

mcp-terraformmcp-infraterraform-shell

Installation

Installation

From Crates.io

cargo install tfmcp

Using Docker

git clone https://github.com/nwiizo/tfmcp
cd tfmcp
docker build -t tfmcp .
docker run -it tfmcp

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

Compare tfmcp with

GitHub →

Last updated · Auto-generated from public README + GitHub signals.