Terraform MCP Server
12 comments
·May 19, 2025leetrout
I will say I've had a lot of success with AI and boiler plate HCL.
I try to avoid modules out of the gate until I know the shape of a system and the lifecycles of things and I've been pleasantly surprised with how well the AI agents get AWS things correct out of the gate with HCL.
This should super charge this workflow since it should be able to pull out the provider docs / code for the specific version in use from the lockfile.
RainyDayTmrw
I dunno about this. Infra-as-code has always been a major source of danger. Now we want to put AI on it?
teej
There's zero danger writing Terraform. The danger is running `apply`.
throwup238
Does anyone know of an MCP server like this that can work with Terragrunt?
d_watt
I'd think this would work, as the 4 tools listed are about retrieving information to give agents more context of correct providers and modules. Given terragrunt works with terraform directly, I'd think that it would help with it as well, just add rules/prompts that are explicit about the code being generated being in terra grunt file structure / with terragrunt commands.
notpushkin
And it’s MPL, so you’re free to use it with OpenTofu as well (even if competing with Hashicorp).
But as mdaniel notes in a sibling thread, this doesn’t seem to do much at this point.
ivolimmen
Initially thought the MCP acronym would stand for "Master control program". Was disappointed.
fakedang
Funny anecdote, I asked Claude 3.7 to explain MCP to me and it went on blabbering on something about Master Control Programs.
curtisszmania
[dead]
tecleandor
Oh, just what I needed to raise my RUMs and send my Hashicorp bill through the roof!
mdaniel
I didn't downvote you, but this thing is actually back to their MPL-2 roots (for now!) and I don't see any references to github.com/hashicorp/terraform in https://github.com/hashicorp/terraform-mcp-server/blob/v0.1.... and I would guess patching https://github.com/hashicorp/terraform-mcp-server/blob/v0.1.... to accept an env-var or config flag or whatever would decouple it from their centralization
The back side of that coin is that it similarly just(?) seems to be a fancy way of feeding the terraform provider docs to the LLM, which was already available via `tofu provider schema -json` without all this http business. IMHO the fields in the provider binary that don't have populated "description" fields are a bug
Maybe i dont understand this to well but isnt this basically a wrapper for github.com/mark3labs/mcp-go/server