Overview
What is HCP Terraform MCP Server?
HCP Terraform MCP Server is an MCP server that integrates with HCP Terraform (TFE) to manage Terraform resources via the Model Context Protocol. It is intended for developers using MCP-compatible clients to interact with HCP Terraform.
How to use HCP Terraform MCP Server?
Build the binary from source using go build in the cmd/hcp-terraform-mcp-server directory. Set the HCP_TFE_TOKEN environment variable to your HCP Terraform token. Configure your MCP client to use the built executable as the command with the stdio argument, as shown in the example JSON.
Key features of HCP Terraform MCP Server
- Provides an MCP server for HCP Terraform (TFE)
- Uses stdio transport with the
stdiosubcommand - Requires
HCP_TFE_TOKENenvironment variable for authentication
Use cases of HCP Terraform MCP Server
—
FAQ from HCP Terraform MCP Server
How do I build the HCP Terraform MCP Server?
Run go build in the cmd/hcp-terraform-mcp-server directory, optionally using the -o flag to specify the output location.
What environment variable is required?
You must set the HCP_TFE_TOKEN environment variable to your HCP Terraform API token.
How do I configure the server for MCP?
In your MCP client configuration, set the command to the path of the built binary, args to ["stdio"], and provide the HCP_TFE_TOKEN in the env block.
What transport does the server use?
The server uses stdio transport, specified by the stdio subcommand.
Can I run the server without Docker?
Yes, the server can be built from source using Go and run directly; Docker is not required.