MCP server for managing Terraform infrastructure via Claude
This is a well-structured Terraform MCP server with 11 tools covering a comprehensive domain. Strengths: all tools have descriptions (100+ chars each), all parameters have type definitions and descriptions, tool names follow verb_resource convention (tf_*), and critical safety patterns are implemented (two-step confirmation for destructive operations, environment-based safety modes). Weaknesses: output schemas are not explicitly documented in the tool definitions themselves; some parameter descriptions lack constraint details (ranges, formats); error handling guidance is minimal; composition could be tighter (tf_state and tf_resource are multi-operation tools that could be split).
Apply Terraform changes to real infrastructure. TWO-STEP SAFETY FLOW: 1. Call without confirmed=true → runs terraform plan, shows the diff, returns without applying. 2. Call with confirmed=true after reviewing the diff → actually applies the changes. Never pass confirmed=true without first showing the plan output to the user.
Destroy all Terraform-managed infrastructure in the workspace. TWO-STEP SAFETY FLOW: 1. Call without confirmed=true → shows the destroy plan (what will be deleted). 2. Call with confirmed=true after the user explicitly approves → destroys everything. This is irreversible. Always show the plan and get explicit user approval first.
Detect infrastructure drift — resources that were changed outside of Terraform (e.g. manually in the cloud console). Runs a refresh-only plan and reports differences between state and reality. Read-only, makes no changes.
Initialize a Terraform working directory. Downloads providers and modules. Run this before plan or apply on a fresh workspace.
Read Terraform output values from the current state. Returns all outputs as JSON, or a specific output by name.
Multi-operation tools (tf_state, tf_resource) combine multiple concerns into single tools, violating single-responsibility principle. tf_state bundles list/show/mv/rm operations; tf_resource bundles import/taint/untaint/refresh. This forces LLMs to reason about which operation to invoke and makes error handling complex.
Output schemas are not explicitly documented. While the tools return structured data (inferred from context), the expected output fields, types, and structure are not formally defined in the tool schemas. This forces LLMs to infer response structure and risks misinterpretation.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 58 | 2025-06-18+ | v2 |
Run terraform plan and return a human-readable diff of what will change. Safe — makes no changes to infrastructure.
Check which cloud providers are used in a Terraform workspace and verify authentication status for each. Call this before plan or apply to catch credential issues early.
Resource-level state operations: - import: Bring an existing cloud resource under Terraform management (requires address + id) - taint: Mark a resource for recreation on next apply (requires address) - untaint: Remove the taint mark (requires address) - refresh: Sync state with real infrastructure (accepts drift into state)
Manage Terraform state. Supports the following operations: - list: List all resources in state - show: Show attributes of a specific resource - mv: Move/rename a resource in state (use with care) - rm: Remove a resource from state without destroying it (destructive)
Validate Terraform configuration files for syntax and internal consistency. Does not access remote state or APIs.
Manage Terraform workspaces. Supports: - list: List all workspaces and show which is active - show: Show the current workspace name - select: Switch to a workspace - new: Create a new workspace
Parameter constraint documentation is incomplete. Several parameters lack explicit format, range, or pattern constraints in descriptions. E.g., 'workdir' just says 'Absolute or relative path' but doesn't specify what happens if the path doesn't exist or is outside allowed boundaries. 'vars' accepts 'key=value format' but doesn't validate malformed input.
Error handling lacks recovery guidance. Error responses from the tools do not include actionable next steps. For example, if tf_init fails due to missing credentials, the response should guide toward tf_preflight or tf_login prompt; currently errors are raw Terraform exit codes.
Tool names for state/resource operations are not verb-noun precise. 'tf_state' with operation enum is ambiguous, 'tf_state_mv' or 'tf_move_state_resource' would be clearer. Similarly, 'tf_resource' doesn't clarify import vs taint vs untaint, separate tools (tf_import_resource, tf_taint_resource, tf_untaint_resource, tf_refresh_resource) would improve discoverability.
Result limits and pagination are not mentioned. Tools like tf_state_list could return hundreds of resources. No explicit cap, limit parameter, or pagination guidance is documented. Large responses risk exhausting LLM context.
Workspace parameter defaults and dependency hints are missing. Many tools accept 'workspace' but default behavior (current vs default workspace) is undocumented. LLMs cannot determine if they need to call tf_workspace_show first.