Skip to main content
Glama
argocd-mcp

argocd-mcp

Official

Argo CD MCP 服务器

Argo CD的模型上下文协议 (MCP)服务器实现,使 AI 助手能够通过自然语言与您的 Argo CD 应用程序交互。该服务器允许通过 stdio 和服务器发送事件 (SSE) 传输协议与 Visual Studio Code 和其他 MCP 客户端无缝集成。

该项目由 Argo 项目的创建者Akuity维护。

Akuity 是 Argo 和 Kargo 的企业级公司,为 Kubernetes 提供端到端 GitOps 的核心平台。借助 Akuity 平台,企业可以使用托管的 Argo CD 进行部署,与 Kargo 无缝集成,并使用 Akuity 监控功能实时洞察其基础架构。Akuity 由 Argo 创始人 Hong Wang、Jesse Suen 和 Alexander Matyushentsev 创立,其使命是为平台和应用程序团队提供企业级 GitOps 的最佳工具。


argocd-mcp-演示

特征

  • 传输协议:支持 stdio 和 SSE 传输模式,可灵活地与不同的客户端集成

  • 完整的 Argo CD API 集成:提供对 Argo CD 资源和操作的全面访问

  • AI 助手就绪:预先配置的工具,供 AI 助手以自然语言与 Argo CD 进行交互

Related MCP server: OpsLevel MCP

安装

先决条件

  • Node.js(建议使用 v18 或更高版本)

  • pnpm 包管理器(用于开发)

  • 具有 API 访问权限的 Argo CD 实例

  • Argo CD API 令牌(请参阅文档了解说明)

与游标一起使用

  1. 按照Cursor 文档获取 MCP 支持,并在项目中创建.cursor/mcp.json文件:

{
  "mcpServers": {
    "argocd-mcp": {
      "command": "npx",
      "args": [
        "argocd-mcp@latest",
        "stdio"
      ],
      "env": {
        "ARGOCD_BASE_URL": "<argocd_url>",
        "ARGOCD_API_TOKEN": "<argocd_token>"
      }
    }
  }
}
  1. 开始与代理模式对话以使用 MCP。

与 VSCode 一起使用

  1. 按照VS Code 文档中的使用 MCP 服务器,在您的项目中创建一个.vscode/mcp.json文件:

{
  "servers": {
    "argocd-mcp-stdio": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "argocd-mcp@latest",
        "stdio"
      ],
      "env": {
        "ARGOCD_BASE_URL": "<argocd_url>",
        "ARGOCD_API_TOKEN": "<argocd_token>"
      }
    }
  }
}
  1. 在支持 MCP 的 VS Code 中与 AI 助手开始对话。

与 Claude Desktop 一起使用

  1. 按照Claude Desktop 文档中的 MCP创建一个claude_desktop_config.json配置文件:

{
  "mcpServers": {
    "argocd-mcp": {
      "command": "npx",
      "args": [
        "argocd-mcp@latest",
        "stdio"
      ],
      "env": {
        "ARGOCD_BASE_URL": "<argocd_url>",
        "ARGOCD_API_TOKEN": "<argocd_token>"
      }
    }
  }
}
  1. 在设置中配置 Claude Desktop 以使用此配置文件。

可用工具

该服务器提供以下ArgoCD管理工具:

应用程序管理

  • list_applications :列出并过滤所有应用程序

  • get_application :获取有关特定应用程序的详细信息

  • create_application :创建一个新的应用程序

  • update_application :更新现有应用程序

  • delete_application :删除应用程序

  • sync_application :触发应用程序上的同步操作

资源管理

  • get_application_resource_tree :获取特定应用程序的资源树

  • get_application_managed_resources :获取特定应用程序的托管资源

  • get_application_workload_logs :获取应用程序工作负载(Pod、部署等)的日志

  • get_resource_events :获取应用程序管理的资源的事件

  • get_resource_actions :获取资源可用的操作

  • run_resource_action :对资源运行操作

为了发展

  1. 克隆存储库:

git clone https://github.com/akuity/argocd-mcp.git
cd argocd-mcp
  1. 安装项目依赖项:

pnpm install
  1. 启动开发服务器并启用热重载:

# For HTTP mode with hot reloading
pnpm run dev

# For SSE mode with hot reloading
pnpm run dev-sse

一旦服务器运行,您就可以在 Visual Studio Code 或其他 MCP 客户端中使用 MCP 服务器。

升级 ArgoCD 类型

要根据最新的 Argo CD API 规范更新 TypeScript 类型定义:

  1. 从ArgoCD 发布页面下载swagger.json文件,例如这里是 ArgoCD v2.14.11 的swagger.json 链接。

  2. 将下载的swagger.json文件放在argocd-mcp项目的根目录中。

  3. 运行以下命令,从 Swagger 定义生成 TypeScript 类型。这将创建或覆盖src/types/argocd.d.ts文件:

    pnpm run generate-types
  4. 更新src/types/argocd-types.ts文件,从新生成的src/types/argocd.d.ts中导出所需的类型。此步骤通常需要手动检查,以确保仅公开必要的类型。

Available Tools

14 tools
create_applicationC

create_application creates a new ArgoCD application in the specified namespace. The application.metadata.namespace field determines where the Application resource will be created (e.g., "argocd", "argocd-apps", or any custom namespace).

Inputs: application (required).

delete_applicationC

delete_application deletes application. Specify applicationNamespace if the application is in a non-default namespace to avoid permission errors.

Inputs: applicationName (required), applicationNamespace, cascade, propagationPolicy.

get_applicationB

get_application returns application by application name. Optionally specify the application namespace to get applications from non-default namespaces.

Inputs: applicationName (required), applicationNamespace.

get_application_eventsC

get_application_events returns events for application by application name

Inputs: applicationName (required).

get_application_managed_resourcesA

get_application_managed_resources returns managed resources for application by application name with optional filtering. Use filters to avoid token limits with large applications. Examples: kind="ConfigMap" for config maps only, namespace="production" for specific namespace, or combine multiple filters.

Inputs: applicationName (required), kind, namespace, name, +4 more.

get_application_resource_treeC

get_application_resource_tree returns resource tree for application by application name

Inputs: applicationName (required).

get_application_workload_logsC

get_application_workload_logs returns logs for application workload (Deployment, StatefulSet, Pod, etc.) by application name and resource ref and optionally container name

Inputs: applicationName (required), applicationNamespace (required), resourceRef (required), container (required).

get_resource_actionsC

get_resource_actions returns actions for a resource that is managed by an application

Inputs: applicationName (required), applicationNamespace (required), resourceRef (required).

get_resource_eventsC

get_resource_events returns events for a resource that is managed by an application

Inputs: applicationName (required), applicationNamespace (required), resourceUID (required), resourceNamespace (required), +1 more.

get_resourcesA

get_resources return manifests for resources specified by resourceRefs. If resourceRefs is empty or not provided, fetches all resources managed by the application.

Inputs: applicationName (required), applicationNamespace (required), resourceRefs.

list_applicationsC

list_applications returns list of applications

Inputs: search, limit, offset.

run_resource_actionC

run_resource_action runs an action on a resource

Inputs: applicationName (required), applicationNamespace (required), resourceRef (required), action (required).

sync_applicationC

sync_application syncs application. Specify applicationNamespace if the application is in a non-default namespace to avoid permission errors.

Inputs: applicationName (required), applicationNamespace, dryRun, prune, +2 more.

update_applicationD

update_application updates application

Inputs: applicationName (required), application (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a distinct aspect of ArgoCD application management. While get_application_events and get_resource_events could be confused, descriptions clarify their scope. Overall, purposes are clearly separated.

    Naming Consistency5/5

    All tools use consistent snake_case with verb_noun pattern (e.g., create_application, get_application_events). The naming is predictable and follows a clear convention.

    Tool Count5/5

    14 tools is well-scoped for an ArgoCD MCP server, covering CRUD operations, synchronization, logs, events, and resource management without being excessive.

    Completeness4/5

    The tool set covers core application lifecycle (CRUD, sync, logs, events) and resource management. Minor gaps like rollback or version history are missing, but the surface is largely complete for common tasks.

    Maintenance

    ActivityMaintained
    ResponsivenessMostly unanswered

    Related MCP Connectors

    Related MCP Servers