terraform
MCP server from DCamonier1980/terraform-mcp-server
claude mcp add --transport stdio dcamonier1980-terraform-mcp-server docker run -i --rm hashicorp/terraform-mcp-server
How to use
The Terraform MCP Server provides automated access to Terraform Registry data via the Model Context Protocol. It exposes toolsets that let you discover providers, resources, data sources, functions, and modules, and to fetch full documentation or detailed module information. Using the server, you can query the Terraform Registry for provider docs, search for Terraform modules, and retrieve module inputs, outputs, and configuration examples. This enables you to reason about IaC patterns, compare providers, and extract actionable details for automation scripts or design reviews. The available toolsets include: providers (resolveProviderDocID and getProviderDocs) for provider and resource documentation, and modules (searchModules and moduleDetails) for module discovery and in-depth module information.
How to install
Prerequisites
- Docker installed and running on your machine
- Optional: Git if you plan to pull sources locally
- Install Docker
- Follow the instructions at https://www.docker.com/get-started to install Docker Desktop and ensure the daemon is running.
- Run the Terraform MCP Server with Docker
- You can start the server using the provided Docker image as shown in the README examples.
- Basic run (auto-pulls the image if not present):
# Run the Terraform MCP Server using Docker
docker run -i --rm hashicorp/terraform-mcp-server
- Verify the server is accessible
- The MCP framework typically communicates over standard IO or a configured port. If your environment requires explicit port exposure, modify the docker run command to forward the port (for example, -p 8080:8080) and reference the exposed port in your MCP client configuration.
- Alternative installation (build from source)
- If you prefer building locally, follow the project’s build instructions (not shown in this README). Typically this involves cloning the repository and using make build, then pointing the MCP client to the built binary.
- Ensure access in VS Code or Claude Desktop
- Use the provided JSON configuration blocks in your VS Code user settings or Claude Desktop to connect to the running container image as shown in the examples.
Additional notes
Notes and tips:
- The Terraform MCP Server relies on the Terraform Registry for provider/module data. Ensure network access to registry endpoints is available from the host running Docker.
- When using the docker-based setup, you may wish to configure a persistent container or mount volumes if you need stateful interactions or cached responses across sessions.
- The tools available include: resolveProviderDocID (to locate provider doc IDs), getProviderDocs (to fetch full provider/resource docs in Markdown), searchModules (to find modules with metadata), and moduleDetails (to fetch module inputs/outputs/configuration).
- Be mindful of rate limits or API changes from the Terraform Registry that could affect tool outputs.
- For security, review all outputs and recommendations before applying any IaC changes in production.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go