
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 分