/ Directory / Playground / Terraform MCP Server
● Official hashicorp ⚡ Instant

Terraform MCP Server

by hashicorp · hashicorp/terraform-mcp-server

Official Terraform MCP Server providing seamless integration with Terraform ecosystem for IaC automation.

Terraform MCP Server is a MCP server maintained by hashicorp. Official Terraform MCP Server providing seamless integration with Terraform ecosystem for IaC automation. See README for installation and configuration: https://github.com/hashicorp/terraform-mcp-server

Why use it

Key features

Live Demo

What it looks like in practice

terraform-mcp-server.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "terraform-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@hashicorp/terraform-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "terraform-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@hashicorp/terraform-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "terraform-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@hashicorp/terraform-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "terraform-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@hashicorp/terraform-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "terraform-mcp-server",
      "command": "npx",
      "args": [
        "-y",
        "@hashicorp/terraform-mcp-server"
      ]
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "terraform-mcp-server": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@hashicorp/terraform-mcp-server"
        ]
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add terraform-mcp-server -- npx -y @hashicorp/terraform-mcp-server

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use Terraform MCP Server

Use Terraform MCP Server for its primary workflow

👤 Claude Code / MCP client users ⏱ ~20 min intermediate

When to use: See repo README for canonical use cases.

Prerequisites
  • Repo cloned or package installed — See https://github.com/hashicorp/terraform-mcp-server
Flow
  1. Install
    Install Terraform MCP Server per README.✓ Copied
    → Tool/skill registered with client
  2. Configure
    Provide credentials/config as instructed.✓ Copied
    → Successful auth/init
  3. Use
    Run a sample task with Terraform MCP Server.✓ Copied
    → Expected output

Outcome: You can drive the documented workflow end-to-end.

Pitfalls
  • Skipping README — Read the repo README and CHANGELOG before shipping to prod.

Tools

What this MCP exposes

ToolInputsWhen to callCost
primary see README Primary action free

Cost & Limits

What this costs to run

API quota
None of its own; bounded by upstream provider quotas if any
Tokens per call
Depends on usage
Monetary
Open source — check repo LICENSE
Tip
Review upstream API costs (if any) before automating.

Security

Permissions, secrets, blast radius

Minimum scopes: Whatever the upstream provider requires
Credential storage: Env vars or local config — never commit secrets
Data egress: Forwards data per its README
Never grant: Full admin to untrusted prompts

Troubleshooting

Common errors and fixes

Auth fails

Verify credentials and required scopes match README.

Verify: Re-read repo README auth section.
Tool not found by client

Ensure MCP client config points to correct command/path.

Verify: Restart the client after editing config.

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills

Continue exploring

Related tools and workflows

Choose another guide for your workflow, or explore a collection.

Same collection group

HashiCorp Vault MCP

Use HashiCorp’s MCP server to manage Vault mounts, key-value secrets, and PKI workflows.

MCP

Same collection group

HashiCorp Consul MCP

Connect MCP clients to Consul service discovery, health checks, key-value data, service mesh, and ACL operations.

MCP

Same collection group

Cloudflare Skills

Apply Cloudflare’s agent skills to development on the Cloudflare platform.

Skill

Same collection group

Microsoft Azure Skills

Use Microsoft’s Azure skills plugin to combine Azure workflow guidance with Azure MCP and Foundry MCP tools.

Skill

Browse all topic collections → · See 29 new official additions →