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:
| Step | Tool Used | Description |
|---|---|---|
| 1 | Environment check | Verify GIT_PASSWORD or SSH_PRIVATE_KEY_PATH |
| 2 | validate_repository_connection | Test connectivity |
| 3 | onboard_repository_https/ssh | Register repository |
| 4 | get_repository | Confirm registration |
Application Deployment
User Request:
"Deploy my application from https://github.com/myorg/myapp to production cluster"
Agent Workflow:
| Step | Tool Used | Description |
|---|---|---|
| 1 | onboard_repository_https | Register repository |
| 2 | create_application | Create ArgoCD app |
| 3 | get_application_diff | Preview changes |
| 4 | sync_application | Execute deployment |
| 5 | get_sync_status | Monitor progress |
| 6 | get_application_details | Validate 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:
| Step | Tool Used | Description |
|---|---|---|
| 1 | get_application_details | Check status (1/3 pods failing) |
| 2 | get_application_logs | Detect errors (15 DB connection errors) |
| 3 | get_application_events | Review events (CrashLoopBackOff) |
| 4 | Analysis | Identify root cause |
| 5 | Recommendations | Provide 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:
| Step | Tool Used | Description |
|---|---|---|
| 1 | get_application_details | Get history (v3.2.0 failed → v3.1.5 stable) |
| 2 | get_application_diff | Preview rollback changes |
| 3 | rollback_application | Execute rollback |
| 4 | get_sync_status | Monitor (42 seconds) |
| 5 | get_application_logs | Validate 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
- 🛠️ Tools - Available MCP tools reference
- 📁 Resources and Prompts - MCP resources and prompts
- ⚙️ Configuration - Server configuration