Prototyp · Vorschau: alle Server aus der offiziellen Registry, alle 30 Minuten synchronisiert. Bewertungen und Benutzerkonten folgen in einem späteren Schritt.
PopNx MCPMCP-Server für alle, die KI nutzen · in einfachen Worten erklärt

MCP Server Terraform

von RajeevSirohiVersion 0.2.1i★ –iLäuft auf deinem Computer
Name in der Registryio.github.RajeevSirohi/mcp-server-terraform

Installieren

Überblick

Beschreibung vom Entwickler (englisches Original)

Safety-first Terraform: confirmation-gated apply/destroy, risk & cost analysis, drift detection

Die drei Säulen von PopNx MCP

Diese drei werden nie zu einer Punktzahl zusammengefasst: Meinungen, Messungen und Beliebtheit sind verschiedene Dinge.

Was du damit machen kannst

Für diesen Server haben wir noch keine Zusammenfassung in einfacher Sprache geschrieben. Unten stehen die Fakten, die wir aus der Registry gelesen haben.

  • Verbindung: Läuft auf deinem Computer
  • Transport: stdio
  • Kategorie: Entwicklertools

Installation

Wähle die KI-App, die du nutzt, und kopiere die Einstellungen.

Bevor du installierst

  • Basischecks: 1 von 1 bestanden
  • Läuft auf deinem Computer mit den Rechten deines Benutzerkontos (Dateien, Netzwerk, Apps).
  • Das trägst du selbst ein: ALLOW_ONLY_READONLY_TOOLS, ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS, AUDIT_LOG_PATH

Du brauchst

  • npmNode.js installiert (für den Befehl npx)

Welche App nutzt du?

Wähle oben deine App. Wir merken sie uns, damit der Button beim nächsten Mal „In … installieren“ anzeigt.

Öffne Claude Desktop → Settings → Developer → Edit Config und füge dies in claude_desktop_config.json ein

{
  "mcpServers": {
    "terraform": {
      "command": "npx",
      "args": [
        "-y",
        "@rajsir/mcp-server-terraform"
      ],
      "env": {
        "ALLOW_ONLY_READONLY_TOOLS": "your-value",
        "ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "your-value",
        "AUDIT_LOG_PATH": "your-value"
      }
    }
  }
}

Führe das in deinem Terminal aus

claude mcp add terraform --env ALLOW_ONLY_READONLY_TOOLS=your-value --env ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=your-value --env AUDIT_LOG_PATH=your-value -- npx -y @rajsir/mcp-server-terraform

Trag die leeren Werte ein, bevor du ihn startest.

In Cursor öffnen

Oder kopier die Einstellungen selbst

In .cursor/mcp.json in deinem Projekt oder in ~/.cursor/mcp.json einfügen

{
  "mcpServers": {
    "terraform": {
      "command": "npx",
      "args": [
        "-y",
        "@rajsir/mcp-server-terraform"
      ],
      "env": {
        "ALLOW_ONLY_READONLY_TOOLS": "your-value",
        "ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "your-value",
        "AUDIT_LOG_PATH": "your-value"
      }
    }
  }
}

Dein Browser fragt, ob er die App öffnen darf, dann zeigt die App die Einstellungen und bittet dich um Bestätigung. Schlüsselwerte bleiben leer, damit du sie selbst einträgst.

In VS Code öffnen

Oder kopier die Einstellungen selbst

In .vscode/mcp.json in deinem Projekt einfügen

{
  "servers": {
    "terraform": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@rajsir/mcp-server-terraform"
      ],
      "env": {
        "ALLOW_ONLY_READONLY_TOOLS": "your-value",
        "ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS": "your-value",
        "AUDIT_LOG_PATH": "your-value"
      }
    }
  }
}

Dein Browser fragt, ob er die App öffnen darf, dann zeigt die App die Einstellungen und bittet dich um Bestätigung. Schlüsselwerte bleiben leer, damit du sie selbst einträgst.

Dieser Server läuft auf deinem Computer, und ChatGPT kann sich nur mit Servern im Internet verbinden. Wähle eine andere App.

Deine Auswahl bleibt in einem Cookie auf diesem Gerät; kein Konto nötig.

Werte, die du selbst einträgst

  • ALLOW_ONLY_READONLY_TOOLS env
    Set to 'true' to expose only validate/plan/output/preflight/drift tools
  • ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS env
    Set to 'true' to block apply/destroy/state-mutation tools
  • AUDIT_LOG_PATH env
    File path for JSON-lines audit logging of all tool calls (var values redacted)

Diese Einstellungen werden aus dem Registry-Eintrag des Entwicklers erzeugt. Wenn in der README etwas anderes steht, folge der README.

Was er kann

Läuft auf deinem Computer; die Tool-Liste erscheint nach der Installation in deiner KI-App.

Basischecksi

Wir prüfen Informationen, die jeder sehen kann; den Code haben wir nicht gelesen. Checks, die nicht zutreffen, werden nicht mitgezählt. · Geprüft am 7. Nov. 2026

  • ✓ Bestanden

    Entwickler passt zum Repo

    Der Registry-Name wurde mit dem GitHub-Konto RajeevSirohi bestätigt, dem das Repo gehört

  • … Noch nicht geprüft

    Wird noch gepflegt

    Dieses Repo haben wir noch nicht von GitHub gelesen

  • … Noch nicht geprüft

    Hat eine Lizenz

    Dieses Repo haben wir noch nicht von GitHub gelesen

  • – Nicht zutreffend

    Endpunkt antwortet

    Dieser Server läuft auf deinem Computer; es gibt keinen Endpunkt im Internet

  • – Nicht zutreffend

    Anmeldung mit OAuth

    Läuft auf deinem Computer und nutzt stattdessen lokale Einstellungen

  • … Noch nicht geprüft

    Keine versteckten Anweisungen in Tool-Beschreibungen

    Läuft auf deinem Computer; Tool-Listen können wir nur von Endpunkten im Internet lesen

Im Vergleich mit anderen in Entwicklertoolsi

  • Mehr Sterne als 0 % der anderen 1395 Server in dieser Kategorie
  • Neuer in der Registry veröffentlicht als 30 % der anderen 1395 Server in dieser Kategorie
  • Basischecks gleich gut wie oder besser als bei 100 % der anderen 1395 Server in dieser Kategorie

Verglichen mit allen aktiven Servern dieser Kategorie in der Registry. Sterne zählen nur, wenn dem Herausgeber das Repo gehört.

Häufige Fragen

Ist MCP Server Terraform sicher?

Er hat 1 von 1 zutreffenden Basischecks bestanden. Den Code haben wir nicht gelesen. Bevor du einen Schlüssel oder Token hinzufügst, sieh nach, welche Zugriffe der Server verlangt, und nutze einen Schlüssel, der nur die Berechtigungen hat, die du brauchst.

Welche Schlüssel oder Codes braucht er?

Die Registry nennt keinen erforderlichen Schlüssel, manche Server bitten dich aber bei der ersten Nutzung, dich anzumelden.

Läuft er auf meinem Computer oder in der Cloud?

Er läuft auf deinem Computer. Deine KI-App startet ihn bei Bedarf, und die Daten laufen nicht über die Server des Entwicklers (außer der Server ruft selbst einen Onlinedienst auf).

Wird er noch gepflegt?

Das GitHub-Repo wurde zuletzt – geändert, und die neueste Version (0.2.1) kam vor 4 Monaten in die Registry.

Welche Apps können ihn nutzen?

Apps, die MCP unterstützen, etwa Claude Desktop, Claude Code, Cursor und VS Code. Außerdem brauchst du Node.js auf deinem Computer.

Was kann ich stattdessen nutzen?

In derselben Kategorie: GitHub, Desktop Commander, Cloudflare MCP

Alternativen

Server derselben Kategorie von anderen Entwicklern, sortiert nach Sternen.

So liest du eine Karte:★ GitHub-SterneiDrei Säulen: Bewertungen · Checks · NutzungiAktualisiert = neueste Version in der Registry veröffentlichti

GitHub

von github

Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.

Computer oder Cloud★ 34.245MITAktualisiert vor 4 Tagen
Installieren

Desktop Commander

von wonderwhy-er

MCP server for terminal commands, file operations, and process management

Läuft auf deinem Computer★ 10.225MITAktualisiert vor 16 Tagen
Installieren

Cloudflare MCP

von cloudflare

Cloudflare MCP servers

Läuft in der Cloud★ 4.446Apache-2.0Aktualisiert vor 14 Monaten
Installieren

README vom Entwickler

README öffnen

Unverändert aus dem Repo des Entwicklers übernommen. PopNx MCP hat den Inhalt weder geprüft noch empfiehlt es ihn. HTML, Bilder und Skripte wurden entfernt. Links führen von dieser Website weg.

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/staging and 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.

Tools

ToolDescriptionDestructive
tf_initInitialize a Terraform working directoryNo
tf_validateValidate configuration syntaxNo
tf_planRun a plan and return the diff + risk/cost summaryNo
tf_applyApply changes (requires confirmed: true)Yes
tf_destroyDestroy infrastructure (requires confirmed: true)Yes
tf_outputRead output values from stateNo
tf_stateList, show, move, or remove state entriesPartial
tf_workspaceList, show, select, or create workspacesNo
tf_preflightCheck provider CLI authentication before runningNo
tf_driftDetect resources changed outside TerraformNo
tf_resourceImport, taint, untaint, or refresh resourcesYes
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= ) — only names are logged.

Confirmation flow

tf_apply and tf_destroy use a two-step safety flow:

  1. First call (no confirmed) → runs terraform plan, shows the diff, does nothing else
  2. Second 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

Installation

No install needed — run it straight from npm:

npx @rajsir/mcp-server-terraform

Or, for development, from source:

git clone https://github.com/RajeevSirohi/mcp-server-terraform.git

cd mcp-server-terraform npm install npm run build

Claude 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\staging and 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\staging and 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-bucket into state as aws_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:

VariableEffect
ALLOW_ONLY_READONLY_TOOLS=trueOnly tf_validate, tf_plan, tf_output
ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS=trueBlocks tf_apply, tf_destroy, tf_state mv/rm
ALLOWED_TOOLS=tf_plan,tf_outputExplicit 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 build

Project 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.ts

Adding a new tool
  1. Create src/tools/tf-yourcommand.ts — export a *Schema const and an async handler function
  2. Import both in src/index.ts
  3. Add the schema to readonlyTools or destructiveTools array
  4. Add a case in the CallToolRequestSchema handler 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.

PopNx fragen