terraform-mcp-server

MCP.Pizza Chef: hashicorp

This tool connects your AI assistant to the Terraform Registry and to HCP Terraform or Terraform Enterprise accounts, so it can look up official provider and module documentation, create and manage cloud infrastructure workspaces, and handle variables, tags, and deployment runs on your behalf. It works inside Claude Desktop, Cursor, and VS Code. Registry lookups need no account, but managing real workspaces requires a Terraform Enterprise or HCP Terraform account token, and setup involves running the tool through Docker.

Coding

Use This MCP server To

Look up documentation for a Terraform provider or module Create, update, or delete a cloud infrastructure workspace Check which variables and tags are set on my workspace List the organizations and projects in my Terraform account Search for verified modules before starting a new project Review the status of an infrastructure deployment run

README

Terraform MCP Server

The Terraform MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with Terraform Registry APIs, enabling advanced automation and interaction capabilities for Infrastructure as Code (IaC) development.

Features

  • Dual Transport Support: Both Stdio and StreamableHTTP transports with configurable endpoints
  • Terraform Registry Integration: Direct integration with public Terraform Registry APIs for providers, modules, and policies
  • HCP Terraform & Terraform Enterprise Support: Full workspace management, organization/project listing, and private registry access
  • Workspace Operations: Create, update, delete workspaces with support for variables, tags, and run management
  • OTel metrics for monitoring tool usage: Integration with open telemetry meters to track tool-call volume, latency and failures in Streamable HTTP mode. Also exposes default http server metrics when this feature is enabled

Security Note: Depending on the query, the MCP server may expose certain Terraform data to the MCP client and LLM. Do not use the MCP server with untrusted MCP clients or LLMs.

Legal Note: Your use of a third party MCP Client/LLM is subject solely to the terms of use for such MCP/LLM, and IBM is not responsible for the performance of such third party tools. IBM expressly disclaims any and all warranties and liability for third party MCP Clients/LLMs, and may not be able to provide support to resolve issues which are caused by the third party tools.

Caution: The outputs and recommendations provided by the MCP server are generated dynamically and may vary based on the query, model, and the connected MCP client. Users should thoroughly review all outputs/recommendations to ensure they align with their organization’s security best practices, cost-efficiency goals, and compliance requirements before implementation.

Prerequisites

  1. Ensure Docker is installed and running to use the server in a containerized environment.
  2. Install an AI assistant that supports the Model Context Protocol (MCP).

Command Line Options

Environment Variables:

terraform-mcp-server FAQ

Can I use this to look up Terraform provider documentation?
Yes — it connects directly to the official Terraform Registry, so your AI assistant (whether built on Claude, GPT, or Gemini) can pull up-to-date details on providers, modules, and policies as you work.
Can I use this to manage my cloud infrastructure workspaces?
Yes — once connected to your Terraform Enterprise or HCP Terraform account, it can create, update, and delete workspaces, and manage their variables, tags, and deployment runs.
Which apps does this work with?
It is built for AI assistants that support the Model Context Protocol, including Claude Desktop, Cursor, and VS Code.
Do I need an account or key to use this?
Looking up public registry information needs no account. Managing real workspaces or private modules requires a Terraform Enterprise or HCP Terraform account and an access token.
How hard is this to set up?
This one is built for developers — it runs through Docker or as a standalone program, and setup involves editing configuration files rather than a single click.
Will this change my infrastructure without asking me first?
No — operations that change real infrastructure are switched off by default and must be explicitly turned on, so your AI assistant cannot alter your cloud setup without permission.
Can I use this with AI models other than Claude?
Yes — it works with any AI assistant that supports the Model Context Protocol, including tools built on Claude, GPT, and Gemini.