OpenShift MCP Server

OpenShift MCP Server

Enables diagnostics and troubleshooting of OpenShift clusters through storage analysis, resource monitoring, GPU utilization tracking, and pod health checks using Prometheus metrics and the oc CLI.

Category
Visit Server

README

OpenShift MCP Server

A Model Context Protocol (MCP) server for OpenShift diagnostics and troubleshooting.

Features

Storage Tools

  • Storage Analysis: get_cluster_storage_report - comprehensive report of ephemeral storage usage on nodes, including top pod consumers.
  • Deep Forensics: inspect_node_storage_forensics - deep analysis of disk usage on a specific node, checking for unused images and container writable layers.
  • PV Capacity: check_persistent_volume_capacity - monitor persistent volume usage across namespaces with configurable thresholds.

Monitoring Tools

  • Resource Balance: get_cluster_resource_balance - analyze CPU and memory resource distribution across nodes.
  • Pod Restarts: detect_pod_restarts_anomalies - identify pods with excessive restart counts within a time window.
  • GPU Utilization: get_gpu_utilization - track GPU usage and identify idle GPU resources.
  • Inspect GPU Pod: inspect_gpu_pod - run nvidia-smi inside a GPU-enabled pod to view real-time process and memory details.
  • Check GPU Health: check_gpu_health - check for GPU hardware errors (XID) and throttling events across the cluster.
  • vLLM Metrics: get_vllm_metrics - monitor vLLM inference server performance metrics (throughput, queue size, cache usage).

All monitoring tools use Prometheus metrics via OpenShift route for real-time cluster observability.

Pod Diagnostics Tools

  • Pod Logs: get_pod_logs - retrieve and analyze logs from a specific pod, with support for previous container logs, tail limits, and time-based filtering.
  • Pod Diagnostics: get_pod_diagnostics - comprehensive health check of a pod including status, conditions, container states, restart counts, and issue detection.

Installation

# Using uv (recommended)
uv tool install .

# Or pip
pip install .

Configuration

This server relies on the oc command line tool.

  1. Ensure oc is installed and in your PATH.
  2. Ensure you are authenticated (oc login ...) to your target cluster before running the server.

MCP Client Configuration

Configure the MCP server in your Claude Desktop or Gemini CLI settings:

{
  "mcpServers": {
    "openshift-tools": {
      "command": "uv",
      "args": ["run", "openshift-mcp-server"]
    }
  }
}

Example Usage

Once configured, you can ask questions like:

"Give me a summary of storage usage for all nodes"

"Check GPU utilization in the cluster"

"Diagnose pod health for my-app-pod in production namespace"

Simulated Tool Output (get_cluster_storage_report):

# Storage Usage Report (3 nodes)

### Node: master0.example.com
- **Filesystem**: Used: 36.70 Gi | Capacity: 99.44 Gi | Available: 62.74 Gi
- **Image FS**: Used: 34.17 Gi
- **Total Pod Ephemeral Storage**: 5.19 Gi

**Top Pod Consumers:**
- 2.60 Gi: `openshift-marketplace/redhat-operators-gb8ff`
- 974.96 Mi: `openshift-marketplace/community-operators-fq744`

Simulated Tool Output (get_gpu_utilization):

### GPU Utilization Report
**Total GPUs Found:** 4

| Node | GPU | Utilization | Memory Used | Status |
|------|-----|-------------|-------------|--------|
| `host-a:9400` | 0 | **0.0%** | 0.0% | ⚠️ Idle |
| `host-a:9400` | 1 | **85.2%** | 92.3% | ✅ Active |

Simulated Tool Output (detect_pod_restarts_anomalies):

### Pod Restart Anomalies (>5 in last 1h)
| Namespace | Pod | Restarts |
|-----------|-----|----------|
| `ns-1` | `pod-a-7b666bd598-cvrlk` | **34** |
| `ns-2` | `pod-b-6dcf7d7bb8-dw8sg` | **16** |

#### 📋 Recommendations
1. **Check Logs**: `oc logs <pod> -n <namespace> --previous`
2. **Check Events**: `oc get events -n <namespace>`

Development

# Run locally
uv run openshift-mcp-server

Testing the server directly

When run directly, the server expects JSON-RPC messages on standard input. You can verify the registered tools by simulating a full client handshake (Initialize -> Initialized -> Tools/List):

(echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {"protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": {"name": "test-client", "version": "1.0"}}}'; sleep 0.5; echo '{"jsonrpc": "2.0", "method": "notifications/initialized"}'; sleep 0.5; echo '{"jsonrpc": "2.0", "id": 2, "method": "tools/list"}') | uv run openshift-mcp-server

Expected output (truncated for brevity):

{"jsonrpc":"2.0","id":1,"result":{...}}
{"jsonrpc":"2.0","id":2,"result":{"tools":[{"name":"get_cluster_storage_report",...},{"name":"inspect_node_storage_forensics",...},...]}}

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured