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_FIXstate instead of instantly rolling back. The LLM receives full failure outputs, applies mid-deployment fixes viadiagnose_and_fix, and resumes execution seamlessly viaresume_execution. - 📘 Auto-Runbook Generator (
generate_project_runbook): Dynamically writes a physicalDEPLOYMENT_RUNBOOK.mdinto the user's project root containing exact manual SSH commands, Nginx blocks, SSL status, and.envlocations. - 🧹 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 unnecessarynpm installor 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,:devtargets,--watch) while warning on risky operations (docker system prune,git reset --hard).
🔒 Security & Protection Architecture
📋 Comprehensive Tool Registry (19 Tools)
1. Read-Only Inspection & Analysis
2. Infrastructure Provisioning & Setup
3. Environment & Security
4. Planning & Execution
5. Self-Healing Execution Engine (v1.7.0)
6. Maintenance & Persistent Documentation (v1.6.0)
⚡ 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": "[email protected]",
"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
- Auto-Runbook File (
DEPLOYMENT_RUNBOOK.md):- Run
generate_project_runbookto generate a complete markdown runbook for human developers and handovers.
- Run
- 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