Terraform Cloud APIs, repackaged for LLM chatter
It exposes Terraform Registry and HCP Terraform to MCP-compatible AI assistants so you can query modules, manage workspaces, and trigger runs from chat.
What it does The Terraform MCP Server acts as a protocol bridge between MCP-compatible AI assistants and the Terraform ecosystem. It forwards requests to the public Terraform Registry for provider and module metadata, and to HCP Terraform or Terraform Enterprise for workspace management, variables, and run control. The server supports both Stdio and StreamableHTTP transports, so it can operate as a local sidecar or a small networked service.
The interesting bit
This is essentially an API adapter that lets an LLM act like an infrastructure operator. It ships with default behavioral instructions—because letting a model guess how to modify your state files is a bad idea—and allows you to override them with your own instructions.md before building. It also emits OpenTelemetry metrics on tool calls and latency, which implies HashiCorp expects it to handle more than just idle experimentation.
Key highlights
- Registry lookups: queries public Terraform Registry APIs for providers, modules, and policies.
- Workspace control: full CRUD on HCP Terraform / Terraform Enterprise workspaces, plus variables, tags, and run management.
- Transport flexibility: Stdio for local agents, StreamableHTTP for remote use, with configurable CORS, TLS, and rate limits.
- Agent context: recognizes an
AGENTS.mdfile in your Terraform directory to give coding agents project-specific instructions. - Observability: optional OTel metrics for tool-call volume, latency, and failures in HTTP mode.
Caveats
- The README labels this as local-use only; running the HTTP transport without restricting
MCP_ALLOWED_ORIGINSopens you to DNS rebinding and cross-origin attacks. - Server queries may expose Terraform data to the underlying LLM, so untrusted clients or models are explicitly discouraged.
- Generated outputs vary by model and client, and the README warns you to review all recommendations before implementing them.
Verdict A useful experiment if you already use HCP Terraform and want to let Cursor, Claude, or Copilot poke at your infrastructure. Avoid it if you need a polished, production-grade AI operator—the security notes make it clear this is still early and cautious tooling.
Frequently asked
- What is hashicorp/terraform-mcp-server?
- It exposes Terraform Registry and HCP Terraform to MCP-compatible AI assistants so you can query modules, manage workspaces, and trigger runs from chat.
- Is terraform-mcp-server open source?
- Yes — hashicorp/terraform-mcp-server is open source, released under the MPL-2.0 license.
- What language is terraform-mcp-server written in?
- hashicorp/terraform-mcp-server is primarily written in Go.
- How popular is terraform-mcp-server?
- hashicorp/terraform-mcp-server has 1.5k stars on GitHub.
- Where can I find terraform-mcp-server?
- hashicorp/terraform-mcp-server is on GitHub at https://github.com/hashicorp/terraform-mcp-server.