Terraform MCP
by HashiCorp
Official Terraform MCP server for seamless IaC development with AI assistants
devops Go Intermediate Self-hostable No API key Docker Verified
β 1.2k stars π
Updated: 1mo ago
Description
Official HashiCorp MCP server that bridges Terraform's Infrastructure as Code ecosystem with AI coding assistants. Search providers and modules in the Terraform Registry, retrieve detailed provider documentation including resource schemas and argument references, and manage HCP Terraform workspaces programmatically. Supports dual transport modes (stdio and StreamableHTTP) for flexible integration, tool filtering to expose only needed capabilities, and built-in rate limiting for safe registry access. Designed to give AI assistants accurate, up-to-date Terraform knowledge directly from the source.
β Best for
Terraform developers who want AI-assisted IaC authoring with accurate, real-time registry data
βοΈ Skip if
You use a different IaC tool like Pulumi, CDK, or Ansible
π‘ Use cases
- Looking up Terraform provider documentation and resource schemas while writing IaC
- Discovering and evaluating Terraform modules from the registry
- Managing HCP Terraform workspaces and variables from AI assistants
- Getting accurate provider configuration examples without leaving the editor
π Pros
- β Official HashiCorp project β authoritative Terraform Registry access
- β Dual transport support (stdio + StreamableHTTP) for flexible deployments
- β Tool filtering lets you expose only the capabilities you need
- β Built-in rate limiting prevents hitting registry API limits
π Cons
- β HCP Terraform workspace features require authentication token
- β Read-only registry access β cannot publish providers or modules
- β Go binary requires compilation or Docker for installation
π§ Exposed tools (7 tools)
| Tool | Category | Description |
|---|---|---|
| list_workspaces | hcp-terraform | List HCP Terraform workspaces in an organization |
| create_workspace | hcp-terraform | Create a new HCP Terraform workspace |
| manage_variables | hcp-terraform | Manage workspace variables in HCP Terraform |
| search_providers | registry | Search for Terraform providers in the registry |
| get_provider_details | registry | Get detailed documentation for a specific Terraform provider |
| search_modules | registry | Search for Terraform modules in the registry |
| get_module_details | registry | Get details and usage examples for a Terraform module |
β‘ Installation
Prerequisites:
- β’ go v1.21+
- β’ Optional HCP Terraform token for workspace management
Check Claude Code documentation to configure this MCP server.
π‘ Tips & tricks
Use Docker for the quickest setup: docker run hashicorp/terraform-mcp-server:0.4.0. Enable tool filtering to limit exposed tools to just what your workflow needs, reducing noise for the AI assistant.
Quick info
- Author
- HashiCorp
- License
- MPL-2.0
- Runtime
- Go 1.21+
- Transport
- stdio
- Category
- devops
- Difficulty
- Intermediate
- Self-hostable
- β
- Auth
- β
- Docker
- π³ Docker available
- Version
- 0.4.0
- Updated
- Feb 28, 2026
Client compatibility
- β Claude Code
- β Cursor
- β VS Code Copilot
- β Gemini CLI
- β Windsurf
- β Cline
- β JetBrains AI
- β Warp
Platforms
π macOS π§ Linux πͺ Windows