Get the FREE Ultimate OpenClaw Setup Guide →

terraform

Terraform Registry MCP Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio thrashr888-terraform-mcp-server npx -y terraform-mcp-server \
  --env LOG_LEVEL="Logging level (default: info)" \
  --env TFC_TOKEN="Terraform Cloud API token for private registry access (optional)" \
  --env RATE_LIMIT_ENABLED="Enable rate limiting for API requests (default: false)" \
  --env REQUEST_TIMEOUT_MS="Timeout for API requests in milliseconds (default: 10000)" \
  --env RATE_LIMIT_REQUESTS="Number of requests allowed in time window (default: 60)" \
  --env RATE_LIMIT_WINDOW_MS="Time window for rate limiting in milliseconds (default: 60000)" \
  --env TERRAFORM_REGISTRY_URL="Base URL for Terraform Registry API (default: https://registry.terraform.io)" \
  --env DEFAULT_PROVIDER_NAMESPACE="Default namespace for providers (default: hashicorp)"

How to use

This MCP server exposes a set of Terraform Registry related tools through the MCP interface. It includes core registry tools that let you fetch provider details, example usages, module metadata, and more, as well as data sources, resources, and module information from the Terraform Registry. When you enable this server (for example via Cursor or Claude Desktop), you can call tools like providerDetails, resourceUsage, moduleSearch, listDataSources, moduleDetails, and providerGuides to retrieve structured Terraform registry data. If you have a Terraform Cloud token (TFC_TOKEN) configured, you can also access Terraform Cloud tools to list organizations, workspaces, runs, and related resources such as private modules and workspace resources, enabling AI-assisted infrastructure planning across both public registry data and private Terraform Cloud resources.

How to install

Prerequisites:\n- Node.js and npm installed on your system.\n- Access to the internet to fetch the Terraform MCP server package.\n\nInstallation steps:\n1) Install dependencies and verify Node.js environment.\nbash\nnpm install\n\n2) Run the MCP server locally (uses npx with the terraform-mcp-server package).\nbash\nnpm start\n\n3) (Optional) Integrate with Cursor or Claude Desktop as described in the README:\n- Cursor: add a new MCP server with command npx -y terraform-mcp-server.\n- Claude Desktop: update claude_desktop_config.json to include the terraform-registry server entry.\njson\n{\n "mcpServers": {\n "terraform-registry": {\n "command": "npx",\n "args": ["-y", "terraform-mcp-server"]\n }\n }\n}\n

Additional notes

Tips and considerations:\n- The Terraform Cloud tools require a valid Terraform Cloud API token in the TFC_TOKEN environment variable to access private modules and runs.\n- You can configure several environment variables to tailor timeouts, logging, and rate limiting. Default values are provided in the README.\n- The server uses stdio MCP transport as shown in the Running the Server section, and can be started with npm start after npm install.\n- If you encounter connectivity issues with prompts (getPrompt) during usage, prefer listPrompts to discover available prompts and avoid direct getPrompt calls until the issue is resolved.

Related MCP Servers

Sponsor this space

Reach thousands of developers