An open API service indexing awesome lists of open source software.

https://github.com/hyperpolymath/poly-iac-mcp

Unified MCP server for Infrastructure as Code. Tools for OpenTofu, Terraform, and Pulumi.
https://github.com/hyperpolymath/poly-iac-mcp

automation deno developer-tools infrastructure-as-code integration mcp mcp-server model-context-protocol my-coolest-projects opentofu orchestration poly-mcp pulumi systems terraform

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

          

= poly-iac-mcp
:toc:
:toc-placement!:

image:https://img.shields.io/badge/RSR-compliant-gold[RSR Compliant,link=https://github.com/hyperpolymath/rhodium-standard-repositories]
image:https://img.shields.io/badge/MCP-server-blue[MCP Server,link=https://github.com/modelcontextprotocol]
image:[License,link="https://github.com/hyperpolymath/palimpsest-license"]

// SPDX-License-Identifier: PMPL-1.0
// SPDX-FileCopyrightText: 2025 hyperpolymath

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

toc::[]

== 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

* https://deno.land/[Deno] runtime
* https://opentofu.org/[OpenTofu] or https://www.terraform.io/[Terraform] CLI (for Terraform tools)
* https://www.pulumi.com/[Pulumi] CLI (for Pulumi tools)

== 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

[source,bash]
----
git clone https://github.com/hyperpolymath/poly-iac-mcp
cd poly-iac-mcp
deno cache main.js
----

Or with Guix:

[source,bash]
----
guix shell -D -f guix.scm
----

== Usage

Run as MCP server:

[source,bash]
----
deno run --allow-run --allow-read --allow-env main.js
----

Or use the systemd service:

[source,bash]
----
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