Terraform MCP Server
HashiCorp's MCP server for Terraform Registry lookups and HCP Terraform / Terraform Enterprise workspaces.
Labels are provisional (from the project README/docs, checked Nov 3, 2026). Not yet tested in our sandbox.
Read-only switch
Limit to registry lookups with --toolsets=registry. Workspace/run operations are behind ENABLE_TF_OPERATIONS (off by default). Keep it unset.
Preset
- Added
--toolsets=registry
Claude Code
{
"mcpServers": {
"terraform": {
"command": "docker",
Removed: "args": ["run", "-i", "--rm", "hashicorp/terraform-mcp-server"]
"args": [
"run", "-i", "--rm", "hashicorp/terraform-mcp-server",
"--toolsets=registry"
]
}
}
}Optional third layer: add "deny": ["mcp__terraform__<write tool>"] under permissions in .claude/settings.json.
Codex
# Generated by redpresets.dev on 2026-11-03. Unverified preset. Also use a read-only credential. Not a security guarantee.
[mcp_servers.terraform]
command = "docker"
Removed: args = ["run", "-i", "--rm", "hashicorp/terraform-mcp-server"]
args = ["run", "-i", "--rm", "hashicorp/terraform-mcp-server", "--toolsets=registry"]
default_tools_approval_mode = "writes"default_tools_approval_mode = "writes" asks before any tool the server does not mark read-only.
Cursor
{
"mcpServers": {
"terraform": {
"type": "stdio",
"command": "docker",
Removed: "args": ["run", "-i", "--rm", "hashicorp/terraform-mcp-server"]
"args": [
"run", "-i", "--rm", "hashicorp/terraform-mcp-server",
"--toolsets=registry"
]
}
}
}Don't add write tools to mcpAllowlist in .cursor/permissions.json. Leave them on approval. Cursor's docs say the allowlist is not a security boundary.
Lines marked + are what we added to the vendor's install command. Struck-through lines marked − are what they replaced; Copy leaves those out.
Credential layer
Do not give the agent a TFE/HCP Terraform token for registry-only use. Your local terraform CLI and cloud credentials are a separate path: see the DataTalks.Club incident.
Gotchas
- This MCP server does not stop an agent from running
terraform destroyin a shell. Restrict shell commands in your agent too.
Related incidents
Facts
- Vendor
- HashiCorp official
- License
- MPL-2.0
- GitHub stars
- 1.6k
- Latest release
- v1.4.1 (Oct 23, 2026)
- Last push
- Oct 26, 2026
- Status
- Active
- Last checked
- Nov 3, 2026
Sources
- README: toolsets, ENABLE_TF_OPERATIONS default false · checked Oct 27, 2026
Spotted something wrong? Labels change when vendors change. Suggest a correction