Skip to main content

Deployment Readiness Guide

How to validate your project is ready for production deployment using the MCP ADR Analysis Server.


Overviewโ€‹

The deployment readiness tools help you:

  • Validate test coverage and passing status
  • Check for security issues before deployment
  • Track deployment history and success rates
  • Enforce zero-tolerance policies for critical failures
  • Integrate with CI/CD pipelines

Quick Startโ€‹

Basic Deployment Checkโ€‹

Ask your MCP client:

"Check if this project is ready for production deployment"

Or use the tool directly:

{
"tool": "deployment_readiness",
"arguments": {
"projectPath": ".",
"environment": "production",
"strictMode": true
}
}

Pre-Deployment Validationโ€‹

Test Validationโ€‹

The deployment_readiness tool enforces test requirements:

CheckRequirementBlocking
Test suite existsAt least one test fileYes
All tests pass0 failuresYes
Coverage thresholdConfigurable (default 80%)No
Recent test runWithin 24 hoursNo
{
"tool": "deployment_readiness",
"arguments": {
"projectPath": ".",
"environment": "production",
"strictMode": true,
"testResults": {
"success": true,
"testsRun": 150,
"testsPassed": 150,
"testsFailed": 0,
"coverage": 85.2
}
}
}

Security Validationโ€‹

Security checks are always performed:

CheckDescriptionSeverity
Credential detectionScan for exposed secretsCritical
Dependency vulnerabilitiesCheck for known CVEsHigh
Configuration securityValidate environment setupMedium
Code patternsDetect insecure patternsMedium

Configuration Validationโ€‹

Ensures environment is properly configured:

  • Required environment variables set
  • Database connections validated
  • External service connectivity verified
  • SSL/TLS certificates valid

Using smart_git_push_v2โ€‹

For secure deployments with git, use smart_git_push_v2:

{
"tool": "smart_git_push_v2",
"arguments": {
"branch": "main",
"message": "feat: add new authentication system",
"checkDeploymentReadiness": true,
"targetEnvironment": "production",
"strictDeploymentMode": true,
"testResults": {
"success": true,
"testsRun": 150,
"testsPassed": 150,
"testsFailed": 0
}
}
}

Blocking Conditionsโ€‹

The push is blocked when:

  • Critical security issues detected
  • Test failures (when testResults provided)
  • Deployment readiness failures (when enabled)
  • Irrelevant files detected (build artifacts, temp files)

Human Overrideโ€‹

For edge cases requiring manual override:

{
"tool": "smart_git_push_v2",
"arguments": {
"branch": "main",
"requestHumanConfirmation": true,
"humanOverrides": [
{
"issue": "test-failure-001",
"reason": "Known flaky test, tracked in issue #123",
"approvedBy": "john.doe@example.com"
}
]
}
}

Deployment Historyโ€‹

Track Deployment Metricsโ€‹

The server maintains deployment history in .mcp-adr-cache/deploy-history.json:

{
"deployments": [
{
"id": "deploy-2026-02-20-001",
"timestamp": "2026-02-20T14:30:00Z",
"environment": "production",
"branch": "main",
"commit": "abc123",
"status": "success",
"metrics": {
"testsRun": 150,
"testsPassed": 150,
"coverage": 85.2,
"securityIssues": 0
}
}
]
}

Success Rate Trackingโ€‹

View deployment success rates:

{
"tool": "analyze_deployment_progress",
"arguments": {
"projectPath": ".",
"includeHistory": true,
"timeRange": "30d"
}
}

Environment-Specific Checksโ€‹

Developmentโ€‹

Minimal checks for rapid iteration:

{
"tool": "deployment_readiness",
"arguments": {
"environment": "development",
"strictMode": false
}
}

Stagingโ€‹

Moderate checks mirroring production:

{
"tool": "deployment_readiness",
"arguments": {
"environment": "staging",
"strictMode": true
}
}

Productionโ€‹

Full validation with zero tolerance:

{
"tool": "deployment_readiness",
"arguments": {
"environment": "production",
"strictMode": true,
"enableTreeSitterAnalysis": true
}
}

CI/CD Integrationโ€‹

GitHub Actionsโ€‹

name: Deployment Readiness

on:
pull_request:
branches: [main]

jobs:
check-readiness:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm test -- --coverage --json --outputFile=test-results.json

- name: Check deployment readiness
run: |
npx mcp-adr-analysis-server --tool deployment_readiness \
--environment production \
--strictMode true \
--testResults "$(cat test-results.json)"

Pre-Push Hookโ€‹

Add to .husky/pre-push:

#!/bin/bash

# Run tests
npm test

# Check deployment readiness for main branch
if [ "$(git rev-parse --abbrev-ref HEAD)" = "main" ]; then
echo "Checking deployment readiness for main branch..."
npx mcp-adr-analysis-server --tool deployment_readiness \
--environment production \
--strictMode true
fi

Troubleshootingโ€‹

"Deployment blocked: test failures"โ€‹

One or more tests are failing:

  1. Run npm test locally to see failures
  2. Fix the failing tests
  3. Re-run deployment readiness check

"Security issue detected"โ€‹

The security scan found potential issues:

  1. Review the security report in the response
  2. Fix critical issues before deployment
  3. Use human override for false positives (document reason)

"Stale test results"โ€‹

Test results are older than 24 hours:

  1. Re-run your test suite
  2. Provide fresh testResults to the tool
  3. Adjust analysisTimeout if tests take long

Best Practicesโ€‹

Pre-Deployment Checklistโ€‹

  1. All tests passing locally
  2. Code reviewed and approved
  3. Security scan completed
  4. Configuration validated for target environment
  5. Rollback plan documented
  6. Monitoring and alerts configured

Deployment Strategyโ€‹

StrategyDescriptionUse When
RollingGradual replacementStandard deployments
Blue/GreenParallel environmentsZero-downtime required
CanarySmall percentage firstHigh-risk changes
RecreateFull replacementDatabase migrations

Post-Deployment Validationโ€‹

After deployment, verify:

{
"tool": "analyze_deployment_progress",
"arguments": {
"projectPath": ".",
"validateDeployment": true,
"environment": "production"
}
}

ToolPurpose
deployment_readinessComprehensive readiness check
smart_git_push_v2Secure git push with validation
analyze_deployment_progressDeployment tracking and analysis
generate_deployment_guidanceDeployment recommendations


Questions about deployment? โ†’ Open an Issue