
terraform-mcp-server
by thrashr888
Terraform Registry MCP Server
A Model Context Protocol (MCP) server that provides tools for interacting with the Terraform Registry API. This server enables AI agents to query provider information, resource details, and module metadata.
Installation
Installing in Cursor
To install and use this MCP server in Cursor:
-
In Cursor, open Settings (⌘+,) and navigate to the "MCP" tab.
-
Click "+ Add new MCP server."
-
Enter the following:
- Name: terraform-registry
- Type: command
- Command: npx -y terraform-mcp-server
-
Click "Add" then scroll to the server and click "Disabled" to enable the server.
-
Restart Cursor, if needed, to ensure the MCP server is properly loaded.
Installing in Claude Desktop
To install and use this MCP server in Claude Desktop:
-
In Claude Desktop, open Settings (⌘+,) and navigate to the "Developer" tab.
-
Click "Edit Config" at the bottom of the window.
-
Edit the file (
~/Library/Application Support/Claude/claude_desktop_config.json) to add the following code, then Save the file.
{
"mcpServers": {
"terraform-registry": {
"command": "npx",
"args": ["-y", "terraform-mcp-server"]
}
}
}
- Restart Claude Desktop to ensure the MCP server is properly loaded.
Tools
The following tools are available in this MCP server:
Core Registry Tools
| Tool | Description |
|---|---|
providerDetails | Gets detailed information about a Terraform provider |
resourceUsage | Gets example usage of a Terraform resource and related resources |
moduleSearch | Searches for and recommends Terraform modules based on a query |
listDataSources | Lists all available data sources for a provider and their basic details |
resourceArgumentDetails | Fetches comprehensive details about a resource type's arguments |
moduleDetails | Retrieves detailed metadata for a Terraform module |
functionDetails | Gets details about a Terraform provider function |
providerGuides | Lists and views provider-specific guides and documentation |
policySearch | Searches for policy libraries in the Terraform Registry |
policyDetails | Gets detailed information about a specific policy library |
Terraform Cloud Tools
These tools require a Terraform Cloud API token (TFC_TOKEN):
| Tool | Description |
|---|---|
listOrganizations | Lists all organizations the authenticated user has access to |
privateModuleSearch | Searches for private modules in an organization |
privateModuleDetails | Gets detailed information about a private module |
explorerQuery | Queries the Terraform Cloud Explorer API to analyze data |
listWorkspaces | Lists workspaces in an organization |
workspaceDetails | Gets detailed information about a specific workspace |
lockWorkspace | Locks a workspace to prevent runs |
unlockWorkspace | Unlocks a workspace to allow runs |
listRuns | Lists runs for a workspace |
runDetails | Gets detailed information about a specific run |
createRun | Creates a new run for a workspace |
applyRun | Applies a run that's been planned |
cancelRun | Cancels a run that's in progress |
listWorkspaceResources | Lists resources in a workspace |
Prompts
The following prompts are available for generating contextual responses:
| Prompt | Description | Required Arguments |
|---|---|---|
migrate-clouds | Generate Terraform code to migrate infrastructure between cloud providers | sourceCloud, targetCloud, terraformCode |
generate-resource-skeleton | Helps users quickly scaffold new Terraform resources with best practices | resourceType |
optimize-terraform-module | Provides actionable recommendations for improving Terraform code | terraformCode |
| ` |
Related servers

n8n
by n8n-io
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

@modelcontextprotocol/server-everything
OfficialMCP server that exercises all the features of the MCP protocol

@modelcontextprotocol/server-filesystem
OfficialMCP server for filesystem access