Argocd

io.github.asklokesh由 GitHub 账号 asklokesh 发布v0.1.0更新于 Oct 24, 2026

MCP server for ArgoCD GitOps continuous delivery integration

概览

AI 生成的概览

一个连接 ArgoCD 的 MCP 服务器,让 AI 助手管理 GitOps 应用、项目、仓库、集群和同步操作。

可以做什么
列出、创建、同步、回滚和删除 ArgoCD 应用,并读取其状态与健康情况。创建和配置项目、角色与策略。添加或移除 Git 与 Helm 仓库,注册 Kubernetes 集群。创建 ApplicationSet 以实现基于模板的多集群部署。查看应用健康、同步状态和资源树。
适用场景
当你使用 ArgoCD 进行 Kubernetes GitOps 交付,并希望助手通过对话查看部署状态、触发或回滚同步、配置项目、仓库和集群,而不必操作 ArgoCD 界面或命令行时适用。
运行要求
以 Python 包形式在本地运行(pip 或 uvx)。需要能访问 ArgoCD 服务器的网络、其 API 地址,以及通过环境变量提供的 API 密钥;README 还列出服务器地址、认证令牌和可选的 TLS 证书设置。仅限桌面客户端。
安装前请注意
该 API 密钥可访问持续交付系统:工具能够创建、同步、回滚和删除应用,修改项目与 RBAC,并注册集群,误操作可能改动或删除正在运行的 Kubernetes 工作负载。仓库和集群相关工具需要 Git 密码、集群 bearer token 等凭据。建议使用最小权限的服务账号,并在确认前检查操作。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Argocd,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

ArgoCD MCP Server

A Model Context Protocol (MCP) server for integrating ArgoCD GitOps continuous delivery tool with GenAI applications, enabling intelligent Kubernetes deployment management.

Features

  • Comprehensive ArgoCD API Coverage:

    • Application Management: Create, sync, delete, rollback applications
    • Project Management: Configure projects, roles, and policies
    • Repository Management: Add/remove Git repositories, Helm charts
    • Cluster Management: Register and manage Kubernetes clusters
    • Sync Operations: Manual/auto sync, sync windows, hooks
    • Health Monitoring: Application health, sync status, resource tree
    • RBAC Management: Users, roles, policies, JWT tokens
    • GitOps Workflows: Automated deployments from Git commits
    • Multi-tenancy: Namespace isolation, project restrictions
    • Application Sets: Template-based multi-cluster deployments
  • Authentication Methods:

    • JWT Token authentication
    • API Token authentication
    • OIDC/OAuth2 integration
    • LDAP authentication support
  • Enterprise Features:

    • Multi-cluster support
    • Disaster recovery workflows
    • Progressive delivery (Canary, Blue-Green)
    • Automated rollback on failures
    • Audit logging and compliance
    • Resource optimization
    • Secret management integration

Installation

bash
pip install argocd-mcp-server

Or install from source:

bash
git clone https://github.com/asklokesh/argocd-mcp-server.gitcd argocd-mcp-serverpip install -e .

Configuration

Create a .env file or set environment variables:

env
# ArgoCD ConnectionARGOCD_SERVER=argocd.example.comARGOCD_AUTH_TOKEN=your_auth_tokenARGOCD_INSECURE=false
# Optional SettingsARGOCD_GRPC_WEB=trueARGOCD_TIMEOUT=30ARGOCD_CLIENT_CERT=/path/to/cert.pemARGOCD_CLIENT_KEY=/path/to/key.pem
# Multi-Cluster SupportARGOCD_PROD_SERVER=argocd-prod.example.comARGOCD_PROD_TOKEN=prod_token
ARGOCD_DEV_SERVER=argocd-dev.example.comARGOCD_DEV_TOKEN=dev_token

Quick Start

Basic Usage

python
from argocd_mcp import ArgoCDMCPServer
# Initialize the serverserver = ArgoCDMCPServer()
# Start the serverserver.start()

Claude Desktop Configuration

Add to your Claude Desktop config:

json
{  "mcpServers": {    "argocd": {      "command": "python",      "args": ["-m", "argocd_mcp.server"],      "env": {        "ARGOCD_SERVER": "argocd.example.com",        "ARGOCD_AUTH_TOKEN": "your_auth_token"      }    }  }}

Available Tools

Application Management

List Applications
python
{  "tool": "argocd_list_applications",  "arguments": {    "project": "default",    "namespace": "argocd"  }}
Create Application
python
{  "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      }    }  }}
Sync Application
python
{  "tool": "argocd_sync_application",  "arguments": {    "name": "my-app",    "prune": true,    "force": false,    "strategy": {      "hook": {        "force": true      }    }  }}
Get Application Status
python
{  "tool": "argocd_get_application_status",  "arguments": {    "name": "my-app",    "refresh": true  }}
Rollback Application
python
{  "tool": "argocd_rollback_application",  "arguments": {    "name": "my-app",    "revision": "abc123"  }}

Project Management

Create Project
python
{  "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": "*"}    ]  }}

Repository Management

Add Repository
python
{  "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  }}
Add Helm Repository
python
{  "tool": "argocd_add_helm_repository",  "arguments": {    "url": "https://charts.example.com",    "name": "my-charts",    "type": "helm",    "username": "helm-user",    "password": "helm-password"  }}

Cluster Management

Add Cluster
python
{  "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"      }    }  }}

Application Sets

Create ApplicationSet
python
{  "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"        }      }    }  }}

Health and Monitoring

Get Application Health
python
{  "tool": "argocd_get_application_health",  "arguments": {    "name": "my-app"  }}
Get Resource Tree
python
{  "tool": "argocd_get_resource_tree",  "arguments": {    "name": "my-app"  }}

Advanced Configuration

Multi-Cluster GitOps

python
from argocd_mcp import ArgoCDMCPServer, ClusterConfig
# Configure multiple ArgoCD instancesclusters = {    "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")

Progressive Delivery

python
# Configure progressive delivery strategiesprogressive_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)

Disaster Recovery

python
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)

Integration Examples

See the examples/ directory for complete integration examples:

  • basic_gitops.py - Basic GitOps workflows
  • multi_cluster_deployment.py - Multi-cluster application deployment
  • progressive_delivery.py - Canary and blue-green deployments
  • disaster_recovery.py - Backup and restore workflows
  • genai_gitops.py - AI-powered GitOps automation
  • security_scanning.py - Integration with security tools

Security Best Practices

  1. Use service accounts with minimal permissions
  2. Enable RBAC with proper policies
  3. Implement network policies for cluster isolation
  4. Use sealed secrets or external secret operators
  5. Enable audit logging for compliance
  6. Implement admission controllers for policy enforcement
  7. Regular security scanning of images and manifests

Error Handling

The server provides detailed error information:

python
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")

Performance Optimization

  1. Use application sets for similar apps
  2. Enable resource caching in ArgoCD
  3. Implement sync windows to control deployment times
  4. Use webhook notifications instead of polling
  5. Optimize manifest generation with Helm/Kustomize

Troubleshooting

Common Issues

  1. Sync failures

    • Check application logs
    • Verify repository access
    • Review resource quotas
  2. Authentication errors

    • Verify token validity
    • Check RBAC policies
    • Review server connectivity
  3. Performance issues

    • Check ArgoCD server resources
    • Review application count
    • Optimize manifest size

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests.

License

MIT License - see LICENSE file for details

来源:README.md,提交 05ac6d5

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。