MCP Infrastructure as Code Assistant
@guilhermeyoshida
About MCP Infrastructure as Code Assistant
An MCP server for managing infrastructure as code using Terraform
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"mcp-terraform-assistant": {
"command": "uv",
"args": [
"pip",
"install",
"-e",
"."
]
}
}
}Tools
8Initialize a Terraform working directory
Generate and show an execution plan for Terraform
Apply the changes required to reach the desired state
Destroy the infrastructure managed by Terraform
Validate the syntax and internal consistency of Terraform files
Show the current state or a saved plan
List Terraform workspaces
Select a Terraform workspace
Overview
What is MCP Infrastructure as Code Assistant?
It is an MCP server for managing infrastructure as code with Terraform. It provides tools to initialize, plan, apply, destroy, validate, show state, and manage workspaces for Terraform configurations.
How to use MCP Infrastructure as Code Assistant?
Install using Python 3.8+ and Terraform 1.5.7+, either locally via uv or using Docker Compose. Start the server with python main.py or docker-compose up -d, then use the MCP CLI to call tools like mcp terraform_init or mcp terraform_apply.
Key features of MCP Infrastructure as Code Assistant
- Initialize Terraform working directories
- Generate and show execution plans
- Apply and destroy infrastructure changes
- Validate Terraform configurations
- Show current state or saved plans
- Manage Terraform workspaces
Use cases of MCP Infrastructure as Code Assistant
- AI-assisted Terraform infrastructure provisioning
- Automating Terraform workflows in CI/CD pipelines
- Managing multiple Terraform workspaces on the command line
- Validating Terraform configurations before deployment
- Applying changes to infrastructure with auto-approve
FAQ from MCP Infrastructure as Code Assistant
What are the prerequisites?
Python 3.8 or higher and Terraform 1.5.7 or higher are required. Docker and Docker Compose are optional for containerized usage.
How do I install the server?
You can install locally using uv (pip install -e .) or run via Docker Compose. See the installation section in the README.
What tools are available?
Tools include terraform_init, terraform_plan, terraform_apply, terraform_destroy, terraform_validate, terraform_show, terraform_workspace_list, and terraform_workspace_select.
How do I use it with an AI agent?
Start the MCP server, then connect using an MCP client. The AI agent can then perform Terraform operations via the available tools.
Does the server include example configurations?
Yes, the repository includes an example Terraform configuration for an AWS EC2 instance and additional examples in the examples directory.
Frequently asked questions
What are the prerequisites?
Python 3.8 or higher and Terraform 1.5.7 or higher are required. Docker and Docker Compose are optional for containerized usage.
How do I install the server?
You can install locally using uv (pip install -e .) or run via Docker Compose. See the installation section in the README.
What tools are available?
Tools include terraform_init, terraform_plan, terraform_apply, terraform_destroy, terraform_validate, terraform_show, terraform_workspace_list, and terraform_workspace_select.
How do I use it with an AI agent?
Start the MCP server, then connect using an MCP client. The AI agent can then perform Terraform operations via the available tools.
Does the server include example configurations?
Yes, the repository includes an example Terraform configuration for an AWS EC2 instance and additional examples in the `examples` directory.
Basic information
More Cloud & Infrastructure MCP servers
Run Model Context Protocol (MCP) servers with AWS Lambda
awslabsRun existing Model Context Protocol (MCP) stdio-based servers in AWS Lambda functions
Sample Serverless MCP Servers
aws-samplesSample implementations of AI Agents and MCP Servers running on AWS Serverless compute
🐳 docker-mcp
QuantGeekDevA docker MCP Server (modelcontextprotocol)
Mcp K8s Go
strowkMCP server connecting to Kubernetes
Comments