{
  "markdown": "# ArgoCD MCP Server\n\n<!-- mcp-name: io.github.asklokesh/argocd-mcp-server -->\n\n<div align=\"center\">\n\n# Argocd Mcp Server\n\n[![GitHub stars](https://img.shields.io/github/stars/LokiMCPUniverse/argocd-mcp-server?style=social)](https://github.com/LokiMCPUniverse/argocd-mcp-server/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/LokiMCPUniverse/argocd-mcp-server?style=social)](https://github.com/LokiMCPUniverse/argocd-mcp-server/network)\n[![GitHub watchers](https://img.shields.io/github/watchers/LokiMCPUniverse/argocd-mcp-server?style=social)](https://github.com/LokiMCPUniverse/argocd-mcp-server/watchers)\n\n[![License](https://img.shields.io/github/license/LokiMCPUniverse/argocd-mcp-server?style=for-the-badge)](https://github.com/LokiMCPUniverse/argocd-mcp-server/blob/main/LICENSE)\n[![Issues](https://img.shields.io/github/issues/LokiMCPUniverse/argocd-mcp-server?style=for-the-badge)](https://github.com/LokiMCPUniverse/argocd-mcp-server/issues)\n[![Pull Requests](https://img.shields.io/github/issues-pr/LokiMCPUniverse/argocd-mcp-server?style=for-the-badge)](https://github.com/LokiMCPUniverse/argocd-mcp-server/pulls)\n[![Last Commit](https://img.shields.io/github/last-commit/LokiMCPUniverse/argocd-mcp-server?style=for-the-badge)](https://github.com/LokiMCPUniverse/argocd-mcp-server/commits)\n\n[![Python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://python.org)\n[![MCP](https://img.shields.io/badge/Model_Context_Protocol-DC143C?style=for-the-badge)](https://modelcontextprotocol.io)\n\n[![Commit Activity](https://img.shields.io/github/commit-activity/m/LokiMCPUniverse/argocd-mcp-server?style=flat-square)](https://github.com/LokiMCPUniverse/argocd-mcp-server/pulse)\n[![Code Size](https://img.shields.io/github/languages/code-size/LokiMCPUniverse/argocd-mcp-server?style=flat-square)](https://github.com/LokiMCPUniverse/argocd-mcp-server)\n[![Contributors](https://img.shields.io/github/contributors/LokiMCPUniverse/argocd-mcp-server?style=flat-square)](https://github.com/LokiMCPUniverse/argocd-mcp-server/graphs/contributors)\n\n</div>\n\nA Model Context Protocol (MCP) server for integrating ArgoCD GitOps continuous delivery tool with GenAI applications, enabling intelligent Kubernetes deployment management.\n\n## Features\n\n- **Comprehensive ArgoCD API Coverage**:\n  - Application Management: Create, sync, delete, rollback applications\n  - Project Management: Configure projects, roles, and policies\n  - Repository Management: Add/remove Git repositories, Helm charts\n  - Cluster Management: Register and manage Kubernetes clusters\n  - Sync Operations: Manual/auto sync, sync windows, hooks\n  - Health Monitoring: Application health, sync status, resource tree\n  - RBAC Management: Users, roles, policies, JWT tokens\n  - GitOps Workflows: Automated deployments from Git commits\n  - Multi-tenancy: Namespace isolation, project restrictions\n  - Application Sets: Template-based multi-cluster deployments\n\n- **Authentication Methods**:\n  - JWT Token authentication\n  - API Token authentication\n  - OIDC/OAuth2 integration\n  - LDAP authentication support\n\n- **Enterprise Features**:\n  - Multi-cluster support\n  - Disaster recovery workflows\n  - Progressive delivery (Canary, Blue-Green)\n  - Automated rollback on failures\n  - Audit logging and compliance\n  - Resource optimization\n  - Secret management integration\n\n## Installation\n\n```bash\npip install argocd-mcp-server\n```\n\nOr install from source:\n\n```bash\ngit clone https://github.com/asklokesh/argocd-mcp-server.git\ncd argocd-mcp-server\npip install -e .\n```\n\n## Configuration\n\nCreate a `.env` file or set environment variables:\n\n```env\n# ArgoCD Connection\nARGOCD_SERVER=argocd.example.com\nARGOCD_AUTH_TOKEN=your_auth_token\nARGOCD_INSECURE=false\n\n# Optional Settings\nARGOCD_GRPC_WEB=true\nARGOCD_TIMEOUT=30\nARGOCD_CLIENT_CERT=/path/to/cert.pem\nARGOCD_CLIENT_KEY=/path/to/key.pem\n\n# Multi-Cluster Support\nARGOCD_PROD_SERVER=argocd-prod.example.com\nARGOCD_PROD_TOKEN=prod_token\n\nARGOCD_DEV_SERVER=argocd-dev.example.com\nARGOCD_DEV_TOKEN=dev_token\n```\n\n## Quick Start\n\n### Basic Usage\n\n```python\nfrom argocd_mcp import ArgoCDMCPServer\n\n# Initialize the server\nserver = ArgoCDMCPServer()\n\n# Start the server\nserver.start()\n```\n\n### Claude Desktop Configuration\n\nAdd to your Claude Desktop config:\n\n```json\n{\n  \"mcpServers\": {\n    \"argocd\": {\n      \"command\": \"python\",\n      \"args\": [\"-m\", \"argocd_mcp.server\"],\n      \"env\": {\n        \"ARGOCD_SERVER\": \"argocd.example.com\",\n        \"ARGOCD_AUTH_TOKEN\": \"your_auth_token\"\n      }\n    }\n  }\n}\n```\n\n## Available Tools\n\n### Application Management\n\n#### List Applications\n```python\n{\n  \"tool\": \"argocd_list_applications\",\n  \"arguments\": {\n    \"project\": \"default\",\n    \"namespace\": \"argocd\"\n  }\n}\n```\n\n#### Create Application\n```python\n{\n  \"tool\": \"argocd_create_application\",\n  \"arguments\": {\n    \"name\": \"my-app\",\n    \"project\": \"default\",\n    \"source\": {\n      \"repoURL\": \"https://github.com/org/repo.git\",\n      \"path\": \"manifests\",\n      \"targetRevision\": \"main\"\n    },\n    \"destination\": {\n      \"server\": \"https://kubernetes.default.svc\",\n      \"namespace\": \"production\"\n    },\n    \"syncPolicy\": {\n      \"automated\": {\n        \"prune\": true,\n        \"selfHeal\": true\n      }\n    }\n  }\n}\n```\n\n#### Sync Application\n```python\n{\n  \"tool\": \"argocd_sync_application\",\n  \"arguments\": {\n    \"name\": \"my-app\",\n    \"prune\": true,\n    \"force\": false,\n    \"strategy\": {\n      \"hook\": {\n        \"force\": true\n      }\n    }\n  }\n}\n```\n\n#### Get Application Status\n```python\n{\n  \"tool\": \"argocd_get_application_status\",\n  \"arguments\": {\n    \"name\": \"my-app\",\n    \"refresh\": true\n  }\n}\n```\n\n#### Rollback Application\n```python\n{\n  \"tool\": \"argocd_rollback_application\",\n  \"arguments\": {\n    \"name\": \"my-app\",\n    \"revision\": \"abc123\"\n  }\n}\n```\n\n### Project Management\n\n#### Create Project\n```python\n{\n  \"tool\": \"argocd_create_project\",\n  \"arguments\": {\n    \"name\": \"production\",\n    \"description\": \"Production applications\",\n    \"sourceRepos\": [\"https://github.com/org/*\"],\n    \"destinations\": [\n      {\n        \"server\": \"https://kubernetes.default.svc\",\n        \"namespace\": \"prod-*\"\n      }\n    ],\n    \"clusterResourceWhitelist\": [\n      {\"group\": \"*\", \"kind\": \"*\"}\n    ]\n  }\n}\n```\n\n### Repository Management\n\n#### Add Repository\n```python\n{\n  \"tool\": \"argocd_add_repository\",\n  \"arguments\": {\n    \"url\": \"https://github.com/org/repo.git\",\n    \"name\": \"my-repo\",\n    \"type\": \"git\",\n    \"username\": \"git-user\",\n    \"password\": \"git-token\",\n    \"insecure\": false\n  }\n}\n```\n\n#### Add Helm Repository\n```python\n{\n  \"tool\": \"argocd_add_helm_repository\",\n  \"arguments\": {\n    \"url\": \"https://charts.example.com\",\n    \"name\": \"my-charts\",\n    \"type\": \"helm\",\n    \"username\": \"helm-user\",\n    \"password\": \"helm-password\"\n  }\n}\n```\n\n### Cluster Management\n\n#### Add Cluster\n```python\n{\n  \"tool\": \"argocd_add_cluster\",\n  \"arguments\": {\n    \"name\": \"production-cluster\",\n    \"server\": \"https://k8s-prod.example.com\",\n    \"config\": {\n      \"bearerToken\": \"cluster-token\",\n      \"tlsClientConfig\": {\n        \"insecure\": false,\n        \"caData\": \"base64-encoded-ca\"\n      }\n    }\n  }\n}\n```\n\n### Application Sets\n\n#### Create ApplicationSet\n```python\n{\n  \"tool\": \"argocd_create_applicationset\",\n  \"arguments\": {\n    \"name\": \"multi-cluster-app\",\n    \"generators\": [\n      {\n        \"clusters\": {},\n        \"selector\": {\n          \"matchLabels\": {\n            \"environment\": \"production\"\n          }\n        }\n      }\n    ],\n    \"template\": {\n      \"metadata\": {\n        \"name\": \"{{cluster}}-app\"\n      },\n      \"spec\": {\n        \"project\": \"default\",\n        \"source\": {\n          \"repoURL\": \"https://github.com/org/repo.git\",\n          \"path\": \"{{cluster}}\"\n        },\n        \"destination\": {\n          \"server\": \"{{server}}\",\n          \"namespace\": \"default\"\n        }\n      }\n    }\n  }\n}\n```\n\n### Health and Monitoring\n\n#### Get Application Health\n```python\n{\n  \"tool\": \"argocd_get_application_health\",\n  \"arguments\": {\n    \"name\": \"my-app\"\n  }\n}\n```\n\n#### Get Resource Tree\n```python\n{\n  \"tool\": \"argocd_get_resource_tree\",\n  \"arguments\": {\n    \"name\": \"my-app\"\n  }\n}\n```\n\n## Advanced Configuration\n\n### Multi-Cluster GitOps\n\n```python\nfrom argocd_mcp import ArgoCDMCPServer, ClusterConfig\n\n# Configure multiple ArgoCD instances\nclusters = {\n    \"production\": ClusterConfig(\n        server=\"argocd-prod.example.com\",\n        auth_token=\"prod_token\",\n        default_namespace=\"argocd\"\n    ),\n    \"staging\": ClusterConfig(\n        server=\"argocd-staging.example.com\",\n        auth_token=\"staging_token\",\n        default_namespace=\"argocd-staging\"\n    ),\n    \"development\": ClusterConfig(\n        server=\"argocd-dev.example.com\",\n        auth_token=\"dev_token\",\n        default_namespace=\"argocd-dev\"\n    )\n}\n\nserver = ArgoCDMCPServer(clusters=clusters, default_cluster=\"production\")\n```\n\n### Progressive Delivery\n\n```python\n# Configure progressive delivery strategies\nprogressive_config = {\n    \"canary\": {\n        \"steps\": [\n            {\"setWeight\": 10},\n            {\"pause\": {\"duration\": \"5m\"}},\n            {\"setWeight\": 30},\n            {\"pause\": {\"duration\": \"5m\"}},\n            {\"setWeight\": 50},\n            {\"pause\": {\"duration\": \"5m\"}},\n            {\"setWeight\": 100}\n        ]\n    },\n    \"blueGreen\": {\n        \"activeService\": \"app-active\",\n        \"previewService\": \"app-preview\",\n        \"autoPromotionEnabled\": false\n    }\n}\n\nserver = ArgoCDMCPServer(progressive_config=progressive_config)\n```\n\n### Disaster Recovery\n\n```python\nfrom argocd_mcp import ArgoCDMCPServer, DisasterRecoveryConfig\n\ndr_config = DisasterRecoveryConfig(\n    backup_enabled=True,\n    backup_schedule=\"0 2 * * *\",  # Daily at 2 AM\n    backup_location=\"s3://backups/argocd\",\n    restore_priority=[\"production\", \"staging\", \"development\"]\n)\n\nserver = ArgoCDMCPServer(dr_config=dr_config)\n```\n\n## Integration Examples\n\nSee the `examples/` directory for complete integration examples:\n\n- `basic_gitops.py` - Basic GitOps workflows\n- `multi_cluster_deployment.py` - Multi-cluster application deployment\n- `progressive_delivery.py` - Canary and blue-green deployments\n- `disaster_recovery.py` - Backup and restore workflows\n- `genai_gitops.py` - AI-powered GitOps automation\n- `security_scanning.py` - Integration with security tools\n\n## Security Best Practices\n\n1. **Use service accounts** with minimal permissions\n2. **Enable RBAC** with proper policies\n3. **Implement network policies** for cluster isolation\n4. **Use sealed secrets** or external secret operators\n5. **Enable audit logging** for compliance\n6. **Implement admission controllers** for policy enforcement\n7. **Regular security scanning** of images and manifests\n\n## Error Handling\n\nThe server provides detailed error information:\n\n```python\ntry:\n    result = server.execute_tool(\"argocd_sync_application\", {\n        \"name\": \"my-app\"\n    })\nexcept ArgoCDError as e:\n    print(f\"ArgoCD error: {e.error_code} - {e.message}\")\n    if e.error_code == \"OutOfSync\":\n        print(\"Application is out of sync\")\n    elif e.error_code == \"ComparisonError\":\n        print(\"Error comparing application state\")\n```\n\n## Performance Optimization\n\n1. **Use application sets** for similar apps\n2. **Enable resource caching** in ArgoCD\n3. **Implement sync windows** to control deployment times\n4. **Use webhook notifications** instead of polling\n5. **Optimize manifest generation** with Helm/Kustomize\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Sync failures**\n   - Check application logs\n   - Verify repository access\n   - Review resource quotas\n\n2. **Authentication errors**\n   - Verify token validity\n   - Check RBAC policies\n   - Review server connectivity\n\n3. **Performance issues**\n   - Check ArgoCD server resources\n   - Review application count\n   - Optimize manifest size\n\n## Contributing\n\nContributions are welcome! Please read our contributing guidelines and submit pull requests.\n\n## License\n\nMIT License - see LICENSE file for details",
  "bytes": 11930,
  "sha": "0ca9e7e457bb5e3b1ebb45f140bbdeb328df0772314a72f7a2b7b6e2b937e011",
  "repo_slug": "asklokesh/argocd-mcp-server",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_asklokesh_argocd_mcp_server_fd5d385f/readme"
}