Skip to directory

Terraform MCP

HashiCorp

stdio (default); streamableHTTP45 documented tools25

About Terraform MCP

A local MCP server for Terraform Registry research and, when configured, HCP Terraform or Terraform Enterprise workspace operations.

What you can use it for

  • Find provider docs, resources, data sources, functions, and versions
  • Search public and private Terraform modules
  • Inspect HCP Terraform organizations, workspaces, runs, variables, and stacks when authenticated
Connection and setup
Hosting
Local stdio or remote Streamable HTTP deployment
Transport
stdio (default); streamableHTTP
Endpoint
Local process; no hosted endpoint documented
Authentication
No token is required for public Terraform Registry tools. HCP Terraform or Terraform Enterprise features require a TFE_TOKEN; Terraform Enterprise may also require TFE_ADDRESS/TFE_HOSTNAME depending on the documented deployment setup.

Requirements

  • Docker Engine 20.10.21+ or Docker Desktop 4.14.0+ for the recommended Docker setup
  • An MCP-compatible client
  • An HCP Terraform or Terraform Enterprise API token only for those private/organization features

Setup steps

  1. For public Registry lookup, configure Docker to run -i --rm hashicorp/terraform-mcp-server; no token is needed.
  2. For HCP Terraform or Terraform Enterprise, provide a locally stored least-privilege TFE_TOKEN and the appropriate address/hostname.
  3. Keep ENABLE_TF_OPERATIONS false unless you deliberately need the write/destructive operations; then reload the client and inspect the available tools.
Tools 45

Names match HashiCorp’s reference. Availability depends on enabled toolsets and credentials; private-registry and Terraform operations require a valid TFE_TOKEN, and operational tools require ENABLE_TF_OPERATIONS=true.

  • search_providers

    Find provider documentation by service name.

    01
  • get_provider_details

    Retrieve documentation for a provider component.

    02
  • get_provider_capabilities

    List provider resource types, data sources, and functions.

    03
  • get_latest_provider_version

    Find the latest version of a provider.

    04
  • search_modules

    Find public Registry modules by name or function.

    05
  • get_module_details

    Retrieve module docs, inputs, outputs, examples, and submodules.

    06
  • get_latest_module_version

    Find a module's latest version.

    07
  • search_policies

    Search Sentinel policies.

    08
  • get_policy_details

    Retrieve Sentinel policy details.

    09
  • list_terraform_orgs

    List Terraform organizations.

    10
  • list_terraform_projects

    List Terraform projects.

    11
  • list_workspaces

    Search and list workspaces.

    12
  • get_workspace_details

    Retrieve workspace configuration, variables, and state information.

    13
  • create_workspace

    Create a workspace; gated by ENABLE_TF_OPERATIONS.

    14
  • update_workspace

    Update workspace configuration; gated by ENABLE_TF_OPERATIONS.

    15
  • delete_workspace_safely

    Delete an eligible workspace; gated by ENABLE_TF_OPERATIONS.

    16
  • list_runs

    List or search runs.

    17
  • get_run_details

    Get run details including logs and status.

    18
  • create_run

    Create a Terraform run.

    19
  • action_run

    Apply, discard, or cancel runs; gated by ENABLE_TF_OPERATIONS.

    20
  • search_private_modules

    Search private modules in an organization.

    21
  • get_private_module_details

    Retrieve private module details.

    22
  • search_private_providers

    Search private providers.

    23
  • get_private_provider_details

    Retrieve private provider details.

    24
  • get_workspace_policy_sets

    List policy sets attached to a workspace.

    25
  • attach_policy_set_to_workspace

    Attach a policy set to a workspace.

    26
  • get_token_permissions

    Inspect permissions for the configured TFE_TOKEN.

    27
  • get_plan_json_output

    Retrieve structured JSON for a Terraform plan.

    28
  • get_plan_details

    Retrieve plan metadata.

    29
  • get_plan_logs

    Retrieve plan logs.

    30
  • get_apply_details

    Retrieve apply metadata.

    31
  • get_apply_logs

    Retrieve apply logs.

    32
  • list_variable_sets

    List organization variable sets.

    33
  • create_variable_set

    Create a variable set.

    34
  • create_variable_in_variable_set

    Add a variable to a variable set.

    35
  • delete_variable_in_variable_set

    Remove a variable from a variable set.

    36
  • attach_variable_set_to_workspaces

    Attach a variable set to workspaces.

    37
  • detach_variable_set_from_workspaces

    Detach a variable set from workspaces.

    38
  • list_workspace_variables

    List workspace variables.

    39
  • create_workspace_variable

    Create a workspace variable.

    40
  • update_workspace_variable

    Update a workspace variable.

    41
  • create_workspace_tags

    Add tags to a workspace.

    42
  • read_workspace_tags

    Read workspace tags.

    43
  • list_stacks

    List Terraform Stacks.

    44
  • get_stack_details

    Read a Terraform Stack's details.

    45
Limitations and notes
  • Available tools depend on configured toolsets and environment variables.
  • Destructive operations are disabled by default; enabling ENABLE_TF_OPERATIONS exposes actions that may modify or destroy infrastructure.
  • Private registry and organization data require network access and an API token.
Original sources
  • official tool reference

    Reviewed current publisher or maintainer documentation for the tool inventory, availability, endpoint, or configuration.

Documentation checked 2026-10-28T00:00:00Z. Connection has not been runtime tested.