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

  1. Choose VS Code configuration scope

    For Terraform MCP Server, open Workspace: .vscode/mcp.json. Merge into servers; preserve existing inputs.

  2. 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.

  3. 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

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.

Terraform: full stored tool descriptions

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

Frequently asked questions

For Terraform MCP Server, edit workspace .vscode/mcp.json. VS Code requires servers rather than mcpServers; preserve the displayed type on each entry.

VS Code's terraform-mcp-server example uses stdio.

Terraform MCP Server's VS Code configuration invokes docker and a running Docker engine.

Terraform MCP Server's stored list contains 2 tools, including search_providers, get_provider_details. Compare those names with VS Code's connected tool list; the stored list is not a live check.

No. The README also documents HCP Terraform and Terraform Enterprise workspace and private registry features.

Yes. The server accepts toolset and individual-tool filters.