MCP Hub
Back to servers

RecourseOS

Validation Failed

Consequence evaluation for AI agents. Check recoverability before destructive actions.

Registrynpm324/wk
Stars
1
Updated
May 1, 2026
Validated
May 5, 2026

Validation Error:

Process exited with code 1. stderr: Usage: recourse [options] [command] Know what you can't undo before you terraform apply Options: -V, --version output the version number -h, --help display help for command Commands: plan [options] <plan-file> Analyze a Terraform plan for blast radius resources List supported resource types mcp Run Rec

Quick Install

npx -y recourse-cli

RecourseOS

RecourseOS

Consequence layer for AI agents
Check recoverability before destructive actions

npm version License MCP Registry

Website · MCP Setup · Console · Coverage


Recourse is an MCP server that evaluates Terraform plans, shell commands, and tool calls before execution. It returns a structured verdict — allow, warn, escalate, or block — with recoverability tier and evidence. Agents call Recourse before they act; humans see what the agent checked.

Add to Your Agent

One config block. Works with Claude Desktop, Claude Code, Cursor, and any MCP-compatible client.

{
  "mcpServers": {
    "recourseos": {
      "command": "npx",
      "args": ["-y", "recourse-cli@latest", "mcp", "serve"]
    }
  }
}

The server exposes four tools:

ToolPurpose
recourse_evaluate_terraformCheck Terraform plans before terraform apply
recourse_evaluate_shellCheck shell commands before execution
recourse_evaluate_mcp_callCheck other MCP tool calls before invocation
recourse_supported_resourcesList resources with deterministic rules

Each tool returns:

  • decision: allow, warn, escalate, or block
  • recoverability: tier and reasoning
  • evidence: what was found, what's missing

If decision is block or escalate, agents should not proceed without human approval.

What Agents Get

Terraform plan says:

- aws_db_instance.main will be destroyed

Recourse tells the agent what that means:

aws_db_instance.main
recoverability: unrecoverable
reason: skip_final_snapshot=true, backup_retention_period=0, deletion_protection=false
decision: block

The agent can now say: "I checked with Recourse — this deletes the database with no backup. Blocking until you approve."

That's different from "I deleted your production database."

Example Agent Prompt

Before applying infrastructure changes, call RecourseOS.
If the decision is block, stop.
If the decision is escalate, ask me for review and include the missing evidence.
If the decision is warn, summarize the recovery requirement before continuing.

CLI Install

For humans running preflight checks directly:

npm install -g recourse-cli@latest
recourse --version

Run a preflight check:

recourse preflight shell 'aws s3 rm s3://prod-audit-logs --recursive'

Or run without installing:

npx -y recourse-cli@latest preflight shell 'aws s3 rm s3://prod-audit-logs --recursive'

Quick Start

terraform plan -out=plan.bin
terraform show -json plan.bin > plan.json

recourse plan plan.json

Open the interactive terminal UI:

recourse tui
recourse tui --source shell --input 'aws s3 rm s3://prod-audit-logs --recursive'

Fail CI if a plan contains unrecoverable changes:

recourse plan plan.json --fail-on unrecoverable

Example Output

BLAST RADIUS REPORT
===================

DIRECT CHANGES

  X DELETE aws_db_instance.main
    Recoverability: unrecoverable
    skip_final_snapshot=true, no backup retention; data will be lost

  X DELETE google_storage_bucket.audit
    Recoverability: recoverable-from-backup
    GCS bucket versioning is enabled; object generations may be recoverable

  ~ DELETE azurerm_role_assignment.reader
    Recoverability: reversible
    Azure role assignment/definition is config-only and can be reapplied

SUMMARY
  Unrecoverable:         1 resource
  Recoverable (backup):  1 resource
  Reversible:            1 resource

Recoverability Tiers

TierLabelMeaning
1reversibleCan be undone with another apply or API call.
2recoverable-with-effortCan be recreated, but requires coordinated work.
3recoverable-from-backupRequires a backup, snapshot, version, or retention window.
4unrecoverableData, identity, key material, or recovery points may be permanently lost.
5needs-reviewEvidence is insufficient to classify safely.

Multi-Cloud Coverage

Known resources use hand-written deterministic rules and remain authoritative.

AWS: RDS, DynamoDB, S3, EBS, EFS, EC2, Lambda, AMIs, VPCs, security groups, EIPs, load balancers, Route53, IAM, KMS, Secrets Manager, SNS/SQS, CloudWatch logs, ElastiCache, Neptune.

GCP: Cloud Storage (versioning), Cloud SQL (protection, backups), BigQuery, Secret Manager, IAM, service accounts, DNS, persistent disks, snapshots, KMS, GKE.

Azure: Storage accounts (soft delete), Azure SQL/MSSQL, PostgreSQL/MySQL Flexible Server, MariaDB, Cosmos DB, Key Vault, role assignments, Azure AD, DNS, managed disks, AKS.

For unknown resource types, Recourse uses a three-layer classification system:

  1. Exact mappings: ~180 manually verified resource → category mappings across AWS, GCP, Azure, and OCI.
  2. BitNet classifier: A 1-bit quantized neural network trained on 400+ resource types across 10+ cloud providers.
  3. Pattern fallback: Regex-based classification for the long tail.

Production accuracy is 90.5% on a held-out test set. Low-confidence classifications return needs-review rather than false approval.

Commands

Terraform Plan Analysis

recourse plan plan.json
recourse plan plan.json --state terraform.tfstate
recourse plan plan.json --format json
recourse plan plan.json --classifier

Explain a Verdict

recourse explain plan.json aws_db_instance.main
recourse explain plan.json aws_db_instance.main --format json

Generic Consequence Reports

recourse evaluate terraform plan.json --classifier
recourse evaluate shell 'aws s3 rm s3://prod-audit-logs --recursive'
recourse evaluate mcp '{"server":"aws","tool":"s3.delete_bucket","arguments":{"bucket":"prod-audit-logs"}}'

Terminal Preflight

recourse preflight terraform plan.json --classifier
recourse preflight shell 'kubectl delete namespace payments'
recourse preflight mcp mcp-call.json

Interactive TUI

recourse tui
recourse tui --source shell --input 'aws s3 rm s3://prod-audit-logs --recursive'
recourse tui --source terraform --input plan.json --classifier

MCP Server

recourse mcp serve

See docs/mcp-setup.md for full setup and docs/agent-interface.md for the schema reference.

Read-Only AWS Evidence

recourse evidence aws-s3 prod-audit-logs --region us-east-1 > s3-evidence.json
recourse evidence aws-rds prod-db --region us-east-1 > rds-evidence.json

recourse evaluate shell 'aws s3 rb s3://prod-audit-logs --force' \
  --aws-s3-evidence s3-evidence.json

Supported: aws-s3, aws-rds, aws-dynamodb, aws-iam-role, aws-kms-key.

Supported Resource List

recourse resources

Development

npm install
npm run build
npm test
npm run test:all

Regenerate docs after changing resource handlers:

npm run docs:all

Limitations

Recourse analyzes the plan, state, command, and evidence you provide. It cannot:

  • Prove that out-of-band backups exist unless evidence is supplied.
  • Inspect every object, row, secret, or dependency behind a resource.
  • Guarantee cross-account or cross-region recovery.
  • Predict races between planning and applying.
  • Replace human review for opaque destructive resources.

The safety posture is conservative: when evidence is incomplete, Recourse warns, blocks, or requires review rather than understating risk.

License

MIT

Reviews

No reviews yet

Sign in to write a review