Data as of
Terraform MCP Server for Claude Code: Setup & Config
Claude Code: Connect MCP assistants to Terraform Registry data and HCP Terraform or Terraform Enterprise.
What you can do with Terraform in Claude 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.
- Expose selected Terraform capabilities to a shared HTTP MCP client.
Before you start: Terraform in Claude 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 Claude Code configuration
Choose Claude Code configuration scope
For Terraform MCP Server, open Project scope: .mcp.json at the repository root. Project JSON: merge into mcpServers; user scope: use the CLI.
Add Terraform MCP Server to Claude Code
Use the terraform-mcp-server entry below in mcpServers. Keep Terraform MCP Server's documented stdio connection fields and your other Claude Code entries.
Check Terraform MCP Server in Claude Code
Terraform MCP Server: Inspect claude mcp list and /mcp status.
Config file · Project scope: .mcp.json at the repository root
{
"mcpServers": {
"terraform-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
],
"env": {}
}
}
}claude mcp add-json --scope project 'terraform-mcp-server' '{"type":"stdio","command":"docker","args":["run","-i","--rm","hashicorp/terraform-mcp-server"],"env":{}}'Terraform tools available to Claude Code
Terraform's stored tool list documents 2 tools; compare it with Claude Code's connected tool list, because the stored list is not a live check.
- search_providers
For Terraform's search_providers, review the permission request and arguments in Claude Code before approval.
Search Terraform providers; named in the README's tool-filtering example.
- get_provider_details
For Terraform's get_provider_details, review the permission request and arguments in Claude Code before approval.
Troubleshooting Terraform in Claude Code
- If Terraform MCP Server fails to start, check docker and a running Docker engine, the working directory, and Claude Code's selected scope; inspect claude mcp list and /mcp.
- Terraform MCP Server uses stdio here: Claude 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 Claude Code troubleshooting lives in the /clients/claude-code guide.
Terraform MCP Server — details. Claude Code guide