Skip to main content

Examples and Workflows

Comprehensive usage examples and workflow patterns for the ArgoCD MCP Server.


🚀 Common Workflows

Repository Onboarding

User Request:

"I want to onboard my GitHub repository https://github.com/myorg/myapp to ArgoCD"

Agent Workflow:

StepTool UsedDescription
1Environment checkVerify GIT_PASSWORD or SSH_PRIVATE_KEY_PATH
2validate_repository_connectionTest connectivity
3onboard_repository_https/sshRegister repository
4get_repositoryConfirm registration

Application Deployment

User Request:

"Deploy my application from https://github.com/myorg/myapp to production cluster"

Agent Workflow:

StepTool UsedDescription
1onboard_repository_httpsRegister repository
2create_applicationCreate ArgoCD app
3get_application_diffPreview changes
4sync_applicationExecute deployment
5get_sync_statusMonitor progress
6get_application_detailsValidate success

Time Estimate: ~1-2 minutes


Debugging Application Issues

User Request:

"My app 'payment-service' is not working in production, help me debug it"

Agent Workflow:

StepTool UsedDescription
1get_application_detailsCheck status (1/3 pods failing)
2get_application_logsDetect errors (15 DB connection errors)
3get_application_eventsReview events (CrashLoopBackOff)
4AnalysisIdentify root cause
5RecommendationsProvide fixes

Example Output:

🔍 Application Status: DEGRADED
- 1 of 3 pods in CrashLoopBackOff

📋 Errors Detected:
- 15 database connection timeouts in last 5 minutes
- MySQL connection refused on port 3306

🎯 Root Cause: Database connectivity issue

💡 Immediate Fixes:
1. Check MySQL service is running
2. Verify network policies allow DB access
3. Validate connection string in secrets
4. Check resource limits on DB pods

🛡️ Preventive Measures:
1. Add connection pooling
2. Implement circuit breaker
3. Add readiness probe for DB dependency
4. Set up alerting for DB connectivity

Time Estimate: ~15 seconds (fully automated)


Rollback Deployment

User Request:

"URGENT: Latest deployment of checkout-service is broken, rollback immediately!"

Agent Workflow:

StepTool UsedDescription
1get_application_detailsGet history (v3.2.0 failed → v3.1.5 stable)
2get_application_diffPreview rollback changes
3rollback_applicationExecute rollback
4get_sync_statusMonitor (42 seconds)
5get_application_logsValidate recovery (0% error rate)

Time Estimate: ~1 minute


📝 Example Requests

Repository Management

"Onboard https://github.com/myorg/myapp to ArgoCD"
"List all repositories in ArgoCD"
"Validate connection to my GitHub repository"
"Remove the old test-repo from ArgoCD"

Application Management

"Create an application for my-app in the production namespace"
"List all applications in the staging cluster"
"Get the status of payment-service"
"Delete the test-app application"

Deployment Operations

"Sync my-app to the latest version"
"Show me what will change if I deploy frontend"
"Rollback checkout-service to the previous version"
"Cancel the ongoing deployment of api-gateway"

Project Management

"Create a project for the payments team"
"List all ArgoCD projects"
"Generate a project manifest for GitOps"

Monitoring

"Show me the health of all production applications"
"Get logs for payment-service"
"Monitor the sync operation for my-app"
"Show deployment events for the last hour"

🔄 End-to-End Workflows

Production Deployment Workflow

Scenario: Deploy a new application to production with full validation.

Step 1: Onboard Repository
"Add my GitHub repository to ArgoCD"

Step 2: Create Application
"Create an ArgoCD application for my-api targeting production"

Step 3: Preview Changes
"Show me what resources will be created"

Step 4: Deploy
"Sync the application to deploy it"

Step 5: Monitor
"Watch the deployment progress"

Step 6: Validate
"Confirm the deployment is healthy"

Emergency Rollback Workflow

Scenario: Quickly rollback a broken deployment.

Step 1: Assess Situation
"What's the current status of checkout-service?"

Step 2: Review History
"Show me the deployment history"

Step 3: Preview Rollback
"What will change if I rollback?"

Step 4: Execute Rollback
"Rollback to the previous working version"

Step 5: Verify
"Confirm the rollback was successful"

Multi-Tenancy Setup

Scenario: Set up a new team with isolated access.

Step 1: Create Project
"Create an ArgoCD project for the payments team"

Step 2: Configure RBAC
"Allow deployments only to payments-* namespaces"

Step 3: Register Repositories
"Add the payments team's repositories"

Step 4: Create Applications
"Create applications for their services"

Step 5: Verify Access
"Confirm the team can manage their apps"

💡 Tips and Best Practices

Always Preview Before Deploying

"Show me the diff before syncing my-app"

Use Dry-Run for Safety

"Sync my-app with dry-run to see what would happen"

Monitor After Deployment

"Monitor the sync operation until complete"
"Get logs after deployment to check for errors"

Set Up Projects for Isolation

"Create a project with namespace restrictions"

Validate Before Creating

"Validate this application configuration before creating"

🔒 Security Best Practices

Use Read-Only Mode for Monitoring

export MCP_ALLOW_WRITE="false"

Never Expose Credentials

All credentials should be in environment variables:

export GIT_PASSWORD="ghp_your_token"
export ARGOCD_AUTH_TOKEN="your-token"

Use TLS Verification in Production

export ARGOCD_INSECURE="false"

Next Steps