kubeaid-mcp

kubeaid-mcp

An MCP server that lets AI assistants manage KubeAid GitOps clusters, inspecting ArgoCD apps, pods, events, and resources, with optional write operations like syncing apps and scaling deployments through your own kubeconfig credentials.

Category
访问服务器

README

KubeAid MCP

An MCP server for KubeAid-managed Kubernetes clusters. Plug it into Claude Code, Claude Desktop, Cursor or any MCP-compatible client and ask questions like "which apps are out of sync?", "why is kube-prometheus degraded?" or "sync the cert-manager app" — the model answers by calling this server's tools, which talk to your cluster through your own kubeconfig credentials.

Built in TypeScript on the official @modelcontextprotocol/sdk and @kubernetes/client-node.

Author: Deep Poharkar

Why KubeAid-specific?

KubeAid runs clusters the GitOps way: every application is an ArgoCD Application generated from your kubeaid-config repo, and auto-sync is disabled by default — drift between Git and the cluster is normal and waits for a deliberate sync. A generic Kubernetes assistant doesn't understand that workflow. This server does:

  • The ArgoCD Application CR is a first-class citizen: sync status, health, failing conditions and drifted resources are one tool call away.
  • Syncing is modeled as the explicit "deploy now" decision it is in KubeAid — gated behind an opt-in flag, with dry_run support, and never allowed on contexts you mark as protected.
  • The bundled prompts encode KubeAid operational habits: review drift before syncing, fix things in the kubeaid-config repo rather than hand-editing the cluster.

Tools

Read tools — always registered:

Tool What it does
list_contexts Kubeconfig contexts the server can target, with default and write-protection flags.
list_argocd_apps Every KubeAid-managed ArgoCD app with sync status, health, revision and auto-sync flag. Supports only_problems.
describe_argocd_app One app in depth: sources, error conditions, drifted/unhealthy resources, last sync result, deploy history.
list_namespaces Namespaces with status and age.
list_nodes Nodes with Ready status, roles, kubelet version, internal IP.
list_pods Pods with kubectl-style derived status (CrashLoopBackOff etc.), ready count, restarts, node, age.
describe_pod Per-container states and last-crash details, conditions, and the pod's recent events.
get_pod_logs Tail container logs; previous: true reads the crashed instance's logs.
list_deployments Deployments with ready/up-to-date/available counts.
get_events Recent events, optionally warnings-only, per namespace or cluster-wide.
describe_resource Any resource by apiVersion/kind/name — including CRDs like SealedSecret or Certificate.

Write tools — registered only when KUBEAID_MCP_ALLOW_WRITES=true:

Tool What it does
sync_argocd_app Trigger an ArgoCD sync (the KubeAid "deploy now" action). Supports revision, prune, dry_run.
scale_deployment Set a deployment's replica count.
rollout_restart Rolling-restart a deployment/statefulset/daemonset.
delete_pod Delete a stuck pod so its controller replaces it.

Every tool takes an optional context argument to target any cluster in your kubeconfig from a single server process.

Prompts

Prompts appear as slash commands / menu items in the client and walk the model through a workflow using the tools above:

Prompt Workflow
diagnose_app Root-cause a Degraded/OutOfSync app: conditions → resources → pod logs → recommendation.
sync_review List all drifted apps, assess the risk of each pending sync, then ask before syncing anything.
cluster_health_check Sweep nodes, apps, pods and warning events; report findings by severity.

Quick start

Requires 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"

Read-only by default. To enable writes while keeping production untouchable:

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

Enable Settings → Developer → Local MCP servers, then add to the config file that page opens:

{
  "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"
      }
    }
  }
}

Fully quit and reopen the app afterwards.

Configuration

All configuration is environment variables, read once at startup:

Variable Default Meaning
KUBECONFIG client-node default lookup (~/.kube/config) Kubeconfig path.
KUBEAID_MCP_CONTEXT follows current-context live Pin a fixed default context. When unset, kubectl config use-context retargets the server mid-session; per-call context arguments always win.
KUBEAID_MCP_ARGOCD_NAMESPACE argocd Namespace holding ArgoCD's Application CRs.
KUBEAID_MCP_ALLOW_WRITES false Register the mutating tools at all.
KUBEAID_MCP_PROTECTED_CONTEXTS none Comma-separated contexts that refuse every mutating call, even with writes enabled.

Safety model

Three independent layers:

  1. Capability gating — with writes disabled (the default), mutating tools are never registered, so the model cannot even see them.
  2. Protected contexts — every mutating handler re-checks the target context against KUBEAID_MCP_PROTECTED_CONTEXTS and refuses protected ones, whatever the model asks for.
  3. Client confirmation — tools carry MCP readOnlyHint/destructiveHint annotations, so well-behaved clients prompt you before risky calls.

The server holds no credentials of its own; it can only do what your kubeconfig identity is already authorized to do via RBAC.

Development

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

The smoke test needs no cluster — it drives the raw JSON-RPC protocol over stdio.

Roadmap

  • check_chart_updates: compare deployed chart versions against the upstream KubeAid argocd-helm-charts directory.
  • Sealed-secrets helpers: list SealedSecret status, flag failed unseals.
  • Prometheus/Alertmanager tools: surface firing alerts from the kube-prometheus stack KubeAid ships.

Acknowledgements

  • KubeAid by Obmondo — the cluster management stack this server is built for.
  • Argo CD — the GitOps engine underneath KubeAid.

License

MIT © 2026 Deep Poharkar

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选