{"id":18849,"library":"terraform-mcp-server","title":"Terraform Registry MCP Server","description":"A Model Context Protocol (MCP) server that provides tools for interacting with the Terraform Registry API, enabling AI agents to query provider information, resource details, module metadata, and Terraform Cloud resources. Current stable version is v0.13.0, actively maintained. Key differentiators include a comprehensive set of tools for both public registry (providerDetails, resourceUsage, moduleSearch) and Terraform Cloud (workspaces, runs, organizations), with standardized tool naming and Docker support. Alternatives like terraform-mcp or official Terraform APIs offer more limited scope or require custom integration.","status":"active","version":"0.13.0","language":"javascript","source_language":"en","source_url":"https://github.com/thrashr888/terraform-mcp-server","tags":["javascript"],"install":[{"cmd":"npm install terraform-mcp-server","lang":"bash","label":"npm"},{"cmd":"yarn add terraform-mcp-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add terraform-mcp-server","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is ESM-only since v0.9.x; CommonJS require will fail. Use top-level default import.","wrong":"const terraformMcpServer = require('terraform-mcp-server');","symbol":"default","correct":"import terraformMcpServer from 'terraform-mcp-server';"},{"note":"Named exports available for individual tools, but only with ESM imports.","wrong":"const { ProviderDetailsTool } = require('terraform-mcp-server');","symbol":"ProviderDetailsTool","correct":"import { ProviderDetailsTool } from 'terraform-mcp-server';"},{"note":"TypeScript type exported for server configuration; only available as type import.","wrong":null,"symbol":"ServerConfig","correct":"import { ServerConfig } from 'terraform-mcp-server';"}],"quickstart":{"code":"// Quickstart: run the MCP server with npx (no code required for basic use)\n// In your terminal:\n// npx terraform-mcp-server\n\n// To use programmatically:\nimport terraformMcpServer from 'terraform-mcp-server';\n\nconst config = {\n  // Optional: add Terraform Cloud token for private module/workspace tools\n  tfcToken: process.env.TFC_TOKEN ?? ''\n};\n\nconst server = terraformMcpServer(config);\n\n// The server implements the MCP protocol; connect it to a transport\n// Example with stdin/stdout transport:\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\nconsole.log('Terraform Registry MCP server running on stdio');","lang":"typescript","description":"Shows how to run the MCP server from CLI with npx and programmatically import and connect it with a transport."},"warnings":[{"fix":"Update tool names to new standardized patterns: e.g., use 'moduleSearch' instead of 'searchModules'.","message":"Tool naming standardized in v0.12.0; existing tool names may have changed (e.g., 'searchModules' renamed to 'moduleSearch').","severity":"breaking","affected_versions":"<0.12.0"},{"fix":"Use 'resourceUsage' tool for example configurations instead.","message":"Removed 'exampleConfigGenerator' tool in v0.9.6; tool no longer available.","severity":"breaking","affected_versions":">=0.9.6"},{"fix":"Use 'resourceArgumentDetails' tool to get resource argument details.","message":"Removed 'providerSchemaDetails' tool in v0.9.5; tool no longer available.","severity":"breaking","affected_versions":">=0.9.5"},{"fix":"Set TFC_TOKEN environment variable before starting the server.","message":"Terraform Cloud API token now required as environment variable 'TFC_TOKEN' instead of config file parameter.","severity":"deprecated","affected_versions":">=0.11.0"},{"fix":"Ensure your MCP client supports protocol version 2024-11-05; update client SDK if needed.","message":"MCP protocol version mismatch: server sends protocol version '2024-11-05' but older clients may expect '2024-10-07'.","severity":"gotcha","affected_versions":">=0.9.8"},{"fix":"Implement client-side rate limiting or exponential backoff; consider caching frequent queries locally.","message":"Rate limiting: Terraform Registry API may return 429 errors under heavy usage; server does not implement retry logic.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use ESM import syntax (import ... from 'terraform-mcp-server') or run via npx (npx terraform-mcp-server) without local install.","cause":"Using CommonJS require() with an ESM-only package; also possible if package not installed globally.","error":"Error: Cannot find module 'terraform-mcp-server' (or 'ERR_MODULE_NOT_FOUND')"},{"fix":"Ensure default import: import terraformMcpServer from 'terraform-mcp-server'; (without braces).","cause":"Importing default export incorrectly, possibly using named import for default.","error":"TypeError: terraformMcpServer is not a function"},{"fix":"Set TFC_TOKEN to your Terraform Cloud API token: export TFC_TOKEN='your_token_here' or pass in config.tfcToken if supported.","cause":"Terraform Cloud tools require the TFC_TOKEN env var; attempting to use them without setting it.","error":"Error: TFC_TOKEN environment variable not set"},{"fix":"Use new standardized names: 'moduleSearch' instead of 'searchModules'; 'resourceUsage' instead of 'exampleConfigGenerator'.","cause":"Tool renamed or removed in recent versions; using old tool names.","error":"Error: Tool 'searchModules' not found (or 'exampleConfigGenerator' not found)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}