mcp-server-terraform
This server lets you manage Terraform infrastructure through natural language, translating conversational requests into real Terraform CLI commands.
Core Terraform Workflow
Initialize (
tf_init): Set up a working directory, download providers/modulesValidate (
tf_validate): Check.tffiles for syntax errors without accessing remote APIsPlan (
tf_plan): Preview changes with a structured risk/cost summary, flagging expensive always-on resources (NAT gateways, EKS/RDS clusters, etc.) with estimated monthly costsApply (
tf_apply): Apply changes with a built-in two-step confirmation flowDestroy (
tf_destroy): Tear down infrastructure with the same two-step confirmation gate
State & Resource Management
Outputs (
tf_output): Retrieve output values from current stateState (
tf_state): List, show, move, or remove resources from stateResources (
tf_resource): Import existing cloud resources, taint/untaint for forced recreation, or refresh stateWorkspaces (
tf_workspace): List, show, select, or create workspaces
Diagnostics & Safety
Preflight checks (
tf_preflight): Verify cloud provider authentication before running commandsDrift detection (
tf_drift): Identify resources changed outside of Terraform via a refresh-only plan/tf-diagnoseprompt: Guides Claude through systematic troubleshooting of failuresSafety modes: Restrict available tools to read-only or non-destructive subsets via environment variables
Audit logging: Every tool call logged as JSON with variable values redacted
Dangerous flag blocking: Prevents use of risky Terraform CLI flags
Allows managing Terraform infrastructure, including planning, applying, destroying, inspecting state, detecting drift, importing resources, and more, all through natural language commands.
mcp-server-terraform
A Model Context Protocol (MCP) server that lets Claude manage Terraform infrastructure through natural language.
Run plans, apply changes, inspect state, and diagnose failures — all from a Claude conversation.
What it does
Instead of switching to a terminal to run terraform plan, you can ask Claude:
"Plan the changes in
/infra/stagingand explain what will change"
"Apply it — but only if no resources will be destroyed"
"Show me all the outputs from the prod workspace"
"Something broke after the last apply — diagnose it"
The server translates these into real terraform CLI commands on your machine, with a built-in safety confirmation flow before any destructive operation runs.
Related MCP server: tfmcp
Tools
Tool | Description | Destructive |
| Initialize a Terraform working directory | No |
| Validate configuration syntax | No |
| Run a plan and return the diff + risk/cost summary | No |
| Apply changes (requires | Yes |
| Destroy infrastructure (requires | Yes |
| Read output values from state | No |
| List, show, move, or remove state entries | Partial |
| List, show, select, or create workspaces | No |
| Check provider CLI authentication before running | No |
| Detect resources changed outside Terraform | No |
| Import, taint, untaint, or refresh resources | Yes |
Plan risk & cost summary
Every plan (and every apply preview) is analyzed via terraform show -json and
annotated with a structured summary — destroyed resources are called out, and
always-on resources that commonly cause bill shock are flagged with rough
monthly costs:
── Plan Summary ──
+ 3 create, ~ 1 update, - 0 destroy, ± 0 replace
💸 EXPENSIVE — always-on resources being created:
⚠ aws_nat_gateway.main (~$32/month + data processing if left running)
Remember to tf_destroy when you're done experimenting.Cost-flagged resource types include NAT gateways, load balancers, EKS/AKS/GKE control planes, RDS/Cloud SQL instances, ElastiCache, Redshift, MSK, and Azure Firewall (~$900/month!).
Drift detection
tf_drift runs a refresh-only plan and reports resources that were changed
outside Terraform (e.g. manually in the cloud console), with the changed
attribute names and remediation options.
Audit logging
Set AUDIT_LOG_PATH to a file path and every tool call is appended as a JSON
line with timestamp, tool name, outcome, and duration. Variable values are
always redacted (db_password=<redacted>) — only names are logged.
Confirmation flow
tf_apply and tf_destroy use a two-step safety flow:
First call (no
confirmed) → runsterraform plan, shows the diff, does nothing elseSecond call (
confirmed: true) → actually applies or destroys
Claude is instructed to never pass confirmed: true without first presenting the plan to you.
Prompt
The server exposes a /tf-diagnose prompt that guides Claude through a systematic 5-step diagnosis of plan or apply failures.
Prerequisites
Node.js 18 or later
Terraform CLI on your PATH
Claude Desktop (or any MCP-compatible client)
Installation
No install needed — run it straight from npm:
npx @rajsir/mcp-server-terraformOr, for development, from source:
git clone https://github.com/RajeevSirohi/mcp-server-terraform.git
cd mcp-server-terraform
npm install
npm run buildClaude Desktop setup
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"terraform": {
"command": "npx",
"args": ["-y", "@rajsir/mcp-server-terraform"]
}
}
}(If running from source instead, use "command": "node" with "args": ["/absolute/path/to/dist/index.js"].)
Restart Claude Desktop. You should see a hammer icon indicating tools are available.
Usage
Once connected, just talk to Claude about your Terraform workspaces in plain language. Some examples:
First time in a new workspace
"Initialize the terraform config in
C:\infra\stagingand check if I'm logged into the right cloud accounts"
Claude runs tf_init, then tf_preflight — if you're not authenticated it tells you exactly which command to run (az login, aws configure, ...).
The everyday plan → review → apply loop
"Plan the changes in
C:\infra\stagingand explain what will change"
You get the plan diff plus a summary: how many resources created/updated/destroyed, anything destructive called out explicitly, and cost warnings for expensive always-on resources.
"Looks good, apply it"
Claude shows the plan preview one more time and asks for your confirmation — nothing is applied until you say yes. This two-step gate is built into the server itself, not just the prompt, so Claude cannot skip it.
Checking on your infrastructure
"Did anyone change anything outside terraform in the prod workspace?"
tf_drift compares state against reality and reports what was modified in the console, with options to accept or revert.
"Show me all the outputs" · "List everything in state" · "What workspaces exist?"
Learning / experimenting (e.g. cert prep)
"Apply the VPC lab in
C:\labs\vpc, and when I say 'done' destroy everything"
The cost flags are your friend here — if a lab creates a NAT gateway or EKS cluster, the plan summary warns you what it costs per month if forgotten:
💸 EXPENSIVE — always-on resources being created:
⚠ aws_nat_gateway.main (~$32/month + data processing if left running)
Remember to tf_destroy when you're done experimenting.Fixing things
"terraform plan is failing in
C:\infra\staging— diagnose it"
The /tf-diagnose prompt walks Claude through validate → providers → plan → state → outputs systematically. There's also /tf-login for step-by-step authentication setup per provider.
"Import the S3 bucket
my-legacy-bucketinto state asaws_s3_bucket.legacy"
"Taint the web server so it gets recreated on the next apply"
Recommended setup for shared or cautious environments
Run with ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=true (see Safety modes below) so apply/destroy are unavailable entirely, and set AUDIT_LOG_PATH so every operation is logged.
Safety modes
Control which tools are available via environment variables:
Variable | Effect |
| Only |
| Blocks |
| Explicit comma-separated allowlist |
Example — read-only mode:
{
"mcpServers": {
"terraform": {
"command": "node",
"args": ["/path/to/dist/index.js"],
"env": {
"ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "true"
}
}
}
}Development
npm run dev # watch mode (recompiles on save)
npm test # run tests
npm run build # production buildProject structure
src/
index.ts # MCP server entry point, tool registration
config/ # (reserved for future config/telemetry)
models/
common-parameters.ts # Shared Zod schemas
security/
tf-flags.ts # Dangerous flag blocking
tools/
tf-init.ts
tf-validate.ts
tf-plan.ts
tf-apply.ts # Two-step confirmation flow
tf-destroy.ts # Two-step confirmation flow
tf-output.ts
tf-state.ts
tf-workspace.ts
utils/
terraform-runner.ts # Core exec wrapper, workspace switching
prompts/
index.ts # /tf-diagnose prompt
tests/
tf-flags.test.ts
tf-apply.test.tsAdding a new tool
Create
src/tools/tf-yourcommand.ts— export a*Schemaconst and an async handler functionImport both in
src/index.tsAdd the schema to
readonlyToolsordestructiveToolsarrayAdd a
casein theCallToolRequestSchemahandler switch
Roadmap
Terraform Cloud / Enterprise API support (Phase 2)
OpenTelemetry tracing
SSE / streamable HTTP transport for remote deployments
Docker image on GitHub Container Registry
Plan risk & cost analysis
Drift detection
Import / taint / untaint / refresh
Audit logging
CI (build, test matrix, e2e against real terraform)
Contributing
See CONTRIBUTING.md.
License
MIT — see LICENSE.
Available Tools
11 toolstf_applyADestructive
Apply Terraform changes to real infrastructure.
TWO-STEP SAFETY FLOW:
Call without confirmed=true → runs terraform plan, shows the diff, returns without applying.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| vars | No | Variable overrides in key=value format, e.g. ["region=us-east-1"] | |
| target | No | Limit operation to a specific resource address, e.g. aws_instance.web | |
| varFile | No | Path to a .tfvars or .tfvars.json file | |
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| planFile | No | Path to a saved plan file from tf_plan (recommended for exact apply) | |
| confirmed | No | Must be true to actually apply. Omit or set false to preview only. | |
| workspace | No | Terraform workspace to use (default: current workspace) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description discloses the two-step flow, emphasizing safety and the behavior difference between confirmed=false (preview) and confirmed=true (apply), complementing the destructiveHint annotation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Concise, well-structured description with no wasted words; key safety instructions are front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Explains return behavior (plan output vs. actual apply), mentions optional parameters like planFile, and provides sufficient context for a destructive action tool without output schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with parameter descriptions; description adds context for the 'confirmed' parameter via the two-step flow, enhancing understanding beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Apply Terraform changes to real infrastructure' and explains the two-step safety flow, distinguishing it from sibling tools like tf_plan (preview only) and tf_destroy (destroy resources).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly instructs to first call without confirmed=true to preview, then with confirmed=true after reviewing diff, and warns against passing confirmed=true without prior plan output.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_destroyADestructive
Destroy all Terraform-managed infrastructure in the workspace.
TWO-STEP SAFETY FLOW:
Call without confirmed=true → shows the destroy plan (what will be deleted).
Call with confirmed=true after the user explicitly approves → destroys everything.
This is irreversible. Always show the plan and get explicit user approval first.
| Name | Required | Description | Default |
|---|---|---|---|
| vars | No | Variable overrides in key=value format, e.g. ["region=us-east-1"] | |
| target | No | Limit operation to a specific resource address, e.g. aws_instance.web | |
| varFile | No | Path to a .tfvars or .tfvars.json file | |
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| confirmed | No | Must be true to actually destroy. Omit or false to preview only. | |
| workspace | No | Terraform workspace to use (default: current workspace) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the destructiveHint annotation, the description adds critical behavioral details: the tool is irreversible and requires a two-step confirmation process. This fully informs the agent of the destructive nature and necessary precautions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with three sentences and a clear list of steps. Front-loaded with the main purpose, every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a destructive tool with no output schema, the description adequately covers the safety flow and overall behavior. It assumes basic Terraform knowledge but is sufficiently complete for selecting and invoking the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% coverage of parameter descriptions. The description does not add meaning beyond that, but given the high schema coverage, a baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Destroy all Terraform-managed infrastructure in the workspace', using a specific verb and resource. It distinguishes from siblings like tf_apply and tf_plan by emphasizing irreversibility and the destroy action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly outlines a two-step safety flow, guiding when to use without confirmed (preview) and with confirmed (actual destroy). It instructs to always show the plan and get explicit user approval, providing clear usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_driftA
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.
| Name | Required | Description | Default |
|---|---|---|---|
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| workspace | No | Terraform workspace to use (default: current workspace) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite no annotations, the description fully discloses behavior: it runs a refresh-only plan, reports differences, and makes no changes. It explicitly states 'Read-only', which is key for agent decision-making.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise: three sentences cover the tool's purpose, mechanism, and safety. No unnecessary words or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description lacks details about the output format or structure. While it says 'reports differences', it does not specify whether output is text, JSON, or structured data. For a tool with no output schema, this is a gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with clear parameter descriptions. The tool description adds no additional semantic value beyond the tool's overall purpose. A score of 3 is appropriate as parameters are adequately covered by the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Detect infrastructure drift'. It explains what drift is and how it works ('Runs a refresh-only plan and reports differences between state and reality'). This distinguishes it from siblings like tf_plan or tf_apply.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies safety ('Read-only, makes no changes') but does not explicitly guide when to use tf_drift versus alternative sibling tools like tf_plan. Users can infer usage context, but explicit when-to-use advice is missing.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_initA
Initialize a Terraform working directory. Downloads providers and modules. Run this before plan or apply on a fresh workspace.
| Name | Required | Description | Default |
|---|---|---|---|
| upgrade | No | Pass -upgrade to update providers/modules to latest allowed versions | |
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| reconfigure | No | Pass -reconfigure to reinitialize backend even if already configured |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of disclosing behavioral traits. It states that the tool 'Downloads providers and modules', which is a key behavior. However, it does not mention other important aspects such as side effects (e.g., creating .terraform directory), idempotency, or permission requirements. The description provides minimal yet adequate transparency for a straightforward init operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences long, each sentence is informative and front-loaded with the core action. No extraneous words. It earns its place by clearly stating the tool's purpose and usage context.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple init tool with no output schema and 3 parameters fully described in the schema, the description is mostly complete. It explains the tool's role in the Terraform workflow. However, it could mention the creation of the .terraform directory or handling of backend configuration, but the given information suffices for typical usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description does not add any parameter-specific meaning beyond the schema, which is acceptable but does not enhance understanding beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Initialize a Terraform working directory' and 'Downloads providers and modules', giving a specific verb and resource. It also indicates the tool's placement in the workflow ('Run this before plan or apply on a fresh workspace'), distinguishing it from siblings like tf_plan or tf_apply which are not initialization operations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly advises when to run this tool ('before plan or apply on a fresh workspace'), providing clear context for usage. However, it does not mention when not to use it or compare it to other siblings like tf_validate or tf_workspace, but the guidance is sufficient for the primary use case.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_outputA
Read Terraform output values from the current state. Returns all outputs as JSON, or a specific output by name.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Specific output name to retrieve. Omit to get all outputs. | |
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| workspace | No | Terraform workspace to use (default: current workspace) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so description carries burden. It states it reads state and returns JSON, but does not declare read-only safety, permissions, or potential side effects beyond the implied non-destructive nature.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with purpose. No filler, every sentence adds necessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool (3 parameters, no output schema, no annotations), the description covers core functionality, return format, and parameter usage. Slight gap in not mentioning workspace or path handling, but overall complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% (baseline 3). Description adds value by explaining the 'name' parameter behavior ('specific output by name') and return format (JSON), which goes beyond schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool reads Terraform output values from current state, with specific verb 'Read' and resource 'Terraform output values'. It distinguishes from sibling tools (e.g., tf_apply, tf_destroy) which modify state.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies the tool is for retrieving outputs, but does not explicitly state when to use it versus siblings like tf_state or tf_resource, nor when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_planA
Run terraform plan and return a human-readable diff of what will change. Safe — makes no changes to infrastructure.
| Name | Required | Description | Default |
|---|---|---|---|
| vars | No | Variable overrides in key=value format, e.g. ["region=us-east-1"] | |
| target | No | Limit operation to a specific resource address, e.g. aws_instance.web | |
| varFile | No | Path to a .tfvars or .tfvars.json file | |
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| workspace | No | Terraform workspace to use (default: current workspace) | |
| savePlanFile | No | Optional path to save the binary plan file for use with tf_apply |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden. It clearly states the tool is safe and makes no changes, which is the key behavioral trait. It also mentions it returns a human-readable diff, indicating output format. However, it does not disclose error handling, exit codes, or potential failure modes (e.g., state lock issues). The transparency is good but not exhaustive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is only two sentences, both front-loaded with essential information. Every sentence earns its place: the first explains the action and output, the second emphasizes safety. No unnecessary words or repetition. This is an example of ideal conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 6 parameters, no output schema, and no annotations, the description provides the core purpose and safety guarantee but lacks operational context. It does not mention that the tool requires an initialized Terraform working directory, that it may use state locks, or how the plan file (savePlanFile) can be used with tf_apply. While adequate for basic understanding, it leaves gaps for an AI agent to infer important steps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all 6 parameters are documented in the schema. The description adds no additional meaning or usage hints beyond what the schema provides (e.g., it doesn't explain that 'vars' accepts multiple key=value strings). Per guidelines, baseline 3 is appropriate when schema covers parameters fully and description adds no extra value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool runs 'terraform plan' and returns a human-readable diff. It emphasizes safety ('Safe — makes no changes to infrastructure'), which distinguishes it from sibling tools like tf_apply and tf_destroy. The verb and resource are specific and well-understood.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for previewing changes before applying (by stating 'Safe — makes no changes'), but it does not explicitly state when to use this tool versus alternatives like tf_apply. There is no mention of prerequisites (e.g., initialized workspace) or scenarios where this tool should not be used. While the safety warning is helpful, clearer guidance on workflow sequencing would improve the score.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_preflightA
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.
| Name | Required | Description | Default |
|---|---|---|---|
| workdir | Yes | Absolute or relative path to the directory containing .tf files |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so description carries full burden. It implies a non-destructive read-only operation via 'check' and 'verify', but does not explicitly state lack of side effects or return format. Still sufficiently clear for a preflight check.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two concise sentences: first describes function, second gives usage recommendation. No fluff, front-loaded, and every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple single-parameter input and no output schema, the description adequately covers purpose and usage. It does not describe return values, but for a preflight check this is acceptable. Sibling tools provide clear context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. Description adds no additional meaning to the 'workdir' parameter beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool checks which cloud providers are used and verifies authentication status, a specific verb+resource. It differentiates from sibling execution tools like tf_plan and tf_apply by explicitly recommending use before them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly advises 'Call this before plan or apply to catch credential issues early', giving clear when-to-use guidance and implicitly distinguishing from execution tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_resourceADestructive
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)
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Cloud provider resource ID for import, e.g. i-0abcd1234 or an Azure resource ID | |
| address | No | Resource address, e.g. aws_instance.web (required for import/taint/untaint) | |
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| operation | Yes | Resource operation to perform | |
| workspace | No | Terraform workspace to use (default: current workspace) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds behavioral context beyond the annotations (destructiveHint: true) by explaining each operation's effect, such as 'Mark a resource for recreation' for taint. Although it does not detail side effects or permissions, the use case for each operation is clear. The description does not contradict the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise, using bullet points to list operations. It is front-loaded with the overall purpose. Every sentence provides essential information without redundancy. This structure is ideal for quick comprehension by an AI agent.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has no output schema, the description adequately explains the four operations and their parameter requirements. It covers the core behavior, though it does not mention error conditions, return formats, or the workspace parameter's role. For a multi-operation tool, this is reasonably complete but could be more thorough by adding outcome descriptions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by clarifying which parameters are required per operation (e.g., 'import: requires address + id'). This provides contextual meaning beyond the schema's property descriptions, particularly for the 'operation' enum and conditional requirements.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Resource-level state operations' and lists four specific operations (import, taint, untaint, refresh) with brief explanations. It uses specific verbs and resources, making the tool's purpose unambiguous. Though it doesn't explicitly differentiate from siblings like tf_state, the focused scope on individual resource operations provides sufficient distinction.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage by listing operations and requirements (e.g., 'requires address + id'), but it does not explicitly state when to use this tool versus alternatives (e.g., tf_state, tf_apply). No when-not or exclusion criteria are provided. This leaves the agent without clear guidance on selecting the correct tool among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_stateADestructive
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)
| Name | Required | Description | Default |
|---|---|---|---|
| address | No | Resource address for show/rm/mv source, e.g. aws_instance.web | |
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| operation | Yes | State operation to perform | |
| workspace | No | Terraform workspace to use (default: current workspace) | |
| destination | No | Destination address for mv operation only |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations provide destructiveHint=true, and the description adds that rm removes from state without destroying the actual resource, and mv should be used with care. However, it does not disclose other behavioral traits such as potential state lock conflicts, the fact that these operations modify the state file permanently, or the need for proper permissions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, uses bullet points for operations, and front-loads the main purpose. Every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema and relatively simple operations, the description adequately covers the tool's functionality. However, it could be more complete by explaining how the workspace parameter works or what happens if address is omitted for list operations. The sibling tools list is large, but the description sufficiently distinguishes them.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly describing all parameters (workdir, operation, address, workspace, destination) with examples. The description adds no additional semantic meaning beyond what the schema provides, so baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it manages Terraform state and lists four specific operations (list, show, mv, rm). This distinguishes it from sibling tools like tf_apply, tf_destroy, etc., which perform different Terraform actions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description mentions 'use with care' for mv and notes rm is destructive, giving some guidance on caution. However, it does not explicitly state when to use this tool over siblings like tf_resource (which manages resources) or tf_init, nor does it explain prerequisites like requiring an initialized workspace.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_validateA
Validate Terraform configuration files for syntax and internal consistency. Does not access remote state or APIs.
| Name | Required | Description | Default |
|---|---|---|---|
| workdir | Yes | Absolute or relative path to the directory containing .tf files |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears full responsibility. It discloses that the tool does not access remote state or APIs, implying it is safe and local, but lacks details on success/failure behavior or output format. This is adequate for a simple validation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loading the core purpose and adding a key constraint. No superfluous content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple validation tool with one parameter and no output schema, the description covers essential aspects: what it validates, what it avoids, and the required input path. Minor omission of return value details does not significantly detract.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% for the single parameter 'workdir', which is described in the schema. The description adds no additional parameter details beyond the schema, resulting in baseline score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool validates Terraform configuration files for syntax and internal consistency, distinguishing it from sibling tools like tf_apply or tf_plan which perform different operations. It adds specificity by noting it does not access remote state or APIs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for local validation without remote access, but does not explicitly state when to use this tool versus alternatives or provide exclusions. Users must infer context from the tool name and sibling list.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
tf_workspaceA
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
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Workspace name for select or new operations | |
| workdir | Yes | Absolute or relative path to the directory containing .tf files | |
| operation | Yes | Workspace operation to perform |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must fully disclose effects. It mentions operations but does not clarify that 'select' changes the active workspace (a side effect) or that 'new' creates a workspace (a mutation). The description lacks detail on permissions, prerequisites (e.g., terraform init), or error conditions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise (two sentences with bullet points) and front-loaded with the core purpose. Every word contributes information; no fluff or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool supports four operations with three parameters and no output schema. While the description covers the operations, it omits details about return values (e.g., format of list output), constraints (e.g., 'select' requiring an existing workspace), and error handling. Adequate for simple usage but not fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all parameters, earning a baseline of 3. The description adds marginal value by naming operations but does not elaborate on parameter usage beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states 'Manage Terraform workspaces' and lists four specific operations (list, show, select, new), clearly identifying the resource and actions. This effectively distinguishes it from sibling tools like tf_apply or tf_plan, which focus on other Terraform lifecycle steps.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description lists operations but provides no explicit guidance on when to use this tool versus alternatives (e.g., for workspace management vs. resource provisioning). Context is implied by the tool name and sibling list, but no when-to-use or when-not-to-use instructions are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
11 tool updates
v0.1.0- First observed
tf_apply - First observed
tf_destroy - First observed
tf_drift - First observed
tf_init - First observed
tf_output - First observed
tf_plan - First observed
tf_preflight - First observed
tf_resource - First observed
tf_state - First observed
tf_validate - First observed
tf_workspace
TDQS
Each tool has a distinct purpose: tf_apply applies changes, tf_destroy destroys, tf_drift detects drift, tf_init initializes, tf_output reads outputs, tf_plan plans, tf_preflight checks auth, tf_resource handles resource-level state ops, tf_state manages state, tf_validate validates config, tf_workspace manages workspaces. No overlap.
All tools follow the tf_ prefix with clear verb names (e.g., apply, destroy, drift, init, output, plan, preflight, resource, state, validate, workspace). The pattern is consistent and predictable.
11 tools cover the essential Terraform operations comprehensively—init, validate, plan, apply, destroy, state management, resource ops, drift detection, outputs, workspace management, and preflight checks. The count is well-scoped for the domain.
The tool set covers the full Terraform workflow: init, validate, plan, apply, destroy, plus state manipulation, resource import/taint/untaint/refresh, drift detection, output reading, workspace management, and preflight authentication checks. No obvious gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Related MCP Servers
- AlicenseBqualityDmaintenanceAn implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.836186MIT
- AlicenseNot gradedqualityAmaintenance🌍 Terraform Model Context Protocol (MCP) Tool - An experimental CLI tool that enables AI assistants to manage and operate Terraform environments. Supports reading Terraform configurations, analyzing plans, applying configurations, and managing state with Claude Desktop integration. ⚡️371MIT
- AlicenseAqualityCmaintenanceA Model Context Protocol (MCP) server that integrates Claude with the Terraform Cloud API, allowing Claude to manage your Terraform infrastructure through natural conversation.6223MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables managing Terrakube infrastructure through natural language, handling workspace management, variables, modules, and organization operations.16223Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/RajeevSirohi/mcp-server-terraform'
If you have feedback or need assistance with the MCP directory API, please join our Discord server