Server facts
Terraform MCP Server
Project
- Author
- hashicorp
- License
- MPL-2.0
- Category
- Cloud & DevOps
Tech
- Runtime / language
- goGo
- Transports
- stdio
- Remote available
- No
- Authentication
- Not specified
Activity
- GitHub stars
- 1,550
- Last commit
- Data as of
Tags
- Go
- Infrastructure As Code
- Terraform
- Terraform Registry
- Workspace Management
Overview
Terraform MCP Server brings Terraform information and platform operations into assistant-driven infrastructure workflows. It integrates with public Registry APIs for providers, modules, and policies, while also connecting to HCP Terraform and Terraform Enterprise. The README describes organization and project listing, private registry access, and workspace management. This makes the server relevant both when researching infrastructure components and when working with an existing Terraform platform environment.
Workspace capabilities include creating, updating, and deleting workspaces, plus handling variables, tags, and runs. Tool filtering allows deployments to select groups or individual operations rather than exposing the entire surface. Operations requiring explicit approval are controlled by a separate setting that defaults to disabled. The documentation also warns that queried Terraform data may be passed to the client and language model, and recommends reviewing generated recommendations against security, cost, and compliance requirements before implementation.
The server supports stdio and streamable HTTP. Docker examples cover common assistant clients, and Go installation is documented for a native executable. Platform address and token settings configure HCP Terraform or Enterprise access. HTTP settings include session behavior, allowed origins, TLS files, organization restrictions, and rate limits. Optional OpenTelemetry metrics report tool activity and HTTP behavior in network mode. The README links out to a fuller tool reference; the supplied text itself names provider search and detail tools in a filtering example but does not provide the complete catalog.
Install & configure
Requirements
- Docker installed and running
- An MCP-compatible assistant
docker run -i --rm hashicorp/terraform-mcp-serverThis command is the README's local Claude Code Docker launch. HCP Terraform or Enterprise access additionally uses TFE_ADDRESS and TFE_TOKEN, which must be forwarded into the container as shown in the README's client-specific examples. Public Registry use and platform access are distinct configurations.
Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"terraform-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
],
"env": {}
}
}
}Config file · Project: .cursor/mcp.json
User: ~/.cursor/mcp.json
The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"terraform-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
],
"env": {}
}
}
}Config file · Workspace: .vscode/mcp.json
For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.
{
"servers": {
"terraform-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
],
"env": {}
}
}
}Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"terraform-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
],
"env": {}
}
}
}Config file · Project scope: .mcp.json at the repository root
The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"terraform-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"hashicorp/terraform-mcp-server"
],
"env": {}
}
}
}Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Tools
Source: repository README. Tool descriptions are a documented snapshot, not a live capability check.
| Tool | What it does |
|---|---|
| search_providers | Search Terraform providers; named in the README's tool-filtering example. |
| get_provider_details | Retrieve provider details; named in the README's tool-filtering example. |
Names, permissions, and defaults can change. Check the current upstream documentation before granting access.
Use cases
- Look up provider and module information while drafting Terraform configuration.
- Access private registry information for an existing organization.
- Manage Terraform workspaces, variables, tags, and runs.
- Expose selected Terraform capabilities to a shared HTTP MCP client.
Strengths
- Combines public Registry access with HCP Terraform and Enterprise integration.
- Supports local stdio and configurable streamable HTTP.
- Offers tool selection and optional OpenTelemetry metrics.
Limitations
- Connected clients and models may receive sensitive Terraform data.
- Write-capable platform operations need deliberate permission and tool configuration.
- The complete tool catalog is linked externally rather than included in the supplied README.
Frequently asked questions
Independent listing, not an affiliation or security review. Grant the least access needed and verify the upstream instructions before running code.