Introduction
This article explains how to deploy the Terraform MCP (Model Context Protocol) server locally on your laptop and configure Claude Desktop to connect to it. Once set up, you can interact with your Terraform Enterprise (TFE) workspaces directly from Claude Desktop using natural language.
Prerequisites
Before proceeding, ensure the following are in place:
- Terraform Enterprise.
- Terraform Enerprise valid API token.
- Claude Desktop installed on your local laptop
-
Node.jsandnpxinstalled
Procedure
Part 1: Deploy the MCP Server
1- Download the latest binary from this link
$ wget https://releases.hashicorp.com/terraform-mcp-server/<VERSION>/terraform-mcp-server_<VERSION>_<OS>_<ARCH>.zip2- Unzip the downloaded file (expect the following files terraform-mcp-server and LICENSE.txt)
$ unzip terraform-mcp-server_<VERSION>_<OS>_<ARCH>.zip3- Copy the binary file to a system path
$ cp terraform-mcp-server /usr/bin4- Generate a Terraform Enterprise API token as per the following KB
5- Set the following environment variables
$ export TFE_TOKEN="<your-api-token>"
$ export TFE_HOSTNAME="<your-tfe-hostname>"
$ export TFE_ADDRESS="https://<your-tfe-hostname>"6- Start the MCP server on port 8080
$ terraform-mcp-server streamable-http --transport-port 8080 --toolsets all
INFO[0000] Enabled toolsets: [all]
INFO[0000] Using endpoint path: /mcp
INFO[0000] Running with stateless mode: false
INFO[0000] CORS Mode: strict
INFO[0000] Starting StreamableHTTP server on 127.0.0.1:8080/mcp
Part 2: Configure Claude Desktop
1- Download and install Claude Desktop from the official site.
2- Open Claude Desktop → Settings → Developer → Edit Config → open claude_desktop_config.json.
3- Insert the following configuration. Replace all <PLACEHOLDER> values with the appropriate settings for your environment (MCP host/port, TFE hostname, token, and TLS configuration).
{
"preferences": {
"sidebarMode": "chat",
"coworkWebSearchEnabled": true,
"coworkScheduledTasksEnabled": true
},
"mcpServers": {
"<MCP_SERVER_NAME>": {
"command": "<PATH_TO_NPX>",
"args": ["mcp-remote", "http://<MCP_HOST>:<MCP_PORT>/mcp"],
"env": {
"TFE_TOKEN": "<TFE_TOKEN>",
"TFE_HOSTNAME": "<TFE_HOSTNAME>",
"TRANSPORT_MODE": "streamable-http",
"TFE_SKIP_TLS_VERIFY": "<true|false>",
"TFE_ADDRESS": "https://<TFE_HOSTNAME>"
}
}
}
}can you list my current workspaces?
8- If configured correctly, Claude will return your Terraform workspaces.
Let me first look up your Terraform organizations to find your workspaces.Found your organization. Now let me list the workspaces:You have **1 workspace** in your organization (`organization`): | Name | ID | Execution Mode | Created | |---|---|---|---| | **workspace** | `ws-EaAW7nA3NPuuTh8R` | Remote | Dec 12, 2025 | Would you like to see more details about this workspace or do anything with it?
Additional Information
- Further details are available in the Deploy the Terraform MCP server documentation