# tfmcp

> MCP Client

tfmcp is a command-line tool that uses the Model Context Protocol to enable LLMs to manage Terraform environments, analyze configurations, and execute operations, leveraging the Terraform CLI. tfmcp is a

## Overview

- **Category:** Developer Tools
- **Language:** Rust
- **Stars:** 371
- **Forks:** 6
- **Owner:** nwiizo
- **GitHub:** https://github.com/nwiizo/tfmcp
- **Homepage:** https://crates.io/crates/tfmcp
- **Created:** 2025-03-08T14:10:29+00:00
- **Updated:** 2025-03-28T23:36:25+00:00
- **Source:** https://model-context-protocol.com/clients/terraform-ai-management-model-context-protocol

## Setup

## Setup

**From Source**
```bash
# Clone the repository
git clone https://github.com/nwiizo/tfmcp
cd tfmcp

# Build and install
cargo install --path .
```

**From Crates.io**
```bash
cargo install tfmcp
```

**Requirements**

- Rust (edition 2021)
- Terraform CLI installed and available in PATH
- Claude Desktop (for AI assistant integration)

**Integrating with Claude Desktop**

1. If you haven't already, install tfmcp:
   ```bash
   cargo install tfmcp
   ```

2. Find the path to your installed tfmcp executable:
   ```bash
   which tfmcp
   ```

3. Add the following configuration to `~/Library/Application\ Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "tfmcp": {
      "command": "/path/to/your/tfmcp",  // Replace with the actual path from step 2
      "args": ["mcp"],
      "env": {
        "HOME": "/Users/yourusername",  // Replace with your username
        "PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
        "TERRAFORM_DIR": "/path/to/your/terraform/project"  // Optional: specify your Terraform project
      }
    }
  }
}
```

4. Restart Claude Desktop and enable the tfmcp tool.

5. tfmcp will automatically create a sample Terraform project in `~/terraform` if one doesn't exist, ensuring Claude can start working with Terraform right away.

## Tools

## Available Tools

1. Terraform Integration (Deeply integrates with the Terraform CLI to analyze and execute operations).
2. MCP Server Capabilities (Runs as a Model Context Protocol server, allowing AI assistants to access and manage Terraform).
3. Blazing Fast (High-speed processing powered by the Rust ecosystem).
4. Automatic Setup (Automatically creates sample Terraform projects when needed, ensuring smooth operation even for new users).
5. Analyze Terraform configurations (Command-line tool to analyze Terraform configurations).
6. Launch tfmcp as an MCP server (Command-line tool to launch tfmcp as an MCP server).
