Skip to main content
Glama

KubeAid MCP

KubeAid が管理する Kubernetes クラスター向けの MCP サーバーです。 Claude Code、Claude Desktop、Cursor、その他の MCP 互換クライアントに接続して、 「どのアプリが同期ずれしている?」、「kube-prometheus がなぜ degraded なのか?」、 「cert-manager アプリを同期して」 といった質問ができます。モデルはこのサーバーのツールを呼び出して回答し、 ツールはあなた自身の kubeconfig 認証情報を通じてクラスターにアクセスします。

公式の @modelcontextprotocol/sdk と @kubernetes/client-node を TypeScript で構築しています。

著者: Deep Poharkar

なぜ KubeAid 専用なのか?

KubeAid は GitOps 方式でクラスターを運用します。すべてのアプリケーションは、kubeaid-config リポジトリから生成された ArgoCD の Application であり、自動同期はデフォルトで無効です。Git とクラスターの間のドリフトは正常であり、意図的な同期を待つことになります。汎用の Kubernetes アシスタントはそのワークフローを理解しません。このサーバーはそれを理解します:

  • ArgoCD の Application CR は第一級市民です。同期ステータス、健全性、失敗条件、ドリフトしたリソースは、1 回のツール呼び出しで取得できます。

  • 同期は、KubeAid における明示的な「今すぐデプロイ」という判断としてモデル化されています。オプトインのフラグでゲートされ、dry_run をサポートし、保護対象としてマークしたコンテキストでは決して許可されません。

  • バンドルされたプロンプトは KubeAid の運用習慣をエンコードしています。同期前にドリフトを確認し、クラスターを手編集するのではなく kubeaid-config リポジトリで修正する、といった習慣です。

Related MCP server: mcp-kubernetes-server

ツール

読み取りツール — 常に登録されます:

ツール

機能

list_contexts

サーバーが対象にできる kubeconfig コンテキスト。デフォルトと書き込み保護フラグ付き。

list_argocd_apps

KubeAid が管理するすべての ArgoCD アプリ。同期状態、健全性、リビジョン、自動同期フラグ付き。only_problems をサポート。

describe_argocd_app

1 つのアプリを詳細に表示: ソース、エラー条件、ドリフト/異常リソース、最後の同期結果、デプロイ履歴。

list_namespaces

ステータスと経過時間付きの名前空間。

list_nodes

Ready ステータス、ロール、kubelet バージョン、内部 IP 付きのノード。

list_pods

kubectl スタイルの派生ステータス (CrashLoopBackOff など)、準備完了数、再起動回数、ノード、経過時間付きのポッド。

describe_pod

コンテナごとの状態と最後のクラッシュ詳細、条件、ポッドの最近のイベント。

get_pod_logs

コンテナログの末尾を取得。previous: true でクラッシュしたインスタンスのログを読み取ります。

list_deployments

準備完了/最新/利用可能数のカウント付きのデプロイメント。

get_events

最近のイベント。オプションで警告のみ、名前空間ごとまたはクラスター全体。

describe_resource

apiVersion/kind/name による任意のリソース — SealedSecret や Certificate などの CRD も含む。

書き込みツール — KUBEAID_MCP_ALLOW_WRITES=true の場合のみ登録されます:

ツール

機能

sync_argocd_app

ArgoCD 同期をトリガー (KubeAid の「今すぐデプロイ」アクション)。revision、prune、dry_run をサポート。

scale_deployment

デプロイメントのレプリカ数を設定。

rollout_restart

デプロイメント/ステートフルセット/デーモンセットをローリング再起動。

delete_pod

スタックしたポッドを削除して、コントローラーに置き換えさせる。

すべてのツールはオプションの context 引数を受け取り、単一のサーバープロセスから kubeconfig 内の任意のクラスターを対象にできます。

プロンプト

プロンプトはクライアントのスラッシュコマンド / メニュー項目として表示され、上記のツールを使用してモデルをワークフローに導きます:

プロンプト

ワークフロー

diagnose_app

Degraded/OutOfSync アプリの根本原因を特定: 条件 → リソース → ポッドログ → 推奨事項。

sync_review

ドリフトしたすべてのアプリを一覧表示し、各保留中の同期のリスクを評価してから、何かを同期する前に確認を求める。

cluster_health_check

ノード、アプリ、ポッド、警告イベントをスイープし、重大度別に所見を報告。

クイックスタート

Node.js 20+ が必要です。

git clone <your-repo-url> kubeaid-mcp
cd kubeaid-mcp
npm install
npm run build

Claude Code

claude mcp add kubeaid -- node "$(pwd)/dist/index.js"

デフォルトは読み取り専用です。書き込みを有効にしつつ本番環境を触れないようにするには:

claude mcp add kubeaid \
  -e KUBEAID_MCP_ALLOW_WRITES=true \
  -e KUBEAID_MCP_PROTECTED_CONTEXTS=prod-cluster-1,prod-cluster-2 \
  -- node "$(pwd)/dist/index.js"

Claude Desktop

設定 → 開発者 → ローカル MCP サーバー を有効にし、そのページで開く設定ファイルに追加します:

{
  "mcpServers": {
    "kubeaid": {
      "command": "node",
      "args": ["/absolute/path/to/kubeaid-mcp/dist/index.js"],
      "env": {
        "KUBEAID_MCP_ALLOW_WRITES": "true",
        "KUBEAID_MCP_PROTECTED_CONTEXTS": "prod-cluster-1"
      }
    }
  }
}

その後、アプリを完全に終了して再度開きます。

設定

すべての設定は環境変数で、起動時に一度だけ読み取られます:

変数

デフォルト

意味

KUBECONFIG

client-node のデフォルト検索 (~/.kube/config)

kubeconfig のパス。

KUBEAID_MCP_CONTEXT

現在のコンテキストをライブで追従

固定のデフォルトコンテキストをピン留め。未設定の場合、kubectl config use-context でセッション中にサーバーの対象を変更できます。呼び出しごとの context 引数が常に優先されます。

KUBEAID_MCP_ARGOCD_NAMESPACE

argocd

ArgoCD の Application CR を保持する名前空間。

KUBEAID_MCP_ALLOW_WRITES

false

変更を伴うツールを登録するかどうか。

KUBEAID_MCP_PROTECTED_CONTEXTS

なし

書き込みが有効でも、すべての変更呼び出しを拒否するカンマ区切りのコンテキスト。

安全モデル

独立した 3 つのレイヤー:

  1. 機能ゲーティング — 書き込みが無効 (デフォルト) の場合、変更を伴うツールは決して登録されないため、モデルはそれらを認識すらできません。

  2. 保護コンテキスト — すべての変更ハンドラーは、対象コンテキストを KUBEAID_MCP_PROTECTED_CONTEXTS と再チェックし、モデルが何を要求しても保護されたコンテキストを拒否します。

  3. クライアント確認 — ツールには MCP の readOnlyHint/destructiveHint アノテーションが付いているため、適切なクライアントはリスクのある呼び出しの前に確認を求めます。

サーバーは独自の認証情報を保持しません。kubeconfig の ID が RBAC で既に許可されている操作しか実行できません。

開発

npm run typecheck   # strict TS, no emit
npm run build       # compile to dist/
npm run smoke       # spawn the server, MCP handshake, list tools + prompts
KUBEAID_MCP_ALLOW_WRITES=true npm run smoke   # verify write tools register

スモークテストはクラスターを必要としません。stdio 上で生の JSON-RPC プロトコルを駆動します。

ロードマップ

  • check_chart_updates: デプロイされたチャートのバージョンを、上流の KubeAid argocd-helm-charts ディレクトリと比較。

  • Sealed-secrets ヘルパー: SealedSecret のステータスを一覧表示し、失敗したアンシールをフラグ。

  • Prometheus/Alertmanager ツール: KubeAid が同梱する kube-prometheus スタックから発火中のアラートを表示。

謝辞

  • KubeAid by Obmondo — このサーバーが対象とするクラスター管理スタック。

  • Argo CD — KubeAid の基盤となる GitOps エンジン。

ライセンス

MIT © 2026 Deep Poharkar

Available Tools

11 tools
describe_argocd_appA
Read-only

Full detail for one ArgoCD Application: Git/Helm sources, sync and health status, error conditions, the resources that are OutOfSync or unhealthy, last sync operation result and recent deploy history. Use this to diagnose why an app is Degraded or a sync failed.

Inputs: name (required), context.

describe_podA
Read-only

Deep-dive one pod: per-container state (waiting/termination reasons, last crash exit code), conditions and the pod's recent events.

Inputs: name (required), namespace (required), context.

describe_resourceA
Read-only

Fetch any Kubernetes resource (including CRDs like SealedSecret or Certificate) by apiVersion, kind and name. Returns the full object.

Inputs: kind (required), name (required), context, namespace, +1 more.

get_eventsA
Read-only

Recent cluster events, newest last. Filter to one namespace and/or Warning-type events only.

Inputs: context, namespace, only_warnings.

get_pod_logsA
Read-only

Tail a container's logs. Set previous=true to read the prior (crashed) instance's logs — essential for CrashLoopBackOff.

Inputs: name (required), namespace (required), lines, context, +2 more.

list_argocd_appsA
Read-only

List the ArgoCD Applications KubeAid manages in this cluster, with sync status (Synced/OutOfSync), health (Healthy/Degraded/...), deployed revision and whether auto-sync is on. KubeAid disables auto-sync by default, so OutOfSync apps are usually awaiting a deliberate sync. Start here for any GitOps question.

Inputs: context, project, only_problems.

list_contextsA
Read-only

List the kubeconfig contexts (clusters) this server can target, including which one is the default and which are write-protected.

Inputs: no named parameters.

list_deploymentsA
Read-only

List deployments with ready/up-to-date/available replica counts and age.

Inputs: context, namespace.

list_namespacesA
Read-only

List namespaces in the cluster with their status and age.

Inputs: context.

list_nodesA
Read-only

List cluster nodes with Ready status, roles, kubelet version and internal IP.

Inputs: context.

list_podsA
Read-only

List pods with derived status (CrashLoopBackOff, ImagePullBackOff, Terminating, ...), ready count, restarts, node and age.

Inputs: context, namespace.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct resource/action - nodes, events, ArgoCD apps, pods, deployments, generic resource fetch, contexts, namespaces - with no overlapping purposes. The list/describe pairs for pods and ArgoCD apps are clearly separated by summary vs. detail, and describe_resource is explicitly generic.

    Naming Consistency5/5

    Naming follows a consistent verb_noun pattern: list_* for summary listings, describe_* for detailed views, and get_pod_logs as a specific action. Even though get_events uses 'get' instead of 'list', the pattern is predictable and readable, so deviation is minor and not confusing.

    Tool Count5/5

    With 11 tools, the set is well-scoped for a Kubernetes diagnostic server. Each tool addresses a common troubleshooting need (node health, pod issues, logs, ArgoCD sync, deployments) without excess or missing core operations.

    Completeness5/5

    The surface covers the main diagnostic workflows: listing and describing nodes, pods, deployments, and ArgoCD apps; retrieving events and logs; fetching any resource via describe_resource; and listing contexts/namespaces. For a read-only troubleshooting tool, this is comprehensive with no critical dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP (Model Context Protocol) server that integrates with the ArgoCD API, enabling AI assistants and large language models to manage ArgoCD applications and resources through natural language interactions.
      10
      12
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that enables AI assistants to interact with Kubernetes clusters by translating natural language into kubectl and Helm operations. It allows users to query, manage, and diagnose Kubernetes resources and cluster states through a seamless integration.
      20
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      A lightweight MCP server that enables AI assistants to deploy, inspect, and operate Kubernetes workloads through high-level workflow tools, reducing token usage with structured outputs.
      3
      MIT