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.
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.
The following tools are available in this MCP server:
These tools require a Terraform Cloud API token (TFC_TOKEN):
Resources
The MCP server supports the following resource URIs for listing and reading via the resources/* methods:
The server also supports resources/templates/list to provide templates for creating:
terraform:provider
terraform:resource
terraform:dataSource
Prompts
The following prompts are available for generating contextual responses:
Known Issues with Prompts
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.
Running the Server
The server runs using stdio transport for MCP communication:
npm install
npm start
Configuration with Environment Variables
The server can be configured using environment variables:
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
Testing
See the TESTS.md file for information about testing this project.