Terraform
Terraform is an MCP server that generates more accurate Terraform and automate workflows for HCP Terraform and Terraform Enterprise. It has 1,562 GitHub stars, is released under the MPL-2.0 license and runs locally with docker run -i --rm -e TFE_TOKEN docker.io/hashicorp/terraform-mcp-server:1.4.1.
github.com/hashicorp/terraform-mcp-server (opens in a new tab)
Data as of from the GitHub API and the official MCP registry; description from the project's repository. Report an error
- Official
- Needs API key
- Cloud & DevOps
- MPL-2.0
- Active
Install Terraform
Generated from the server's MCP registry entry. Replace your-value with your own values.
Claude Desktop
{
"mcpServers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"TFE_TOKEN",
"docker.io/hashicorp/terraform-mcp-server:1.4.1"
],
"env": {
"TFE_TOKEN": "your-value"
}
}
}
}Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.
Claude Code
claude mcp add --env TFE_TOKEN=your-value --transport stdio terraform -- docker run -i --rm -e TFE_TOKEN docker.io/hashicorp/terraform-mcp-server:1.4.1Cursor
{
"mcpServers": {
"terraform": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"TFE_TOKEN",
"docker.io/hashicorp/terraform-mcp-server:1.4.1"
],
"env": {
"TFE_TOKEN": "your-value"
}
}
}
}Project file; use ~/.cursor/mcp.json to enable it in every project.
VS Code
{
"inputs": [
{
"type": "promptString",
"id": "tfe_token",
"description": "TFE_TOKEN",
"password": true
}
],
"servers": {
"terraform": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"TFE_TOKEN",
"docker.io/hashicorp/terraform-mcp-server:1.4.1"
],
"env": {
"TFE_TOKEN": "${input:tfe_token}"
}
}
}
}Config formats checked against the official docs on Oct 7, 2026: modelcontextprotocol.io (opens in a new tab), code.claude.com (opens in a new tab), cursor.com (opens in a new tab), code.visualstudio.com (opens in a new tab).
Environment variables
Variables the server reads at startup.
| Name | Required | Description |
|---|---|---|
TFE_ADDRESS | No | HCP Terraform or Terraform Enterprise base URL. |
TFE_TOKENsecret | No | HCP Terraform or Terraform Enterprise API token used to authenticate requests. |
ENABLE_TF_OPERATIONS | No | Set to true to enable tools that execute Terraform operations requiring explicit approval. |
Tools (4)
Parsed from the Tools section of the README; check the repository for the current list.
error_codehttpstatus
unauthorized401
not_found404
conflict409
About Terraform
The Terraform MCP Server is a Model Context Protocol (MCP) server that integrates seamlessly with Terraform Registry and HCP Terraform APIs, enabling advanced automation and interaction capabilities for Infrastructure as Code (IaC) development.
Similar MCP servers
More cloud & devops MCP servers
MCP Server Kubernetes
Flux159/mcp-server-kubernetes
MCP Server for kubernetes management commands.
Active · last commit Nov 13, 2026
Cloud & DevOpsTypeScriptSuperlog
superloglabs/superlog
Open-source agent that observes and fixes your application.
Maintained · last commit Nov 11, 2026
OfficialCloud & DevOpsTypeScriptTerraVision
patrickchugh/terravision
Draw cloud architecture diagrams with official AWS, Azure and GCP icons from a prompt or Terraform.
Active · last commit Oct 31, 2026
Cloud & DevOpsPythonPrismerCloud
Prismer-AI/PrismerCloud
The Intelligence Runtime for AI Agents Where agents evolve, collaborate, and remember.
Active · last commit Oct 22, 2026
Cloud & DevOpsTypeScripthotpath-cloud
hotpath-rs/hotpath
Read-only access to Rust profiling reports from CI: benchmark history, diffs and policies.
Active · last commit Nov 16, 2026
OfficialCloud & DevOpsRustSearch2ai
fatwang2/search2ai
Self-hosted search gateway for AI agents.
Active · last commit Nov 11, 2026
Cloud & DevOpsTypeScript
How do I install the Terraform MCP server?
Add the command docker run -i --rm -e TFE_TOKEN docker.io/hashicorp/terraform-mcp-server:1.4.1 to your MCP client: put it in claude_desktop_config.json for Claude Desktop, run claude mcp add for Claude Code, or add it to .cursor/mcp.json (Cursor) or .vscode/mcp.json (VS Code). The snippets on this page are ready to paste.
Is Terraform free?
The server is open source under the MPL-2.0 license, so running it is free. It needs credentials (TFE_TOKEN) for the service it connects to, which may require a paid account.
Is Terraform actively maintained?
The most recent commit was on Nov 11, 2026. The latest release is v1.4.1, published Oct 23, 2026. appsgit only lists MCP servers with a commit in the last six months.