Terraform MCP Server

Cloudstdiov0.5.0
Репозиторий

Provides AI agents with the ability to manage Terraform infrastructure through the Model Context Protocol. Supports plan generation, state inspection, resource drift detection, and module discovery. Enables safe infrastructure changes with plan review before apply.

Подключение

Добавьте эту конфигурацию в .claude/mcp.json

{
  "mcpServers": {
    "terraform": {
      "command": "npx",
      "args": [
        "-y",
        "@hashicorp/terraform-mcp-server"
      ],
      "env": {
        "TF_TOKEN": "<YOUR_TF_TOKEN>"
      }
    }
  }
}

Инструменты (4)

terraform_plan

Run terraform plan in a directory and return the execution plan showing what changes will be made.

{
  "type": "object",
  "required": [
    "working_dir"
  ],
  "properties": {
    "target": {
      "type": "string",
      "description": "Resource address to target for partial plans"
    },
    "var_file": {
      "type": "string",
      "description": "Path to a variables file"
    },
    "working_dir": {
      "type": "string",
      "description": "Path to the Terraform configuration directory"
    }
  }
}

terraform_show

Show the current state or a saved plan in human-readable format.

{
  "type": "object",
  "required": [
    "working_dir"
  ],
  "properties": {
    "plan_file": {
      "type": "string",
      "description": "Path to a saved plan file (optional, shows state if omitted)"
    },
    "working_dir": {
      "type": "string",
      "description": "Path to the Terraform configuration directory"
    }
  }
}

terraform_validate

Validate Terraform configuration files for syntax and consistency errors.

{
  "type": "object",
  "required": [
    "working_dir"
  ],
  "properties": {
    "working_dir": {
      "type": "string",
      "description": "Path to the Terraform configuration directory"
    }
  }
}

search_modules

Search the Terraform Registry for modules matching a query.

{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "query": {
      "type": "string",
      "description": "Search query for modules"
    },
    "provider": {
      "type": "string",
      "description": "Filter by provider (aws, gcp, azure)"
    }
  }
}

Ресурсы

Этот сервер не предоставляет ресурсы.

Промпты

Этот сервер не предоставляет промпты.

Сведения о сервере

Автор
HashiCorp (@hashicorp)
Репозиторий
https://github.com/hashicorp/terraform-mcp-server
Лицензия
MPL-2.0
Версия
0.5.0
Звёзды
3,150
Последнее обновление
20 мая 2026 г.