Safety-first Terraform: confirmation-gated apply/destroy, risk & cost analysis, drift detection
MCPpedia last refreshed this data
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"terraform": {
"args": [
"-y",
"@rajsir/mcp-server-terraform"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server that lets Claude manage Terraform infrastructure through natural language.
Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y '@rajsir/mcp-server-terraform' 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked @rajsir/mcp-server-terraform against OSV.dev.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in cloud / data
Manage Supabase projects — databases, auth, storage, and edge functions
Query and manage PostgreSQL databases directly from AI assistants
🔥 Official Firecrawl MCP Server - Adds powerful web scraping and search to Cursor, Claude and any other LLM clients.
Zero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
MCP Security Weekly
Get CVE alerts and security updates for io.github.RajeevSirohi/mcp-server-terraform and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
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.
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.
| Tool | Description | Destructive |
|---|---|---|
tf_init | Initialize a Terraform working directory | No |
tf_validate | Validate configuration syntax | No |
tf_plan | Run a plan and return the diff + risk/cost summary | No |
tf_apply | Apply changes (requires confirmed: true) | Yes |
tf_destroy | Destroy infrastructure (requires confirmed: true) | Yes |
tf_output | Read output values from state | No |
tf_state | List, show, move, or remove state entries | Partial |
tf_workspace | List, show, select, or create workspaces | No |
tf_preflight | Check provider CLI authentication before running | No |
tf_drift | Detect resources changed outside Terraform | No |
tf_resource | Import, taint, untaint, or refresh resources | Yes |
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!).
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.
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.
tf_apply and tf_destroy use a two-step safety flow:
confirmed) → runs terraform plan, shows the diff, does nothing elseconfirmed: true) → actually applies or destroysClaude is instructed to never pass confirmed: true without first presenting the plan to you.
The server exposes a /tf-diagnose prompt that guides Claude through a systematic 5-step diagnosis of plan or apply failures.
No install needed — run it straight from npm:
npx @rajsir/mcp-server-terraform
Or, for development, from source