Basic information
About HashiCorp Terraform MCP Server
Official HashiCorp Terraform MCP server. Real-time access to provider documentation, module specifications, and Sentinel policies from the Terraform Registry.
HashiCorp Terraform is a MCP server in the Cloud Infrastructure category listed in the AddMCP.net directory, published by hashicorp. It exposes 16 tools, including search_providers, get_provider_documentation, list_provider_versions, search_modules and more. Supported transport: stdio. Runtime: TypeScript. License: MIT. The repository has 14,047 GitHub stars. Source code is hosted on github.com. Related topics: cloud-infrastructure, official.
Setup
{
"mcpServers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
]
}
}
}
{
"mcpServers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
]
}
}
}
{
"servers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
]
}
}
}
HashiCorp Terraform MCP Server config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
]
}
}
}
HashiCorp Terraform MCP Server tools
- search_providers — Search for Terraform providers in the registry with filtering options
- get_provider_documentation — Retrieve comprehensive documentation for a specific Terraform provider
- list_provider_versions — List all available versions for a specific Terraform provider
- search_modules — Search for Terraform modules in the registry with filtering and sorting options
- get_module_specification — Retrieve detailed specifications and usage examples for a Terraform module
- list_module_versions — List all available versions for a specific Terraform module
- get_module_readme — Fetch the README documentation for a specific Terraform module
- validate_hcl_syntax — Validate Terraform HCL configuration syntax and return any errors
- list_resource_types — List all resource types available for a specific provider
- get_resource_schema — Retrieve the complete schema for a specific Terraform resource type
- search_sentinel_policies — Search for Sentinel policies in the Terraform Cloud policy registry
- get_sentinel_policy — Retrieve a specific Sentinel policy with its configuration and rules
- validate_sentinel_policy — Validate Sentinel policy syntax and test against sample data
- list_data_sources — List all data sources available for a specific Terraform provider
- get_data_source_schema — Retrieve the schema definition for a specific Terraform data source
- format_hcl_configuration — Format Terraform HCL configuration according to standard conventions
Overview
What is HashiCorp Terraform?
The Terraform MCP Server is a Model Context Protocol server that integrates with Terraform Registry APIs, HCP Terraform, and Terraform Enterprise. It enables AI assistants to manage Infrastructure as Code workflows, including workspace operations, provider/module lookups, and run management.
How to use HashiCorp Terraform?
Run the server as a Docker container configured via environment variables. Connect it to an MCP-compatible assistant (VS Code, Cursor, Claude Desktop, etc.). Use the terraform-mcp-server stdio or terraform-mcp-server streamable-http command, or the equivalent Docker command, depending on your chosen transport mode. Set required environment variables like TFE_TOKEN, TFE_ADDRESS, and optionally TRANSPORT_MODE.
Key features of HashiCorp Terraform
- Dual transport: Stdio and StreamableHTTP
- Terraform Registry integration for providers, modules, policies
- HCP Terraform and Terraform Enterprise workspace management
- Workspace CRUD with variables, tags, and run management
- OpenTelemetry metrics for tool usage monitoring
- Security and access controls (rate limiting, organization allowlists, TLS)
Use cases of HashiCorp Terraform
- Manage Terraform workspaces (create, update, delete) via chat
- Query the Terraform Registry for provider and module versions
- Automate infrastructure deployment with AI assistants
- Audit workspace configurations and variables across organizations
- Integrate IaC workflows directly into IDE agent mode (VS Code, Cursor)
Frequently asked questions
1 What are the prerequisites for running the Terraform MCP Server?
You need Docker installed and running, plus an AI assistant that supports the Model Context Protocol (MCP).
2 What data does the Terraform MCP Server expose?
Depending on the query, the server may expose certain Terraform data to the MCP client and LLM. Do not use it with untrusted MCP clients or LLMs.
3 How do I configure the Terraform MCP Server for my organization?
Configure it via environment variables such as TFE_ADDRESS, TFE_TOKEN, and TRANSPORT_MODE. For StreamableHTTP mode you can set host, port, TLS, rate limits, and an organization allowlist.
4 How do I monitor usage of the Terraform MCP Server?
Enable OpenTelemetry
Videos
Tutorials, guides, and showcases related to HashiCorp Terraform MCP Server. The player loads when you press play.
Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In