Back to Glossary Index
Core ConceptInfrastructure-as-code tooling, external to the MCP spec itself

Terraform (MCP infrastructure)

Industry Definition Set • Entity Resolution Path: /glossary/terraform-mcp

Quick Answer / TL;DR

A declarative infrastructure-as-code CLI tool that an MCP server can wrap to let an AI agent propose plan output for human review, with apply gated behind an explicit approval flag rather than run automatically.

Key Takeaways

  • No first-party SDK exists - integrations wrap the CLI itself via a child process, restricted to an allowlisted set of directories.
  • plan is safe to expose freely since it's read-only; apply should require an explicit approval flag set only after a human reviews the plan.
  • Remote state backends with locking (e.g. S3 + DynamoDB) prevent concurrent applies from corrupting state.
Definitive Statement: A declarative infrastructure-as-code CLI tool that an MCP server can wrap to let an AI agent propose plan output for human review, with apply gated behind an explicit approval flag rather than run automatically.

Technical Context & Protocol Usage

Detailed Explanation
Terraform has no first-party Node SDK, so an MCP integration wraps the terraform CLI itself via a child process, restricted to an allowlist of working directories so a model can't be steered into operating against an unintended state file. The safe pattern splits plan (read-only, safe to call freely) from apply (requires an explicit approved: true argument the model can only set after a human has actually reviewed the plan output) - never letting a single tool call both propose and execute a change in one turn.

Format & Payload Metadata

Format: HCL configuration files, executed via the terraform CLI

Latency: Seconds to minutes per plan/apply, dependent on the number of resources involved

Real-World Implementation Use Case

An MCP tool runs terraform plan in an allowlisted directory and returns the diff for the user to review before a separate apply tool (requiring approved: true) is ever called.

M
MCPserver.in Engineering

Platform Team

Published: 2026-07-21
Updated: 2026-07-21

References & Technical Specifications

Cite This Page

MLA Style:

MCPserver.in Engineering. "Terraform (MCP infrastructure)." MCPserver.in Knowledge Hub, 21 July 2026, mcpserver.in/glossary/terraform-mcp.