Sponsored by Deepsite.site

OCM MCP Server

Created By
judexzhu7 months ago
A comprehensive Model Control Protocol (MCP) server for Red Hat OpenShift Cluster Manager (OCM) API operations. This server provides 12 intelligent tools for cluster management, account operations, and infrastructure monitoring.
Content

OCM MCP Server

Python 3.13+ MCP Compatible UV

A comprehensive Model Control Protocol (MCP) server for Red Hat OpenShift Cluster Manager (OCM) API operations. This server provides 12 intelligent tools for cluster management, account operations, and infrastructure monitoring.

Features(Keep Adding)

  • ocm_get_cluster - Get detailed cluster information with automatic HCP/Classic detection

  • ocm_get_cluster_machine_pools - Smart pool management (automatically selects node_pools for HCP, machine_pools for Classic)

  • ocm_get_cluster_upgrade_policies - Intelligent upgrade policy management for both cluster types

  • ocm_get_cluster_service_logs - Service logs using dynamic external_id resolution

  • ocm_get_cluster_alerts - Cluster alerts with severity breakdown

  • ocm_get_cluster_operators - Operator status monitoring with condition summaries

  • ocm_get_cluster_install_logs - Installation logs and history

  • ocm_get_cluster_vpc - VPC information with subnet analysis (public/private breakdown)

  • ocm_get_cluster_ingress - Ingress configuration and DNS information

  • ocm_get_cluster_identity_providers - Authentication provider configuration

  • ocm_get_cluster_limited_support_reasons - Support status and restrictions

  • ocm_get_accounts_by_email - Account management and user lookup

Installation

Prerequisites

  • Python 3.9+
  • uv package manager

Setup

  1. Clone and Navigate

    git clone <repository-url>
    cd mcp-ocm
    
  2. Install Dependencies

    uv sync
    
  3. Environment Configuration Create a .env file with your Red Hat API credentials:

    # Required: Your Red Hat API offline token
    RH_API_OFFLINE_TOKEN=your_offline_token_here
    
    # Optional: OCM API base URL (defaults to https://api.openshift.com)
    OCM_BASE_URL=https://api.openshift.com
    

    Getting your offline token:

    1. Visit Red Hat API Tokens
    2. Generate or copy your offline token
    3. Add it to your .env file

Usage

Running the MCP Server

{
  "mcpServers": {
    "ocm": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/your/mcp-ocm",
        "run",
        "ocm_mcp_server.py"
      ],
      "env": {
        "RH_API_OFFLINE_TOKEN": "your_actual_offline_token_here",
        "OCM_BASE_URL": "https://api.openshift.com"
      }
    }
  }
}

Tools Reference

ToolPurposeCluster TypesKey Features
ocm_get_clusterBasic cluster infoAllHCP/Classic detection
ocm_get_cluster_machine_poolsPool managementAllSmart endpoint selection
ocm_get_cluster_service_logsService logsAllDynamic external_id resolution
ocm_get_cluster_identity_providersAuth configAllProvider type analysis
ocm_get_cluster_ingressIngress configAllDNS and routing info
ocm_get_cluster_limited_support_reasonsSupport statusAllRestriction analysis
ocm_get_cluster_install_logsInstall historyAllLog size and content
ocm_get_cluster_alertsAlert monitoringAllSeverity breakdown
ocm_get_cluster_operatorsOperator statusAllCondition summaries
ocm_get_cluster_upgrade_policiesUpgrade managementAllMulti-endpoint handling
ocm_get_cluster_vpcNetwork infoAllSubnet analysis
ocm_get_accounts_by_emailAccount lookupN/AUser management

API Coverage

Cluster Management API

  • /api/clusters_mgmt/v1/clusters/{id}
  • /api/clusters_mgmt/v1/clusters/{id}/machine_pools
  • /api/clusters_mgmt/v1/clusters/{id}/node_pools
  • /api/clusters_mgmt/v1/clusters/{id}/upgrade_policies
  • /api/clusters_mgmt/v1/clusters/{id}/control_plane/upgrade_policies
  • /api/clusters_mgmt/v1/clusters/{id}/node_pools/{pool_id}/upgrade_policies

Service Logs API

  • /api/service_logs/v1/clusters/{external_id}/cluster_logs

Infrastructure APIs

  • /api/clusters_mgmt/v1/clusters/{id}/vpc
  • /api/clusters_mgmt/v1/clusters/{id}/ingresses
  • /api/clusters_mgmt/v1/clusters/{id}/identity_providers

Monitoring APIs

  • /api/clusters_mgmt/v1/clusters/{id}/metric_queries/alerts
  • /api/clusters_mgmt/v1/clusters/{id}/metric_queries/cluster_operators

Account Management API

  • /api/accounts_mgmt/v1/accounts?search=email='...

Dependencies

  • httpx: Async HTTP client
  • mcp: Model Control Protocol framework
  • python-dotenv: Environment variable management
  • asyncio: Async/await support

License

This project is licensed under the MIT License.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Serper MCP ServerA Serper MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
DeepChatYour AI Partner on Desktop
WindsurfThe new purpose-built IDE to harness magic
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Amap Maps高德地图官方 MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Playwright McpPlaywright MCP server
Tavily Mcp