Skip to content
Agentmart
Submit a tool

How to connect Terraform to Cursor

Here is how to connect Terraform to Cursor. The MCP server comes from hashicorp, marked in the listing as the vendor's own, and it runs on your machine through Docker. The listing names no required key, but the publisher's command includes placeholders you must replace. The entry comes from the listing's install data and Cursor's documentation, last read on 2026-10-26.

Updated Oct 26, 2026 · Built from catalog data; how we rank and grade

Checked against Cursor's documentation on Oct 26, 2026. Commands and config blocks are generated from the same install data as each listing page.

Before you start

  • Cursor installed and able to start.
  • Docker (the server starts with docker).
  • No API key is listed for Terraform.
  1. 1. Check what you need

    Cursor needs Docker on the machine to start this server, so run the check before editing the config.

    Check that it is installed
    docker --version
    • The listing names no required key.
  2. 2. Add Terraform to Cursor

    The JSON entry passes TFE_ADDRESS, TFE_TOKEN and ENABLE_TF_OPERATIONS with -e flags. Swap each placeholder for a real value in whichever file you choose.

    Add this to .cursor/mcp.json in the project, or to ~/.cursor/mcp.json for every project.cursor/mcp.json
    {
      "mcpServers": {
        "terraform-mcp-server": {
          "command": "docker",
          "args": [
            "-e",
            "TFE_ADDRESS={address}",
            "-e",
            "TFE_TOKEN={token}",
            "-e",
            "ENABLE_TF_OPERATIONS={enabled}",
            "docker.io/hashicorp/terraform-mcp-server:1.4.1"
          ]
        }
      }
    }
    • The publisher's command contains {address}, {token} and {enabled}. Replace it with your own value before you run the command.
  3. 3. Restart or reload if it does not appear

    Read this step if Terraform does not appear in Cursor. It reports what the docs say about restarts and about tool approval.

    • The docs do not say whether editing mcp.json needs a restart. They tell you to restart Cursor after updating files of a custom local server.
    • Cursor asks for approval before an agent uses an MCP tool unless you allowlist it.

Check that it works

Check the MCP Logs channel for connection errors. The catalog records 61 tools for Terraform, including attach_policy_set_to_workspaces, which Cursor should list once connected.

  • Open the Output panel (Cmd+Shift+U on macOS), choose MCP Logs, and look for connection errors. A working server lists its tools under Available Tools; agent mcp list shows connection state from the terminal.
  • Once it is connected, Cursor should list its tools; the catalog records 61 for Terraform, including action_run, add_team_member and attach_policy_set_to_workspaces.

Troubleshooting

A server fails or an npm-based server misbehaves after an update
Check the MCP Logs channel in the Output panel. For npm-based servers the docs suggest removing the server, running npm cache clean --force, and adding it again. Source

Security notes

  • Publisher: hashicorp, listed as the vendor's own server; license MPL-2.0.
  • It runs on your machine with your user account's permissions, so it can reach any file or network resource you can. Read its source before you give it access: https://github.com/hashicorp/terraform-mcp-server.
  • The listing declares no required keys; use a token with the narrowest scope if the service asks for one.
  • This listing has no security grade: Agent Market has not published security grades yet, so the choice is yours to make from the source and the permissions.

How we grade security · Trust policy

Servers and skills in this guide

You can move on to other Terraform servers, a comparison page, or the general Cursor guide.

  1. 1
    Terraform

    hashicorpOfficial

    Generate more accurate Terraform and automate workflows for HCP Terraform and Terraform Enterprise

    ★ 1.6KLast active Oct 23, 2026Local (stdio)Claude Code, Codex, VS Code, Cursor +2

Sources

Cite this page

How to connect Terraform to Cursor. Agent Mart. https://agentmart.dev/guides/connect-terraform-to-cursor (last updated 2026-10-26)