Unified MCP server for Infrastructure as Code management. Provides Model Context Protocol tools for managing infrastructure through Terraform/OpenTofu and Pulumi.
poly-iac-mcp exposes Infrastructure as Code capabilities through the Model Context Protocol (MCP), enabling AI assistants and other MCP clients to plan, apply, and manage infrastructure across multiple IaC platforms. FOSS-first: OpenTofu is preferred over Terraform when available.
Declarative infrastructure management (prefers OpenTofu):
-
terraform_init- Initialize a working directory -
terraform_plan- Generate and show an execution plan -
terraform_apply- Apply infrastructure changes -
terraform_destroy- Destroy infrastructure -
terraform_output- Show output values from state -
terraform_state_list- List resources in the state -
terraform_validate- Validate the configuration files -
terraform_fmt- Format configuration files -
terraform_version- Show Terraform/OpenTofu version
Infrastructure as Code using real programming languages:
-
pulumi_preview- Preview changes to infrastructure -
pulumi_up- Deploy infrastructure changes -
pulumi_destroy- Destroy infrastructure -
pulumi_stack_list- List all stacks -
pulumi_stack_select- Select a stack -
pulumi_stack_init- Create a new stack -
pulumi_stack_output- Get stack outputs -
pulumi_refresh- Refresh state from cloud -
pulumi_config_set- Set a configuration value -
pulumi_config_get- Get a configuration value -
pulumi_version- Show Pulumi version
This MCP server prefers open source alternatives:
-
OpenTofu is preferred over Terraform when both are available
-
Binary detection automatically selects the FOSS option first
git clone https://github.com/hyperpolymath/poly-iac-mcp
cd poly-iac-mcp
deno cache main.jsOr with Guix:
guix shell -D -f guix.scmRun as MCP server:
deno run --allow-run --allow-read --allow-env main.jsOr use the systemd service:
systemctl --user enable poly-iac-mcp
systemctl --user start poly-iac-mcp-
Never store cloud credentials in configuration files
-
Use environment variables or secret managers for sensitive values
-
Review plans carefully before applying changes
-
Enable state encryption for sensitive infrastructure
-
Use
--auto-approvewith caution
-
Plan and apply infrastructure changes
-
Manage multiple environments (dev, staging, prod) via stacks
-
Query infrastructure state and outputs
-
Validate and format configuration files
-
Compare planned changes before deployment