MCP server
by thrashr888
Integrate Terraform Registry with infrastructure as code tools for seamless provider lookup, module recommendations, and
Connects to the Terraform Registry API to look up provider details, resource examples, module recommendations, and schema information for infrastructure-as-code projects.
Terraform Registry is a community-built MCP server published by thrashr888 that provides AI assistants with tools and capabilities via the Model Context Protocol. Integrate Terraform Registry with infrastructure as code tools for seamless provider lookup, module recommendations, and It is categorized under cloud infrastructure, developer tools. This server exposes 10 tools that AI clients can invoke during conversations and coding sessions.
You can install Terraform Registry in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport. This server supports remote connections over HTTP, so no local installation is required.
MIT
Terraform Registry is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Share your MCP server with the developer community
Terraform Registry is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
Terraform Registry has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
Terraform Registry is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
Useful MCP listing: Terraform Registry is the kind of server we cite when onboarding engineers to host + tool permissions.
I recommend Terraform Registry for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
Useful MCP listing: Terraform Registry is the kind of server we cite when onboarding engineers to host + tool permissions.
We evaluated Terraform Registry against two servers with overlapping tools; this profile had the clearer scope statement.
Terraform Registry reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
Terraform Registry is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
Terraform Registry reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
showing 1-10 of 53
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.
[!IMPORTANT] This project was used as a PoC for a new official Terraform MCP server. This repo has been archived in favor of that one.
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:
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.
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"]
}
}
}
The following tools are available in this MCP server:
| 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 |
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 |
The MCP server supports the following resource URIs for listing and reading via the resources/* methods:
| Resource Type | Example URI(s) | Description |
|---|---|---|
| Providers | terraform:providers | List all namespaces/providers |
terraform:provider:<namespace>/<name> | Get details for a specific provider | |
| Provider Versions | terraform:provider:<namespace>/<name>/versions | List available versions for a provider |
| Provider Resources | terraform:provider:<namespace>/<name>/resources | List resources for a provider |
terraform:resource:<namespace>/<name>/<resource_name> | Get details for a specific resource type | |
| Provider Data Sources | terraform:provider:<namespace>/<name>/dataSources | List data sources for a provider |
terraform:dataSource:<namespace>/<name>/<data_source_name> | Get details for a specific data source | |
| Provider Functions | terraform:provider:<namespace>/<name>/functions | List functions for a provider |
terraform:function:<namespace>/<name>/<function_name> | Get details for a specific function |
The server also supports resources/templates/list to provide templates for creating:
terraform:providerterraform:resourceterraform:dataSourceThe 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 |
migrate-provider-version | Assists with provider version upgrades and breaking changes | providerName, currentVersion, targetVersion, terraformCode (optional) |
analyze-workspace-runs | Analyzes recent run failures and provides troubleshooting guidance for Terraform Cloud workspaces | workspaceId, runsToAnalyze (optional, default: 5) |
Note: There is a known issue with the getPrompt functionality that can cause server crashes. The server properly registers prompts and can list them, but direct requests using the getPrompt method may cause connectivity issues. This is being investigated and may be related to SDK compatibility or implementation details. Until resolved, use listPrompts to see available prompts but avoid direct getPrompt calls.
The server runs using stdio transport for MCP communication:
npm install
npm start
The server can be configured using environment variables:
| Environment Variable | Description | Default Value |
|---|---|---|
TERRAFORM_REGISTRY_URL | Base URL for Terraform Registry API | https://registry.terraform.io |
DEFAULT_PROVIDER_NAMESPACE | Default namespace for providers | hashicorp |
LOG_LEVEL | Logging level (error, warn, info, debug) | info |
REQUEST_TIMEOUT_MS | Timeout for API requests in milliseconds | 10000 |
RATE_LIMIT_ENABLED | Enable rate limiting for API requests | false |
RATE_LIMIT_REQUESTS | Number of requests allowed in time window | 60 |
RATE_LIMIT_WINDOW_MS | Time window for rate limiting in milliseconds | 60000 |
TFC_TOKEN | Terraform Cloud API token for private registry access (optional) |
Example usage with environment variables:
# Set environment variables
export LOG_LEVEL="debug"
export REQUEST_TIMEOUT_MS="15000"
export TFC_TOKEN="your-terraform-cloud-token"
# Run the server
npm start
See the TESTS.md file for information about testing this project.
Prerequisites
Time Estimate
15-60 minutes depending on server complexity
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
Compatibility
✓ Use when
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid when
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.