Terraform MCP Assistant
Provides a natural language interface to Terraform operations, enabling infrastructure management, deployment, state inspection, and plan visualization using simple English commands.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Terraform MCP AssistantShow me the current state"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
# Terraform MCP Assistant
A FastMCP-based server that provides natural language interface to Terraform operations. This assistant allows you to manage your infrastructure using simple English commands instead of remembering specific Terraform syntax.
Features
Natural language processing of Terraform commands
Execution plan visualization
State inspection and management
Infrastructure deployment and destruction
Configuration documentation
Automatic workspace validation
Error handling and formatted output
Related MCP server: mcp-server-terraform
Installation
Clone the repository:
git clone https://github.com/yourusername/terraform-mcp-server.git
cd terraform-mcp-serverCreate and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtOptional: Install Graphviz for plan visualization:
Windows: Download from Graphviz Download Page
Linux:
sudo apt-get install graphvizmacOS:
brew install graphviz
Configuration
Set up environment variables (optional):
export TERRAFORM_WORKSPACE="/path/to/terraform/workspace"
export LOG_LEVEL="INFO"Place your Terraform configuration files in the workspace directory.
Usage
Start the MCP server:
python src/main.pyExample commands:
"Initialize the Terraform workspace"
"What will change if I apply?"
"Show me the current state"
"Apply the configuration"
"List all resources"
"Destroy the infrastructure"
Project Structure
terraform-mcp-assistant/
├── docs/ # Documentation
├── examples/ # Example Terraform configurations
├── src/ # Source code
│ ├── handlers/ # Command handlers
│ ├── main.py # Entry point
│ └── config.py # Configuration management
├── tests/ # Test files
├── .env # Environment variables (not in VCS)
└── README.md # This fileDevelopment
Install development dependencies:
pip install -r requirements-dev.txtRun tests:
pytestContributing
Fork the repository
Create a feature branch
Commit your changes
Push to the branch
Create a Pull Request
This server cannot be deployed
Maintenance
Related MCP Connectors
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
MCP server for generating rough-draft project plans from natural-language prompts.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for managing Terraform infrastructure as code, enabling initialization, planning, applying, destroying, validating, and showing state of Terraform configurations.1MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that exposes Terraform CLI operations as tools for Claude and other MCP-compatible AI assistants, enabling AI-driven infrastructure-as-code workflows including planning, applying, and validating Terraform configurations.21 npmMIT
- AlicenseAqualityAmaintenanceA Model Context Protocol (MCP) server that lets Claude manage Terraform infrastructure through natural language.1130 npm1MIT
- FlicenseNot gradedqualityBmaintenanceAutomatically generates, validates, and deploys remote MCP servers from natural language descriptions, with a web dashboard for management.-