tfplan-mcp
Enables AI risk review of OpenTofu plan JSON files: summarizes plan changes, ranks risky resource changes, diffs nested resource values with secrets masked, and compares plans without executing OpenTofu.
Enables AI risk review of Terraform plan JSON files: summarizes plan changes, ranks risky resource changes, diffs nested resource values with secrets masked, and compares plans without executing Terraform.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
tfplan-mcp the Hard Way
Build an MCP server that lets an AI risk-review a Terraform / OpenTofu plan, from scratch, in seven small modules. You end with a working miniature of tfplan-mcp: it reads a plan file, summarizes it, ranks the dangerous changes, diffs one resource with secrets masked, and compares two plans, all over MCP stdio, and it never runs terraform.
Every module has:
README.md- the why, in plain prosecode you can read in one sitting
main.py- runs the code and asserts the result, so the claims in the README are checkedbreak-it.md- challenges that make you find the sharp edges yourself
verify.py runs every main.py for real. CI does the same on Ubuntu and Windows.
Run it
python -m venv .venv
.venv/Scripts/activate # Linux/macOS: source .venv/bin/activate
pip install -r requirements.txt
python verify.py # all seven modules
python verify.py 03 05 # just these
python 03-risk-heuristics/main.pyOnly module 07 needs the mcp package. Modules 01-06 are plain Python.
Related MCP server: tfminder
Modules
# | Module | You learn |
01 | what | |
02 | create/update/delete/replace, why a replace is two actions and the order matters, no-ops that are really moves and imports | |
03 | ranking changes: stateful types, new exposure only (compare before and after), tags-only demotion | |
04 | walking before/after/after_unknown together, paths like | |
05 | two independent layers: Terraform's sensitivity masks and name heuristics | |
06 | new / removed / changed action / changed values between two plans | |
07 | tools, a directory sandbox, errors an agent can read, and a plant-a-secret test over real stdio |
The sample plans in plans/ are small hand-written terraform show -json documents
(format_version 1.2). The fake secret in them is TUTORIAL-hunter2; the tests search every
output for it.
MIT licensed.
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
Risk-scan a diff, flag AI-generated-code tells, find secrets. 5 of 7 tools need no account.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI coding agents to search a security corpus, scan Terraform plan JSON for cited findings, and list sources via MCP tools grounded in CIS AWS Foundations and OWASP Top 10 CI/CD risks.3Apache 2.0
- AlicenseNot gradedqualityCmaintenanceLets AI agents propose and review Terraform plans through MCP while requiring human approval before any exact reviewed plan is applied, with policy checks and a tamper-evident audit log.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables state-aware Terraform/OpenTofu plan evaluation against live AWS topology and CloudWatch telemetry, detecting reliability blast radius and FinOps waste before merge.Apache 2.0
- AlicenseAqualityAmaintenanceEnables AI clients to assess infrastructure-as-code deployment risk, generate incident response runbooks, review CI/CD delivery readiness, and calculate SLO error budgets through structured advisory tools. Runs locally over stdio without cloud credentials or external API calls, returning guidance for platform work, pull request review, and production readiness checks.12185 npmMIT