Data as of
Terraform MCP Server for VS Code: Setup & Config
VS Code: Connect MCP assistants to Terraform Registry data and HCP Terraform or Terraform Enterprise.
What you can do with Terraform in VS Code
Choose it for Terraform Registry research and platform workspace operations through one MCP integration.
- Look up provider and module information while drafting Terraform configuration.
- Manage Terraform workspaces, variables, tags, and runs.
Before you start: Terraform in VS Code
- Docker installed and running
- An MCP-compatible assistant
This command is the README's local Claude Code Docker launch. HCP Terraform or Enterprise access additionally uses TFE_ADDRESS and TFE_TOKEN, which must be forwarded into the container as shown in the README's client-specific examples. Public Registry use and platform access are distinct configurations.
Terraform VS Code configuration
Choose VS Code configuration scope
For Terraform MCP Server, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.
Add Terraform MCP Server to VS Code
Use the terraform-mcp-server entry below in servers. Keep Terraform MCP Server's documented stdio connection fields and your other VS Code entries.
Check Terraform MCP Server in VS Code
Terraform MCP Server: Start in VS Code’s MCP controls; inspect output and trust prompts.
Config file · Workspace: .vscode/mcp.json
{
"servers": {
"terraform-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
],
"env": {}
}
}
}Terraform tools available to VS Code
Terraform's stored tool list documents 2 tools; compare it with VS Code's connected tool list, because the stored list is not a live check.
- search_providers
Look for search_providers among VS Code's agent-mode tools after starting Terraform through the MCP controls.
Search Terraform providers; named in the README's tool-filtering example.
- get_provider_details
Look for get_provider_details among VS Code's agent-mode tools after starting Terraform through the MCP controls.
Troubleshooting Terraform in VS Code
- Make docker and a running Docker engine available in the workspace, container, or remote environment hosting Terraform MCP Server. Start through VS Code's MCP controls; inspect output and trust prompts.
- Terraform MCP Server uses stdio here: VS Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: Connected clients and models may receive sensitive Terraform data.
- Known limitation: Write-capable platform operations need deliberate permission and tool configuration.
- Known limitation: The complete tool catalog is linked externally rather than included in the supplied README.
- General VS Code troubleshooting lives in the /clients/vscode guide.
Terraform MCP Server — details. VS Code guide