Skip to main content
Glama
devops-deploy-guard-mcp-server

devops-deploy-guard-mcp-server

by awais2o

DevOps Deploy Guard MCP Server (v1.7.0)

Production-ready, zero-knowledge AI DevOps deployment, infrastructure provisioning, self-healing execution, and persistent documentation engine for VPS servers.

devops-deploy-guard-mcp-server is an advanced Model Context Protocol (MCP) server that empowers AI coding assistants (Antigravity IDE, Claude Code/Desktop, Cursor, Kimi, etc.) to safely provision servers, configure Nginx & SSL, deploy applications, debug mid-deployment failures interactively, and maintain persistent runbooks โ€” without risking catastrophic production server crashes or database resets.


๐Ÿš€ Key Features in v1.7.0

  • ๐Ÿค– Self-Healing Execution Engine: If a deployment command fails, the server pauses execution in a PAUSED_AWAITING_FIX state instead of instantly rolling back. The LLM receives full failure outputs, applies mid-deployment fixes via diagnose_and_fix, and resumes execution seamlessly via resume_execution.

  • ๐Ÿ“˜ Auto-Runbook Generator (generate_project_runbook): Dynamically writes a physical DEPLOYMENT_RUNBOOK.md into the user's project root containing exact manual SSH commands, Nginx blocks, SSL status, and .env locations.

  • ๐Ÿงน Safe Resource Cleanup (cleanup_server_resources): Checks root partition space (df -h /) and safely prunes dangling Docker images (docker image prune -f) and stale Git branches only if disk usage exceeds 70%.

  • ๐ŸŽฏ Context-Aware Conditional Deployments (plan_dynamic_deployment): Inspects Git diffs against remote tracking branches to skip unnecessary npm install or database migrations when manifests and schemas haven't changed.

  • ๐Ÿ›ก๏ธ Multi-OS Infrastructure Provisioning: Automatically detects Ubuntu, Debian, RHEL, CentOS, Fedora, and Alpine to generate idempotent provisioning plans for system packages, Node.js, PM2, Docker, UFW/Firewalld, Nginx, and Certbot SSL certificates.

  • ๐Ÿ”’ Two-Tier Command Sanitizer: Hard-blocks catastrophic shell commands (rm -rf, DROP DATABASE, prisma migrate dev, :dev targets, --watch) while warning on risky operations (docker system prune, git reset --hard).


Related MCP server: mcp-fractera

๐Ÿ”’ Security & Protection Architecture

Security Layer

Description

Two-Step Staged Execution

Planning tools output a plan_id. Execution requires explicitly invoking confirm_execution with confirm: true.

Command Sanitizer

Statically inspects all shell strings. Blocks catastrophic commands and dev flags in production environments.

Non-Fatal Pause Engine

Pauses failed deployments without destroying Git state, enabling LLMs to run diagnostic fix commands.

Secret Protection

.env files are written via SSH heredocs; actual key secrets are never echoed or dumped into LLM context logs.

Path Traversal Guard

Prevents arbitrary remote file writes outside approved project paths (/etc/shadow, /root/.ssh/).

Automatic Gitignore

Automatically adds .devops-mcp.json and .deployment-history.json to .gitignore.


๐Ÿ“‹ Comprehensive Tool Registry (19 Tools)

1. Read-Only Inspection & Analysis

Tool Name

Description

inspect_server

Inspects OS, disk space, Docker containers, PM2 processes, Nginx sites, memory usage, and local runbook/history status.

analyze_project_structure

Detects package managers (npm, pnpm, yarn, bun), ecosystem files, Docker configs, build targets, and exposed ports.

check_pending_migrations

Inspects remote database migration state for Prisma, TypeORM, Sequelize, Drizzle, or custom migration scripts.

verify_health

Performs HTTP health check requests against local or domain endpoints post-deployment.

view_app_logs

Fetches tail logs from PM2 processes or Docker containers via SSH.

2. Infrastructure Provisioning & Setup

Tool Name

Description

prepare_new_server

Generates package update and core build utility installation plans (curl, git, build-essential, firewall) mapped to detected OS.

install_runtimes

Provisioning plan for dynamic Node.js versions (e.g. 20, 22), PM2 process manager, and Docker Engine.

configure_firewall

Generates UFW or Firewalld security rules to allow SSH (22), HTTP (80), and HTTPS (443).

setup_nginx_reverse_proxy

Generates reverse proxy blocks mapping domain names to local backend application ports.

setup_ssl_certbot

Provisions and configures Let's Encrypt SSL certificates via Certbot for secure HTTPS traffic.

3. Environment & Security

Tool Name

Description

generate_secure_env_template

Scans codebase and generates blank .env template definitions.

secure_env_writer

Writes .env configuration files directly to remote server paths securely via SSH.

4. Planning & Execution

Tool Name

Description

plan_dynamic_deployment

(Recommended) Context-aware deployment plan evaluating Git diffs, ORM migrations, builds, and process restarts.

plan_docker_deployment

Specialized planning tool for Docker Compose containerized applications.

plan_github_pm2_deployment

Specialized planning tool for PM2-managed Node.js applications.

confirm_execution

Executes a generated deployment plan step-by-step with non-fatal pausing on step failure.

5. Self-Healing Execution Engine (v1.7.0)

Tool Name

Description

diagnose_and_fix

Runs sanitized diagnostic fix commands via SSH for a paused deployment without resetting Git commit state.

resume_execution

Resumes a paused deployment plan, skipping completed steps and running remaining steps to completion.

rollback_execution

Aborts a deployment plan and executes automated Git reset and service reload sequence.

6. Maintenance & Persistent Documentation (v1.6.0)

Tool Name

Description

generate_project_runbook

Generates a local DEPLOYMENT_RUNBOOK.md containing manual SSH commands, Nginx config, SSL status, and .env locations.

cleanup_server_resources

Safely prunes dangling Docker images (docker image prune -f) and stale Git branches if disk usage is $>70%$.


โšก Quick Start & Configuration Guide

๐Ÿค– Interactive AI Setup Wizard (Copy-Paste Prompt)

Instead of manually editing config files, copy the prompt below and paste it into your AI assistant (Antigravity IDE, Claude, Cursor, Kimi, etc.) to run an interactive setup wizard:

You are my AI DevOps Setup Assistant for devops-deploy-guard-mcp-server.

Please guide me through setting up this MCP server step-by-step by interviewing me first.

Ask me these questions in a clean list:
1. What is your VPS IP address or host domain?
2. What is your SSH username (e.g., root, ubuntu, deploy)?
3. What is the local path to your unencrypted SSH private key file (e.g., C:\Users\name\.ssh\id_rsa or ~/.ssh/id_rsa)?
4. What is your domain name (e.g., api.example.com) and admin email address for SSL?
5. Which AI IDE / MCP Client are you using (Antigravity IDE, Claude Desktop, Cursor, Kimi, etc.)?

After I answer:
- Create or update my local .devops-mcp.json config file with my responses.
- Ensure .devops-mcp.json and .deployment-history.json are listed in my .gitignore file.
- Generate the exact MCP client configuration JSON snippet formatted for my AI IDE.
- Compile the TypeScript server with `npm run build` and run `inspect_server` to verify SSH connectivity.

1. Manual Installation

cd devops-deploy-guard-mcp-server
npm install
npm run build

2. Configuration (.devops-mcp.json)

When launched, the server automatically creates a .devops-mcp.json file in your workspace root (and appends it to .gitignore):

{
  "vps_host": "203.0.113.45",
  "vps_user": "root",
  "ssh_private_key_path": "/Users/yourname/.ssh/id_rsa",
  "domain_name": "api.example.com",
  "admin_email": "admin@example.com",
  "vps_port": 22
}

๐Ÿ”Œ Connecting to MCP Clients

Antigravity IDE / Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "devops-deploy-guard": {
      "command": "node",
      "args": ["/absolute/path/to/devops-deploy-guard-mcp-server/dist/index.js"]
    }
  }
}

Cursor / Kimi / Stdio Clients

Command: node
Arguments: /absolute/path/to/devops-deploy-guard-mcp-server/dist/index.js


๐Ÿ”„ Self-Healing Deployment Workflow (v1.7.0 Walkthrough)

                 Developer / AI requests deployment
                                โ”‚
                                โ–ผ
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚ plan_dynamic_deployment  โ”‚  โ† Analyzes diffs & builds plan
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
                                โ–ผ
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚    confirm_execution     โ”‚  โ† Executes step-by-step
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                โ”‚
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚                                       โ”‚
     [All Steps Succeed]                    [Step Fails (e.g. npm peer dep)]
            โ”‚                                       โ”‚
            โ–ผ                                       โ–ผ
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚ Status: SUCCESS     โ”‚               โ”‚ Status: PAUSED_AWAITING_FIXโ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                    โ”‚
                                                    โ–ผ
                                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                       โ”‚    diagnose_and_fix      โ”‚  โ† LLM applies fix command
                                       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                    โ”‚
                                       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                       โ”‚                          โ”‚
                                  [Fix Works]               [Cannot Fix]
                                       โ”‚                          โ”‚
                                       โ–ผ                          โ–ผ
                          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                          โ”‚    resume_execution    โ”‚  โ”‚   rollback_execution   โ”‚
                          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“– Operational Documentation & History

  1. Auto-Runbook File (DEPLOYMENT_RUNBOOK.md):

    • Run generate_project_runbook to generate a complete markdown runbook for human developers and handovers.

  2. Deployment History Log (.deployment-history.json):

    • Every deployment attempt (success, paused, or rolled back) is automatically logged with timestamp, plan ID, status, and executed commands.


๐Ÿ› ๏ธ Development & Testing

# Watch mode for development
npm run dev

# Run Vitest unit tests
npm test

# Production build
npm run build

๐Ÿ“„ License

MIT

Available Tools

20 tools
analyze_project_structureAnalyze Remote Project StructureB
Read-onlyIdempotent

Inspects remote directory and system commands via SSH to detect lockfiles, package managers, Docker, PM2, Nginx, application ports, WebSockets, deployment strategy, and missing dependencies.

Inputs: app_path.

check_pending_migrationsCheck Pending Database MigrationsA
Read-onlyIdempotent

Executes read-only migration status command via SSH to check if database migrations are pending on remote server.

Inputs: app_path, framework, custom_status_cmd.

cleanup_server_resourcesSafe Server Resource Cleanup (v1.6.0)A
Idempotent

Checks server disk usage with safety threshold (>70% disk usage requirement) and performs non-destructive pruning of dangling Docker images and stale git tracking branches.

Inputs: force, app_path.

configure_firewallConfigure Safe Firewall (UFW)A
DestructiveIdempotent

Configures UFW firewall rules safely. CRITICAL SAFETY: Always verifies OpenSSH (port 22) is allowed BEFORE enabling firewall to prevent SSH lockout.

Inputs: allow_nginx, custom_ports.

confirm_executionConfirm & Execute Deployment Plan (v1.7.0 Self-Healing)A
Destructive

Executes a deployment plan step-by-step. If a step fails, pauses execution into PAUSED_AWAITING_FIX state for diagnosis instead of rolling back immediately.

Inputs: confirm (required), plan_id (required), acknowledge_warnings.

diagnose_and_fixDiagnose & Apply Mid-Deployment Fix (v1.7.0)A
Destructive

Executes a diagnostic fix command via SSH for a paused deployment without breaking deployment state or resetting git commit status.

Inputs: plan_id (required), fix_command (required).

generate_project_runbookGenerate Project Deployment Runbook (v1.6.0)A
Idempotent

Gathers server IP, SSH credentials, OS info, build scripts, Nginx/SSL configuration, and remote path to generate a local DEPLOYMENT_RUNBOOK.md markdown file for manual ops and handovers.

Inputs: app_path, output_filename.

generate_secure_env_templateGenerate Secure .env TemplateA
Read-onlyIdempotent

Reads .env.example from the VPS project directory dynamically via SSH. If not present, returns a generic environment template prompt.

Inputs: app_path.

inspect_serverInspect Server & Local Ops Status (v1.6.0)A
Read-onlyIdempotent

Safely inspects the current state of your VPS server via SSH and checks local project runbook existence and deployment history.

Inputs: no named parameters.

install_runtimesInstall Runtimes & ContainersA
Read-onlyIdempotent

Generates an idempotent provisioning plan to install Node.js (dynamic version), PM2, Docker Engine, and Docker Compose plugin across Debian, RHEL, and Alpine Linux distributions.

Inputs: install_node, node_version, install_docker.

plan_docker_deploymentPlan Docker Compose DeploymentA
Read-onlyIdempotent

Plans a safe Docker Compose deployment by generating the exact commands. Does NOT execute anything without confirm_execution.

Inputs: app_path, services, pull_images, compose_file.

plan_dynamic_deploymentPlan Dynamic Production Deployment (v1.5.0 Context-Aware)B
Read-onlyIdempotent

Analyzes git diffs, dependency changes, schema updates, and pending migrations to generate a production-first conditional deployment plan.

Inputs: app_name, app_path, auto_analyze, target_branch, +5 more.

prepare_new_serverPrepare New ServerA
Read-onlyIdempotent

Generates a multi-OS provisioning plan to update system packages and install core build utilities (curl, git, compiler tools, firewall) based on detected OS distribution (Ubuntu, Debian, RHEL, CentOS, Alpine).

Inputs: no named parameters.

resume_executionResume Paused Deployment (v1.7.0)A
Destructive

Resumes execution of a paused deployment plan, skipping previously completed steps and executing remaining steps to completion.

Inputs: confirm (required), plan_id (required).

rollback_executionExplicit Rollback Deployment (v1.7.0)A
Destructive

Explicitly aborts a paused or failed deployment plan and triggers automated server rollback (git reset, service reload).

Inputs: plan_id (required), reason.

secure_env_writerSecure Environment File WriterA
DestructiveIdempotent

Writes environment variables to a .env file on the remote server via SSH after path normalization.

Security guarantees:

  • Path validation using path.resolve normalization to prevent path traversal

  • Heredoc writing to prevent shell expansion

  • Zero-knowledge output (never returns or echoes secret values back)

  • Blocks write attempts to system paths (/etc, /root, etc.)

Inputs: env_vars (required), file_path (required).

setup_nginx_reverse_proxySetup Nginx Reverse ProxyA
DestructiveIdempotent

Configures adaptive Nginx reverse proxy or static web server block after verifying domain A-record against the server's public IP address.

Inputs: app_port, is_static, domain_name, has_websockets.

setup_ssl_certbotSetup SSL Certificate (Certbot)A
DestructiveIdempotent

Generates a 2-step execution plan to install Certbot and configure Let's Encrypt SSL/HTTPS certificate for Nginx. Uses OS-specific package mapping and tests auto-renewal.

Inputs: admin_email, domain_name.

verify_healthVerify Application HTTP HealthA
Read-onlyIdempotent

Executes curl on remote server via SSH to verify HTTP endpoint status. Returns success only if HTTP 200 is received.

Inputs: path, port.

view_app_logsView Application LogsA
Read-onlyIdempotent

Retrieves recent application log lines via PM2 or Docker Compose on remote server.

Inputs: app_name (required), mode, lines.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A4.1/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool targets a distinct operation: inspection, environment setup, deployment planning, execution, rollback, etc. There is no overlap; even the two planning tools are differentiated (dynamic vs Docker).

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with imperative verbs (inspect, resume, rollback, analyze, generate, verify, etc.). No mixed conventions.

    Tool Count5/5

    20 tools cover the full DevOps deployment lifecycle without being excessive. Each tool serves a clear and necessary purpose within the domain.

    Completeness5/5

    The tool set covers inspection, provisioning, environment setup, deployment planning, execution, rollback, recovery, health checks, and cleanup. No obvious gaps for the stated purpose.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to deploy applications and manage servers over SSH using natural language commands, with built-in tools for Python bots, Docker Compose, and SSL setup.
      6
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to run shell commands, spawn persistent background tasks, and read/write files inside isolated remote container sandboxes on a VPS. It also provides project workspace listing, task attach/kill controls, and a searchable knowledge graph for memory continuity across sessions.
      -