search_providersLABSCO SUMMARY
Current registry documentation, plus the workspace controls behind a switch.
The registry half fixes the everyday problem — an assistant writing provider blocks out of whatever it memorised during training — by fetching today's documentation instead. The HCP Terraform half goes further and manages workspaces, variables and runs, with the part that can destroy infrastructure deliberately gated behind its own flag.
What it is
HashiCorp's server for Terraform work, split into three toolsets: the public registry, private registries, and HCP Terraform or Terraform Enterprise operations. It also serves the Terraform style guide and module-development guide as resources the client can read directly.
What you get
- Provider documentation searched with search_providers and returned in full markdown by get_provider_details, plus get_latest_provider_version
- Modules found with search_modules, read with get_module_details for inputs, outputs, examples and submodules, and pinned with get_latest_module_version
- Sentinel policies through search_policies and get_policy_details, for governance and compliance questions
- Organizations, projects and workspaces through list_terraform_orgs, list_terraform_projects, list_workspaces and get_workspace_details
- Runs through list_runs, get_run_details and create_run, which takes plan_and_apply, refresh_state, plan_only or allow_empty_apply
- Plans and applies read as metadata, execution logs, or machine-readable JSON — get_plan_details, get_plan_logs, get_plan_json_output, get_apply_details, get_apply_logs
- Variables and variable sets managed with list_variable_sets, create_variable_set, create_variable_in_variable_set, attach_variable_set_to_workspaces, list_workspace_variables, create_workspace_variable and update_workspace_variable
- Workspace tags through create_workspace_tags and read_workspace_tags, policy sets through get_workspace_policy_sets and attach_policy_set_to_workspace
- Private registry contents — search_private_modules, get_private_module_details, search_private_providers, get_private_provider_details
- Stacks listed with list_stacks and read with get_stack_details, and get_token_permissions to see what your token is allowed to do
- The tools that can change infrastructure — create_workspace, update_workspace, delete_workspace_safely and action_run — held behind ENABLE_TF_OPERATIONS
Requirements
Docker Engine v20.10.21 or later, or Docker Desktop v4.14.0 or later, to run the published image; pre-compiled binaries cover the other operating systems. Registry tools need nothing more. For HCP Terraform or Terraform Enterprise, set TFE_TOKEN to an API token, and TFE_ADDRESS to your own address if you are not on https://app.terraform.io. Creating, updating and deleting workspaces, and applying or destroying through a run, stay off until ENABLE_TF_OPERATIONS is true. TRANSPORT_MODE=streamable-http turns the stdio server into an HTTP one.
Setup effort
One command — docker run -i --rm hashicorp/terraform-mcp-server
USE CASES
Writing a resource block you have not written before
Search the provider documentation and read the full page for that resource, as it stands now.
Choosing a module instead of building one
Search the registry, then read its inputs, outputs and examples before you commit to it.
Working out why a run failed
Read the run, then its plan logs — or take the plan as structured JSON instead of parsing text.
Setting variables across a group of workspaces
List the variable sets, create one, add variables to it, and attach it to the workspaces that need it.
Checking what policy applies before proposing a change
Read the policy sets attached to the workspace, and the permissions your own token carries.
Kicking off a plan and watching it land
Create the run as plan_only or plan_and_apply, then read its details and apply logs as it progresses.
44 tools
Listed in project docs. Your client may show a different list.
get_provider_detailsget_latest_provider_versionsearch_modulesget_module_detailsget_latest_module_versionsearch_policiesget_policy_detailslist_terraform_orgslist_terraform_projectslist_workspacesget_workspace_detailscreate_workspaceupdate_workspacedelete_workspace_safelylist_runsget_run_detailscreate_runaction_runsearch_private_modulesget_private_module_detailssearch_private_providersget_private_provider_detailsget_workspace_policy_setsattach_policy_set_to_workspaceget_token_permissionsget_plan_json_outputget_plan_detailsget_plan_logsget_apply_detailsget_apply_logslist_variable_setscreate_variable_setcreate_variable_in_variable_setdelete_variable_in_variable_setattach_variable_set_to_workspacesdetach_variable_set_from_workspaceslist_workspace_variablescreate_workspace_variableupdate_workspace_variablecreate_workspace_tagsread_workspace_tagslist_stacksget_stack_detailsBEFORE YOU INSTALL
What to know first
Tools you get
44 tools named in the project's documentation.
Requires
docker on PATH
Optional
TFE_TOKEN in your environment
INSTALLATION
Connect your client
Server setup
docker run -i --rm hashicorp/terraform-mcp-serverMCP Clients
VS Code — Docker
{
"servers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"TFE_TOKEN=${input:tfe_token}",
"-e",
"TFE_ADDRESS=${input:tfe_address}",
"hashicorp/terraform-mcp-server:1.3.0"
]
}
},
"inputs": [
{
"type": "promptString",
"id": "tfe_token",
"description": "Terraform API Token",
"password": true
},
{
"type": "promptString",
"id": "tfe_address",
"description": "Terraform Address",
"password": false
}
]
}Cursor, Claude Desktop, Other MCP clients
{
"mcpServers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"TFE_ADDRESS=<<<YOUR_TFE_ADDRESS>>>",
"-e",
"TFE_TOKEN=<<<YOUR_TFE_TOKEN>>>",
"hashicorp/terraform-mcp-server:1.3.0"
]
}
}
}Claude Code — stdio
claude mcp add terraform -s user -t stdio -- docker run -i --rm hashicorp/terraform-mcp-serverClaude Code — HTTP
claude mcp add --transport http terraform http://localhost:8080/mcpCodex — stdio
codex mcp add terraform -- docker run -i --rm hashicorp/terraform-mcp-serverCodex — HTTP
codex mcp add terraform --url http://localhost:8080/mcpGemini CLI
gemini extensions install https://github.com/hashicorp/terraform-mcp-serverBob IDE
{
"mcpServers": {
"terraform": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"TFE_ADDRESS=<<<YOUR_TFE_ADDRESS>>>",
"-e",
"TFE_TOKEN=<<<YOUR_TFE_TOKEN>>>",
"hashicorp/terraform-mcp-server:1.3.0"
],
"disabled": false
}
}
}VS Code — local build
{
"servers": {
"terraform": {
"type": "stdio",
"command": "<YOUR_PATH_TO_TERRAFORM_MCP_SERVER>",
"env": {
"TFE_TOKEN": "<<<YOUR_TFE_TOKEN>>>"
}
}
}
}