Basic information
About tfmcp: Terraform Model Context Protocol Tool MCP Server
🌍 Terraform Model Context Protocol (MCP) Tool - An experimental CLI tool that enables AI assistants to manage and operate Terraform environments. Supports reading Terraform configurations, analyzing plans, applying configurations, and managing state with Claude Desktop integrati
tfmcp: Terraform Model Context Protocol Tool is a MCP server in the Cloud & Infrastructure category listed in the AddMCP.net directory, published by nwiizo. Supported transport: stdio. Runtime: rust. License: MIT. The repository has 370 GitHub stars. Source code is hosted on github.com. Related topics: mcp, mcp-server, terraform.
Setup
{
"mcpServers": {
"tfmcp": {
"command": "docker",
"args": [
"build",
"-t",
"tfmcp",
"."
]
}
}
}
{
"mcpServers": {
"tfmcp": {
"command": "docker",
"args": [
"build",
"-t",
"tfmcp",
"."
]
}
}
}
{
"servers": {
"tfmcp": {
"command": "docker",
"args": [
"build",
"-t",
"tfmcp",
"."
]
}
}
}
tfmcp: Terraform Model Context Protocol Tool MCP Server config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"tfmcp": {
"command": "docker",
"args": [
"build",
"-t",
"tfmcp",
"."
]
}
}
}
tfmcp: Terraform Model Context Protocol Tool MCP Server tools
Tool list not available yet
This listing does not currently have a tool list to display. This does not mean the server has no tools; check its documentation for supported capabilities.
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is tfmcp: Terraform Model Context Protocol Tool?
tfmcp is a command-line tool that helps you interact with Terraform via the Model Context Protocol (MCP). It allows large language models (LLMs) to manage and operate your Terraform environments, including reading configurations, analyzing plans, applying changes, managing state, and creating or modifying Terraform configurations.
How to use tfmcp: Terraform Model Context Protocol Tool?
Install tfmcp with cargo install tfmcp or build from source, then run tfmcp mcp to launch it as an MCP server. To integrate with Claude Desktop, configure ~/Library/Application Support/Claude/claude_desktop_config.json pointing to the tfmcp executable with "args": ["mcp"]. You can specify a Terraform project directory via the -d flag, the TERRAFORM_DIR environment variable, or the set_terraform_directory tool at runtime.
Key features of tfmcp: Terraform Model Context Protocol Tool
- Deep Terraform CLI integration for analyzing and executing operations
- Runs as a Model Context Protocol server for AI assistants
- Module health analysis with cohesion/coupling metrics and refactoring suggestions
- Resource dependency graph visualization with dot output
- Security scanning with secret detection and configurable policies
- Production-ready audit logging and access restrictions
Use cases of tfmcp: Terraform Model Context Protocol Tool
- AI-assisted Terraform configuration creation and modification
- Automated plan analysis with risk scoring and recommendations
- Terraform state inspection and drift detection
- Module registry search and provider information retrieval
- Compliance checks against Terraform guidelines and best practices
Frequently asked questions
1 How do I install tfmcp?
Install via Cargo: cargo install tfmcp, or build from source with cargo install --path .. Docker support is also available by building the image from the repository.
2 How do I integrate tfmcp with Claude Desktop?
After installing, find the tfmcp binary path (which tfmcp), then add an mcpServers entry to your claude_desktop_config.json with the command and "args": ["mcp"]. Restart Claude Desktop and enable the tool.
3 How do I enable apply or destroy operations?
By default, dangerous operations (apply/destroy) are disabled. Set the environment variable TFMCP_ALLOW_DANGEROUS_OPS to true to enable them. Auto-approve can be enabled with TFMCP_ALLOW_AUTO_APPROVE.
4 Where can I find tfmcp logs?
Server logs are located at ~/Library/Logs/Claude/mcp-server-tfmcp.log. Audit logs (if enabled) are written to ~/.tfmcp/audit.log by default.
5 What are the runtime requirements?
You need Rust (edition 2021 or later) and the Terraform CLI installed and available in your PATH. Claude Desktop is optional but recommended for AI assistant integration. Docker is optional for containerized deployment.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In