Connects Claude to ArgoCD's GitOps platform for managing Kubernetes deployments through conversation. Wraps the full ArgoCD API including application lifecycle operations (create, sync, rollback), project and repository management, cluster registration, and ApplicationSet templating for multi-cluster deployments. Supports both JWT and API token auth, handles automated sync policies with prune and self-heal options, and exposes health monitoring and resource tree inspection. Reach for this when you want to troubleshoot deployments, orchestrate complex sync operations across environments, or set up progressive delivery workflows without leaving your AI chat interface. Includes multi-cluster support through environment-based configuration.
A Model Context Protocol (MCP) server for integrating ArgoCD GitOps continuous delivery tool with GenAI applications, enabling intelligent Kubernetes deployment management.
Comprehensive ArgoCD API Coverage:
Authentication Methods:
Enterprise Features:
pip install argocd-mcp-server
Or install from source:
git clone https://github.com/asklokesh/argocd-mcp-server.git
cd argocd-mcp-server
pip install -e .
Create a .env file or set environment variables:
# ArgoCD Connection
ARGOCD_SERVER=argocd.example.com
ARGOCD_AUTH_TOKEN=your_auth_token
ARGOCD_INSECURE=false
# Optional Settings
ARGOCD_GRPC_WEB=true
ARGOCD_TIMEOUT=30
ARGOCD_CLIENT_CERT=/path/to/cert.pem
ARGOCD_CLIENT_KEY=/path/to/key.pem
# Multi-Cluster Support
ARGOCD_PROD_SERVER=argocd-prod.example.com
ARGOCD_PROD_TOKEN=prod_token
ARGOCD_DEV_SERVER=argocd-dev.example.com
ARGOCD_DEV_TOKEN=dev_token
from argocd_mcp import ArgoCDMCPServer
# Initialize the server
server = ArgoCDMCPServer()
# Start the server
server.start()
Add to your Claude Desktop config:
{
"mcpServers": {
"argocd": {
"command": "python",
"args": ["-m", "argocd_mcp.server"],
"env": {
"ARGOCD_SERVER": "argocd.example.com",
"ARGOCD_AUTH_TOKEN": "your_auth_token"
}
}
}
}
{
"tool": "argocd_list_applications",
"arguments": {
"project": "default",
"namespace": "argocd"
}
}
{
"tool": "argocd_create_application",
"arguments": {
"name": "my-app",
"project": "default",
"source": {
"repoURL": "https://github.com/org/repo.git",
"path": "manifests",
"targetRevision": "main"
},
"destination": {
"server": "https://kubernetes.default.svc",
"namespace": "production"
},
"syncPolicy": {
"automated": {
"prune": true,
"selfHeal": true
}
}
}
}
{
"tool": "argocd_sync_application",
"arguments": {
"name": "my-app",
"prune": true,
"force": false,
"strategy": {
"hook": {
"force": true
}
}
}
}
{
"tool": "argocd_get_application_status",
"arguments": {
"name": "my-app",
"refresh": true
}
}
{
"tool": "argocd_rollback_application",
"arguments": {
"name": "my-app",
"revision": "abc123"
}
}
{
"tool": "argocd_create_project",
"arguments": {
"name": "production",
"description": "Production applications",
"sourceRepos": ["https://github.com/org/*"],
"destinations": [
{
"server": "https://kubernetes.default.svc",
"namespace": "prod-*"
}
],
"clusterResourceWhitelist": [
{"group": "*", "kind": "*"}
]
}
}
{
"tool": "argocd_add_repository",
"arguments": {
"url": "https://github.com/org/repo.git",
"name": "my-repo",
"type": "git",
"username": "git-user",
"password": "git-token",
"insecure": false
}
}
{
"tool": "argocd_add_helm_repository",
"arguments": {
"url": "https://charts.example.com",
"name": "my-charts",
"type": "helm",
"username": "helm-user",
"password": "helm-password"
}
}
{
"tool": "argocd_add_cluster",
"arguments": {
"name": "production-cluster",
"server": "https://k8s-prod.example.com",
"config": {
"bearerToken": "cluster-token",
"tlsClientConfig": {
"insecure": false,
"caData": "base64-encoded-ca"
}
}
}
}
{
"tool": "argocd_create_applicationset",
"arguments": {
"name": "multi-cluster-app",
"generators": [
{
"clusters": {},
"selector": {
"matchLabels": {
"environment": "production"
}
}
}
],
"template": {
"metadata": {
"name": "{{cluster}}-app"
},
"spec": {
"project": "default",
"source": {
"repoURL": "https://github.com/org/repo.git",
"path": "{{cluster}}"
},
"destination": {
"server": "{{server}}",
"namespace": "default"
}
}
}
}
}
{
"tool": "argocd_get_application_health",
"arguments": {
"name": "my-app"
}
}
{
"tool": "argocd_get_resource_tree",
"arguments": {
"name": "my-app"
}
}
from argocd_mcp import ArgoCDMCPServer, ClusterConfig
# Configure multiple ArgoCD instances
clusters = {
"production": ClusterConfig(
server="argocd-prod.example.com",
auth_token="prod_token",
default_namespace="argocd"
),
"staging": ClusterConfig(
server="argocd-staging.example.com",
auth_token="staging_token",
default_namespace="argocd-staging"
),
"development": ClusterConfig(
server="argocd-dev.example.com",
auth_token="dev_token",
default_namespace="argocd-dev"
)
}
server = ArgoCDMCPServer(clusters=clusters, default_cluster="production")
# Configure progressive delivery strategies
progressive_config = {
"canary": {
"steps": [
{"setWeight": 10},
{"pause": {"duration": "5m"}},
{"setWeight": 30},
{"pause": {"duration": "5m"}},
{"setWeight": 50},
{"pause": {"duration": "5m"}},
{"setWeight": 100}
]
},
"blueGreen": {
"activeService": "app-active",
"previewService": "app-preview",
"autoPromotionEnabled": false
}
}
server = ArgoCDMCPServer(progressive_config=progressive_config)
from argocd_mcp import ArgoCDMCPServer, DisasterRecoveryConfig
dr_config = DisasterRecoveryConfig(
backup_enabled=True,
backup_schedule="0 2 * * *", # Daily at 2 AM
backup_location="s3://backups/argocd",
restore_priority=["production", "staging", "development"]
)
server = ArgoCDMCPServer(dr_config=dr_config)
See the examples/ directory for complete integration examples:
basic_gitops.py - Basic GitOps workflowsmulti_cluster_deployment.py - Multi-cluster application deploymentprogressive_delivery.py - Canary and blue-green deploymentsdisaster_recovery.py - Backup and restore workflowsgenai_gitops.py - AI-powered GitOps automationsecurity_scanning.py - Integration with security toolsThe server provides detailed error information:
try:
result = server.execute_tool("argocd_sync_application", {
"name": "my-app"
})
except ArgoCDError as e:
print(f"ArgoCD error: {e.error_code} - {e.message}")
if e.error_code == "OutOfSync":
print("Application is out of sync")
elif e.error_code == "ComparisonError":
print("Error comparing application state")
Sync failures
Authentication errors
Performance issues
Contributions are welcome! Please read our contributing guidelines and submit pull requests.
MIT License - see LICENSE file for details
ARGOCD_API_KEY*secretAPI Key for ARGOCD
ARGOCD_API_URLAPI URL for ARGOCD