
OpenShift MCP Server
io.github.sanjaypsachdev由 GitHub 帳號 sanjaypsachdev 發布v1.2.0更新於 Oct 24, 2026
OpenShift/Kubernetes cluster management via the oc CLI for MCP clients
概覽
透過 oc 命令列讓 AI 助理管理 OpenShift/Kubernetes 叢集:檢視、建立、修改、刪除資源,部署應用程式、擴縮容並讀取日誌。
- 可以做什麼
- 登入叢集,並列出 API 資源、說明資源結構與欄位文件
- 讀取、描述、建立、套用、修補與刪除 OpenShift/Kubernetes 資源
- 從 Git 儲存庫以 S2I 建置部署應用程式,並調整工作負載副本數
- 取得 Pod 與建置日誌,支援日誌取樣與錯誤樣式分析
- 透過 OLM、Helm 或直接清單安裝 Operator
- 以 MCP 資源讀取叢集資訊、專案清單與應用程式範本,並提供排錯提示詞
- 適用情境
- 適合讓助理直接操作或排查 OpenShift、Kubernetes 叢集的情境,例如從 Git 部署應用程式、擴縮容、查看 Pod 日誌或診斷異常資源,而不必由使用者手動執行 oc 命令。
- 執行需求
- 以 stdio 在本機執行(npm 套件經 npx,或 OCI 映像經 podman)。需要 Node.js 20+、已安裝並設定好的 oc 命令列,以及連線 OpenShift 叢集的網路。可選環境變數 OPENSHIFT_CONTEXT 與 OPENSHIFT_NAMESPACE 用來設定預設內容與命名空間。叢集憑證透過 oc_login 工具提供。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 OpenShift MCP Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
OpenShift MCP Server
[CI Pipeline] [CodeQL] [License: MIT] [Node.js Version] [TypeScript] [OpenShift] [Kubernetes] [MCP] [Test Coverage] [Tests] [npm version] [npm downloads] [Docker] [PRs Welcome] [Maintenance]
A Model Context Protocol (MCP) server that provides AI assistants with comprehensive OpenShift/Kubernetes cluster management capabilities through the oc command-line interface.
Demo Video
Watch the oc-new-app tool deploy a complete Spring Boot application from GitHub to OpenShift:
https://github.com/user-attachments/assets/f4bace3f-755b-462f-8a8a-680e4dc02129
Features
- Cluster Information: Access comprehensive cluster status, nodes and configuration via MCP resources
- Resource Description: Describe any resource with multiple output formats including human-readable summaries
- Complete Resource Management: Create, read, update, delete, and patch all OpenShift/Kubernetes resources
- Application Deployment: Deploy applications from Git repositories with S2I builds and automatic route creation
- Operator Management: Install operators via OLM, Helm, or direct manifests
- Cluster Operations: Scaling, monitoring, troubleshooting and management
- Build Operations: Start and monitor OpenShift builds
- Scaling Operations: Scale deployments, replicasets and statefulsets
- Logging: Retrieve logs from pods and builds
- Multi-Transport Support: STDIO and HTTP/SSE transports for different integration scenarios
- Comprehensive Testing: 99 unit tests ensuring production reliability
- Rich Error Handling: Detailed troubleshooting guidance and actionable error messages
- Troubleshooting Prompts: Interactive troubleshooting guides for common OpenShift scenarios
- Log Sampling: Sample and analyze pod logs with intelligent pattern detection and context
Prerequisites
- Node.js 20+
- OpenShift CLI (
oc) installed and configured - Access to an OpenShift cluster
Installation
Configuration
Add to your MCP client configuration:
Claude Desktop / Cursor
HTTP/SSE Transport (Remote Access)
Tools
Authentication & Access
oc_login- Securely log into OpenShift clusters using token or username/password authentication
API Discovery & Documentation
oc_api_resources- List all available API resources in the cluster with categorizationoc_explain- Explain resource schemas, fields, and API documentation
Core Resource Management
oc_get- Get OpenShift resources (pods, deployments, services, routes, etc.)oc_create- Create OpenShift resources from manifests or templatesoc_apply- Apply YAML manifests with validation and conflict resolutionoc_delete- Delete resources with safety checks and confirmation optionsoc_patch- Patch resources using strategic merge, JSON merge, or JSON patch operationsoc_describe- Describe resources with multiple output formats
Application Lifecycle
oc_new_app- Deploy applications from Git repositories with S2I buildsoc_scale- Scale deployments, deploymentconfigs, replicasets, and statefulsetsoc_logs- Get logs from pods, deployments, builds with filtering options
Advanced Operations
oc_install_operator- Install operators via OLM, Helm, or direct manifests
Resources
MCP Resources provide read-only access to cluster information:
openshift://cluster-info- Comprehensive cluster status, nodes, namespaces, and eventsopenshift://project-list- Detailed project information with quotas and usage statisticsopenshift://app-templates- Application deployment templates and patterns
Prompts
Interactive troubleshooting and operational guidance:
troubleshoot-openshift-prompt- Comprehensive OpenShift troubleshooting guide for all resource types and cluster issuesmonitoring-prompts- Monitoring and observability guidance for different scenarios
Sampling
Intelligent log analysis and pattern detection:
- Pod Logs Sampling - Automatic log sampling with error pattern detection and context analysis
Usage Examples
Login to Cluster
Discover API Resources
Deploy Application
Scale Application
Patch Resource
Troubleshoot Issues
Development
Transport Modes
STDIO (Default)
- Direct MCP client integration
- Lower latency
- Recommended for local development
HTTP/SSE
- Remote access capability
- Web integration friendly
- Container deployment ready
Architecture
Security
Authentication Security
- Token Authentication: Preferred method for automation and production use
- Password Authentication: Available but token authentication is recommended
- HTTPS Enforcement: All cluster connections must use HTTPS
- URL Validation: Server URLs validated to prevent SSRF attacks
- Private IP Blocking: Prevents connections to internal/metadata services
Operational Security
- RBAC Compliance: Respects OpenShift RBAC permissions
- No Credential Storage: Credentials are not stored or transmitted by the server
- User Permissions: Executes with the same permissions as the authenticated user
- Input Validation: Comprehensive validation of all inputs and parameters
- Secure Defaults: Conservative security settings by default
Best Practices
- Use Service Account Tokens: For automation and CI/CD pipelines
- Regular Token Rotation: Rotate authentication tokens regularly
- TLS Certificate Validation: Always validate TLS certificates in production
- Least Privilege: Use accounts with minimal required permissions
- Session Management: Use
oc logoutto clear credentials when done
License
MIT License - see LICENSE file for details.
來源:README.md,提交 0abad71
工具
0版本歷史
1- v1.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分