mcp-server-terraform
v0.1.0MCP server for Terraform infrastructure-as-code operations
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
terraform_plan
Preview changes Terraform will make to infrastructure without applying them. Shows added, changed, and destroyed resources.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
destroy | boolean | If true, show destroy plan instead of normal plan |
target | string | Target specific resource (e.g., aws_instance.web) |
var_file | string | Path to variables file |
vars | object | Variable values to pass (e.g., region=us-east-1) |
terraform_apply
Apply Terraform changes to create, update, or destroy infrastructure resources.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
auto_approve | boolean | Skip interactive approval (default: false — requires confirmation) |
target | string | Target specific resource |
var_file | string | Path to variables file |
vars | object | Variable values to pass |
terraform_destroy
Destroy all Terraform-managed infrastructure. Use with caution — this removes real resources.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
auto_approve | boolean | Skip interactive approval (default: false) |
target | string | Target specific resource to destroy |
var_file | string | Path to variables file |
vars | object | Variable values to pass |
terraform_init
Initialize a Terraform working directory. Downloads providers, modules, and configures the backend.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
backend_config | object | Backend configuration values |
reconfigure | boolean | Reconfigure the backend (discard previous state) |
upgrade | boolean | Upgrade providers and modules to latest compatible versions |
terraform_validate
Validate Terraform configuration files for syntax and internal consistency without contacting any remote services.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
terraform_state_list
List all resources tracked in the Terraform state file.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
id_pattern | string | Filter resources by ID pattern (supports glob) |
terraform_state_show
Show detailed attributes of a specific resource in the Terraform state.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
resource_id * | string | Resource ID in state (e.g., aws_instance.web) |
terraform_fmt
Reformat Terraform configuration files to canonical style (consistent indentation and alignment).
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
check | boolean | Check if files are formatted (don't modify, just report) |
recursive | boolean | Process files in subdirectories |
terraform_output
Show output values from the Terraform state. Outputs are defined in output blocks and often contain important resource attributes.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
json | boolean | Output in JSON format |
name | string | Show a specific output by name |
terraform_import
Import an existing infrastructure resource into Terraform state. Maps a real-world resource to a Terraform resource address.
| Parameter | Type | Description |
|---|---|---|
directory * | string | Working directory containing Terraform files |
resource_address * | string | Terraform resource address (e.g., aws_instance.web) |
resource_id * | string | ID of the existing resource to import (e.g., i-1234567890abcdef0) |