
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.
概覽
一個預設安全的 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 的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Openshift,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-openshift
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.
Install
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
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) oroc whoami -t. - password —
OPENSHIFT_USERNAME+OPENSHIFT_PASSWORDagainst the cluster's built-in OAuth server (HTPasswd / LDAP / any challenge-capable local IdP). The server runs the same request-token flowoc 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 KubernetesdryRun=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
Licence
MIT
來源:README.md,提交 9a57679
工具
0版本歷史
2- v0.2.0最新Sep 27, 2026
- v0.1.0Sep 19, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分