
HashiCorp Terraform for VS Code (v2.39.3, 6.4M installs) ships two off-by-default settings worth enabling: `prefillRequiredFields` auto-inserts every required resource attribute as a tab-stop snippet, and `mcp.server.enable` wires GitHub Copilot to live Terraform Registry data via a containerized MCP server — eliminating training-data guesses on provider schemas.
HashiCorp.terraform, 6.4 million installs 1) leave two features disabled by default. One auto-populates every required attribute when you autocomplete a resource block. The other wires GitHub Copilot (or Cursor) directly to live Terraform Registry data, so the AI stops guessing at provider schemas.HashiCorp.terraform · Publisher: HashiCorp · Version: v2.39.3 (released 2026-03-04) · License: MPL-2.0 · Install on VS Code Marketplaceterraform.experimentalFeatures.prefillRequiredFields changes that. 1 When it's enabled, completing a resource block inserts all required fields as a snippet — each attribute pre-named, each value a tab stop. You tab through them in order, filling in only the actual values.settings.json:"terraform.experimentalFeatures.prefillRequiredFields": true,
"editor.suggest.preview": true
load_balancer_arn, default_action, port, and protocol. 1
resource, data, provider, variable, output, module, and Terraform Stacks components. The attribute list comes from terraform-ls (the bundled language server) reading the provider schema, so it's accurate to whichever provider version you have initialized. 2experimentalFeatures for a reason. It's stable for common AWS/GCP/Azure resources, but edge cases with complex nested blocks or custom providers occasionally drop you into a partial snippet. That's the trade-off — provider-doc lookup every time vs. tab-through with occasional cleanup."terraform.mcp.server.enable": truehashicorp/terraform-mcp-server:1.0.0 3 as a container and registers it with VS Code's MCP layer. GitHub Copilot in Agent mode can then call 46 tools — 9 for querying the public Terraform Registry (providers, modules, policies), 4 for private registry lookups, and 27 for HCP Terraform workspace management. 3#terraform or #vault. This forces the AI to check the MCP server for the real answer." 4 Without the prefix, the model may generate from training data and skip the tool call.#terraform Create an AWS S3 bucket with versioning enabled and server-side encryption using the latest AWS providersearch_providers → get_latest_provider_version → get_provider_capabilities before generating HCL — the output reflects the current provider schema rather than a snapshot from training. 5{
"terraform.mcp.server.enable": true,
"terraform.experimentalFeatures.prefillRequiredFields": true,
"editor.suggest.preview": true,
"[terraform]": {
"editor.defaultFormatter": "hashicorp.terraform",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file"
},
"[terraform-vars]": {
"editor.defaultFormatter": "hashicorp.terraform",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file"
}
}formatOnSave block is optional but recommended — it runs terraform fmt on every save. One note: set formatOnSaveMode to "file" explicitly. The modifications and modificationsIfAvailable modes don't work with the Terraform formatter. 1.vscode/mcp.json to the repository:{
"servers": {
"terraform": {
"command": "docker",
"args": ["run", "-i", "--rm", "hashicorp/terraform-mcp-server:1.0.0"],
"type": "stdio"
}
}
}terraform.mcp.server.enable silently does nothing. 1.tf files and their module dependencies; opening a workspace with hundreds of nested modules will spike CPU and memory until indexing completes. One documented workaround: add your modules/ directory to the terraform-ls ignore list in settings. Code Lens (reference counts above blocks) also has a known performance cost on large projects, so disable it if you notice slowdowns. 1tfenv manages the Terraform version — the formatter intermittently loses its path to the terraform binary. 7 Pointing terraform.languageServer.terraform.path directly at a fixed binary path (rather than the tfenv shim) resolves the issue for most users.OpenTofu.vscode-opentofu (v0.6.2) instead — it ships its own tofu-ls language server and provides equivalent HCL features, though it has no HCP Terraform integration or MCP Server support. 8| Extension ID | HashiCorp.terraform |
| Current version | v2.39.3 (2026-03-04) |
| VS Code minimum | v1.86 |
| Terraform CLI minimum | v0.12 |
| Bundled language server | terraform-ls v0.38.7 (2026-06-08) |
| MCP Server Docker image | hashicorp/terraform-mcp-server:1.0.0 |
| MCP prerequisite | Docker or Podman (local, running) |
| License | MPL-2.0 (free) |
| Marketplace installs | 6,395,390 |
| OpenVSX | Available (Cursor / Windsurf compatible) |
marketplace.visualstudio.com
github.com
github.com
marketplace.visualstudio.com
This story was produced automatically by a channel. One sentence is all it takes for Neodrop to keep producing for you.