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:
| Check | Requirement | Blocking |
|---|---|---|
| Test suite exists | At least one test file | Yes |
| All tests pass | 0 failures | Yes |
| Coverage threshold | Configurable (default 80%) | No |
| Recent test run | Within 24 hours | No |
{
"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:
| Check | Description | Severity |
|---|---|---|
| Credential detection | Scan for exposed secrets | Critical |
| Dependency vulnerabilities | Check for known CVEs | High |
| Configuration security | Validate environment setup | Medium |
| Code patterns | Detect insecure patterns | Medium |
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
testResultsprovided) - 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:
- Run
npm testlocally to see failures - Fix the failing tests
- Re-run deployment readiness check
"Security issue detected"โ
The security scan found potential issues:
- Review the security report in the response
- Fix critical issues before deployment
- Use human override for false positives (document reason)
"Stale test results"โ
Test results are older than 24 hours:
- Re-run your test suite
- Provide fresh
testResultsto the tool - Adjust
analysisTimeoutif tests take long
Best Practicesโ
Pre-Deployment Checklistโ
- All tests passing locally
- Code reviewed and approved
- Security scan completed
- Configuration validated for target environment
- Rollback plan documented
- Monitoring and alerts configured
Deployment Strategyโ
| Strategy | Description | Use When |
|---|---|---|
| Rolling | Gradual replacement | Standard deployments |
| Blue/Green | Parallel environments | Zero-downtime required |
| Canary | Small percentage first | High-risk changes |
| Recreate | Full replacement | Database migrations |
Post-Deployment Validationโ
After deployment, verify:
{
"tool": "analyze_deployment_progress",
"arguments": {
"projectPath": ".",
"validateDeployment": true,
"environment": "production"
}
}
Related Toolsโ
| Tool | Purpose |
|---|---|
deployment_readiness | Comprehensive readiness check |
smart_git_push_v2 | Secure git push with validation |
analyze_deployment_progress | Deployment tracking and analysis |
generate_deployment_guidance | Deployment recommendations |
Related Documentationโ
- API Reference โ Complete tool documentation
- Security Philosophy โ Security approach
- Configuration โ Environment setup
Questions about deployment? โ Open an Issue