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 "Install 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 SysOperator
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 installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/jashkahar/Terraform-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server