Skip to content

hyperpolymath/poly-iac-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poly-iac-mcp

RSR Compliant MCP Server License

Unified MCP server for Infrastructure as Code management. Provides Model Context Protocol tools for managing infrastructure through Terraform/OpenTofu and Pulumi.

Overview

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.

Adapters

Terraform/OpenTofu (9 tools)

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

Pulumi (11 tools)

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

Requirements

FOSS-First Philosophy

This MCP server prefers open source alternatives:

  • OpenTofu is preferred over Terraform when both are available

  • Binary detection automatically selects the FOSS option first

Installation

git clone https://github.com/hyperpolymath/poly-iac-mcp
cd poly-iac-mcp
deno cache main.js

Or with Guix:

guix shell -D -f guix.scm

Usage

Run as MCP server:

deno run --allow-run --allow-read --allow-env main.js

Or use the systemd service:

systemctl --user enable poly-iac-mcp
systemctl --user start poly-iac-mcp

Security Considerations

  • 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-approve with caution

Use Cases

  • 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

License

MIT

About

Unified MCP server for Infrastructure as Code. Tools for OpenTofu, Terraform, and Pulumi.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •