MCP server providing Terraform infrastructure-as-code tools for Claude
The server registers 6 Terraform tools with explicit schemas via Zod and descriptions. All tool names follow verb_noun convention (terraform_<action>), which is appropriate. Schemas are present and properly typed using Zod. However, descriptions are generic and lack LLM-optimized guidance on WHEN to use each tool, WHAT it modifies, and recovery paths for errors. Parameter descriptions exist but are minimal (10-30 chars), providing little actionable context. Output schemas are not documented, callers cannot predict the response structure. Error handling returns raw text without categorization or recovery guidance. Security concerns are present: no input validation or path traversal guards despite executing arbitrary Terraform commands. The tool set covers basic Terraform operations but lacks composition guidance and inter-tool dependencies.
Apply Terraform changes to reach the desired infrastructure state
Initialize a Terraform working directory, downloading providers and modules
Read output values from the Terraform state
Generate and show a Terraform execution plan for infrastructure changes
List all resources tracked in the Terraform state file
Validate Terraform configuration files for syntax and consistency errors
Missing output schema documentation. No tool documents what the response structure looks like (e.g., fields, types, pagination). LLMs cannot predict downstream data shapes and cannot plan chained calls.
Parameter descriptions are minimal (10-30 chars) and lack actionable context. E.g., 'Path to the Terraform working directory' does not explain whether relative or absolute paths are required, what happens if the directory does not exist, or the impact of choosing a different directory.
Tool descriptions do not specify whether the tool modifies infrastructure state. terraform_apply is clearly destructive (marked IRREVERSIBLE in metadata), but the description does not state 'This creates, updates, or destroys real infrastructure. Confirm before calling.' Agents need explicit guidance on side effects.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 65 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 46 | - | v1 |
No input validation or command injection guards. The tools pass user-provided strings directly to execSync() without sanitization. An LLM tricked via prompt injection could pass 'working_dir: /tmp; rm -rf /' or similar. Terraform arguments are shell-executed, creating a command injection surface.
Error handling returns raw execSync() error messages without categorization or recovery guidance. When terraform_apply fails, the LLM receives a stderr dump but no hint about whether to retry, ask the user, or call a different tool. Errors should categorize as retryable, user-fixable, or fatal.
No confirmation or dry-run support for irreversible operations. terraform_apply directly modifies infrastructure with auto_approve=true by default. A destructive LLM error (e.g., accidentally applying a destroy plan) causes real data loss with no rollback path.
Parameter 'working_dir' is required but no documentation on path security or validation. No indication of whether paths are checked for escapes, symlink resolution, or access control. A malicious or confused agent could target unauthorized directories.
backend_config parameter in terraform_init accepts arbitrary key-value pairs with no validation. No documentation of allowed keys, constraints, or what values are safe vs. dangerous. An LLM could pass sensitive credentials as backend config values.
No tool composition guidance. terraform_plan saves output to a file but terraform_apply accepts plan_file as input, the dependency is not documented. An LLM may not know it should call plan first, then apply with the plan_file. Add a 'Prerequisites' section.
No audit logging or permission gates. These tools execute arbitrary Terraform commands, which can read/write cloud infrastructure. No indication that calls are logged, that permissions are checked before execution, or that users can audit who ran what.