Mcp Openshift

io.github.dockndevai由 GitHub 帳號 dockndevai 發布v0.2.0更新於 Oct 24, 2026

Safe-by-default MCP for OpenShift / Kubernetes: projects, pods, logs, deployments, routes.

概覽

AI 產生的概覽

一個預設安全的 MCP 伺服器,讓助理檢視 OpenShift / Kubernetes 叢集,並在更高模式下執行操作:專案、Pod、日誌、部署、路由等。

可以做什麼
確認身分,列出可見的專案/命名空間,依命名空間與標籤篩選列出任意資源類型,並取得單一資源的完整 spec 與狀態。讀取 Pod 容器日誌與命名空間近期事件。在讀寫模式下,調整 Deployment/DeploymentConfig 的副本數並重啟 Deployment。在額外開關下,從清單建立或更新資源,以及刪除資源。
適用情境
當需要助理協助排查或維運 OpenShift / Kubernetes 叢集時使用,例如查看執行狀態、讀取日誌與事件,以及執行擴縮、重啟等受控變更;預設為唯讀。
執行需求
透過 npx 在本機執行(需要 Node.js)。需要叢集 API 位址(OPENSHIFT_SERVER)與憑證:OPENSHIFT_TOKEN,或針對叢集本機身分提供者的 OPENSHIFT_USERNAME 加 OPENSHIFT_PASSWORD。使用私有 CA 時,將 OPENSHIFT_CA_CERT 設為 CA 憑證包。需要能連線叢集 API 的網路。
安裝前請注意
憑證屬於機密:OPENSHIFT_TOKEN 與 OPENSHIFT_PASSWORD。密碼模式會將權杖快取到磁碟並在過期後重新登入。更高模式允許寫入:擴縮、重啟、套用清單與刪除資源,受 OPENSHIFT_MODE、OPENSHIFT_ALLOW_APPLY、OPENSHIFT_ALLOW_DELETE 及人工確認約束。OPENSHIFT_INSECURE_TLS 會關閉 TLS 驗證,僅限開發使用。可選的守護程序可對高風險操作進行分類。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Openshift,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-openshift

[npm] [CI] [licence]

A safe-by-default Model Context Protocol server for OpenShift / Kubernetes. It lets an agent explore and operate a cluster — projects, pods and logs, deployments and deploymentconfigs, routes, services, builds, imagestreams, and any resource by kind — and, in higher modes, scale workloads, restart deployments, apply manifests, and delete.

Connect with a token from the web console you already use, or your username/password against the cluster's local identity provider.

Part of the dockndevai MCP server suite — one governance model across all of them.

What it gives an agent

Starts read-only (see Safe by default); higher-capability tools are only registered when you raise the mode.

ToolForNeeds mode
whoamiconfirm the authenticated identityread-only
list_projectsprojects/namespaces you can seeread-only
list_resourceslist any kind (± namespace, label selector)read-only
get_resourceone resource with full spec/statusread-only
pod_logsa pod's container logsread-only
list_eventsrecent events in a namespaceread-only
scaleset replicas on a Deployment/DeploymentConfigread-write
rollout_restartrestart a Deploymentread-write
apply_resourcecreate/update from a manifest (SSA)read-write + OPENSHIFT_ALLOW_APPLY
delete_resourcedelete a resourceadmin + OPENSHIFT_ALLOW_DELETE

Install

bash
npx -y @dockndevai/mcp-openshift

You need your cluster's API URL and a credential. The quickest, since you use the browser console:

In the OpenShift web console, click your username (top-right) → Copy login command → Display Token. Copy the value after --token= (sha256~…) and the URL after --server=.

Then set OPENSHIFT_SERVER + OPENSHIFT_TOKEN. (Console tokens are short-lived; grab a fresh one when it expires, or use username/password below, which re-logs in automatically.)

Configure

json
{  "mcpServers": {    "openshift": {      "command": "npx",      "args": ["-y", "@dockndevai/mcp-openshift"],      "env": {        "OPENSHIFT_SERVER": "https://api.cluster.example.com:6443",        "OPENSHIFT_TOKEN": "sha256~...",        "OPENSHIFT_MODE": "read-only"      }    }  }}

See docs/CLIENTS.md for Claude Code / Cursor / Codex / VS Code / Windsurf, and .env.example for every variable.

Authentication

Auth mode is chosen automatically (override with OPENSHIFT_AUTH):

  • token — OPENSHIFT_TOKEN (bearer). From the console (above) or oc whoami -t.
  • password — OPENSHIFT_USERNAME + OPENSHIFT_PASSWORD against the cluster's built-in OAuth server (HTPasswd / LDAP / any challenge-capable local IdP). The server runs the same request-token flow oc login -u … -p … uses, caches the token at ~/.mcp-openshift/token.json (0600), and re-logs in on expiry. The password is sent only to your cluster's OAuth endpoint and is never logged or written to disk.

TLS: clusters usually use a private CA — set OPENSHIFT_CA_CERT to the CA bundle, or (dev only) OPENSHIFT_INSECURE_TLS=true to skip verification.

Safe by default

Enforced by src/security.ts — defence in depth on top of your account's cluster RBAC:

  • OPENSHIFT_MODE — read-only (default) → read-write → admin. Tools above the mode aren't registered.
  • OPENSHIFT_NAMESPACE_ALLOWLIST / OPENSHIFT_PROTECTED_NAMESPACES — confine writes to named namespaces; system namespaces (kube-*, openshift, openshift-*, default) are readable but never mutable.
  • OPENSHIFT_ALLOW_APPLY — creating/updating resources needs this flag on top of read-write, plus a human confirmation.
  • OPENSHIFT_ALLOW_DELETE — deletes need admin mode plus this flag, plus confirmation.
  • OPENSHIFT_DRY_RUN — sends writes with Kubernetes dryRun=All: validated and admission-checked, but nothing persists.
  • Human-in-the-loop — apply, delete, and scale-to-zero pause and ask a person to approve via MCP elicitation.
  • OPENSHIFT_AUDIT_LOG — a JSON audit line per guarded op on stderr; Secret values are redacted from all output.

Optional AI risk guard. Set OPENSHIFT_GUARD_MODE=monitor|enforce to have apply_resource / delete_resource consult a local laya-guard daemon (pipx install laya-guard && laya-guard) that classifies the operation allow/confirm/block before it runs. Runs after the apply/delete gates; only tightens, never grants; fails closed.

There is a bundled skill, openshift-safe-operations, that teaches an agent how to authenticate (including from the browser console), the safety rules, and the standard triage/operate workflows. See also SECURITY.md.

Developing

bash
npm installnpm run build# list the tools without a live cluster:echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | OPENSHIFT_SERVER=https://x:6443 OPENSHIFT_TOKEN=x node dist/index.jsnpm test

Licence

MIT

來源:README.md,提交 9a57679

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.2.0最新Sep 27, 2026
  2. v0.1.0Sep 19, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分