terraform-mcp-server

hashicorp/terraform-mcp-server

4.5

terraform-mcp-server is hosted online, so all tools can be tested directly either in theInspector tabor in theOnline Client.

If you are the rightful owner of terraform-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Terraform MCP Server is a Model Context Protocol server that integrates with Terraform Registry APIs for advanced automation in Infrastructure as Code development.

Try terraform-mcp-server with chat:

Tools

Functions exposed to the LLM to take actions

get_latest_module_version

Fetches the latest version of a Terraform module from the public registry

get_latest_provider_version

Fetches the latest version of a Terraform provider from the public registry

get_module_details

Fetches up-to-date documentation on how to use a Terraform module. You must call 'search_modules' first to obtain the exact valid and compatible module_id required to use this tool.

get_policy_details

Fetches up-to-date documentation for a specific policy from the Terraform registry. You must call 'search_policies' first to obtain the exact terraform_policy_id required to use this tool.

get_provider_capabilities

Get the capabilities of a Terraform provider including the types of resources, data sources, functions, guides, and other features it supports. This tool analyzes the provider documentation to determine what types of capabilities are available:

  • resources: Infrastructure resources that can be created/managed
  • data-sources: Read-only data sources for querying existing infrastructure
  • functions: Provider-specific functions for data transformation
  • guides: Documentation guides and tutorials for using the provider
  • actions: Available provider actions (if any)
  • ephemeral resources: Temporary resources for credentials and tokens
  • list resources: Resources for listing multiple items of specific types

Returns a summary with counts and examples for each capability type.

get_provider_details

Fetches up-to-date documentation for a specific service from a Terraform provider. You must call 'search_providers' tool first to obtain the exact tfprovider-compatible provider_doc_id required to use this tool.

search_modules

Resolves a Terraform module name to obtain a compatible module_id for the get_module_details tool and returns a list of matching Terraform modules. You MUST call this function before 'get_module_details' to obtain a valid and compatible module_id. When selecting the best match, consider the following: - Name similarity to the query - Description relevance - Verification status (verified) - Download counts (popularity) Return the selected module_id and explain your choice. If there are multiple good matches, mention this but proceed with the most relevant one. If no modules were found, reattempt the search with a new moduleName query.

search_policies

Searches for Terraform policies based on a query string. This tool returns a list of matching policies, which can be used to retrieve detailed policy information using the 'get_policy_details' tool. You MUST call this function before 'get_policy_details' to obtain a valid terraform_policy_id. When selecting the best match, consider the following: - Name similarity to the query - Title relevance - Verification status (verified) - Download counts (popularity) Return the selected policyID and explain your choice. If there are multiple good matches, mention this but proceed with the most relevant one. If no policies were found, reattempt the search with a new policy_query.

search_providers

This tool retrieves a list of potential documents based on the 'service_slug' and 'provider_document_type' provided. You MUST call this function before 'get_provider_details' to obtain a valid tfprovider-compatible 'provider_doc_id'. Use the most relevant single word as the search query for 'service_slug', if unsure about the 'service_slug', use the 'provider_name' for its value. When selecting the best match, consider the following: - Title similarity to the query - Category relevance Return the selected 'provider_doc_id' and explain your choice. If there are multiple good matches, mention this but proceed with the most relevant one.

Prompts

Interactive templates invoked by user choice

No prompts

Resources

Contextual data attached and managed by the client

No resources