# mcp-openshift [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/dockndevai/mcp-openshift  
**GitHub Stars:** 0  
**npm Downloads (last month):** 369  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-openshift

## Description
Safe-by-default MCP for OpenShift / Kubernetes: projects, pods, logs, deployments, routes.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-openshift": {
    "command": "npx",
    "args": ["-y","@dockndevai/mcp-openshift"],
    "env": {
      "OPENSHIFT_SERVER": "",
      "OPENSHIFT_TOKEN": "",
      "OPENSHIFT_USERNAME": "",
      "OPENSHIFT_PASSWORD": ""
    }
  }
}
```

**Requires environment variables:** `OPENSHIFT_SERVER`, `OPENSHIFT_TOKEN`, `OPENSHIFT_USERNAME`, `OPENSHIFT_PASSWORD` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What mcp-openshift does

The mcp-openshift MCP server gives an MCP-compatible agent access to selected OpenShift and Kubernetes cluster operations. It can verify the current identity, show accessible projects or namespaces, inspect resources by kind, retrieve pod logs, and read recent namespace events. Resource inspection can include specifications and status, while list operations support namespace and label-selector filters.

Operational tools are separated by capability level. Read-only mode exposes discovery and troubleshooting functions. Read-write mode adds workload scaling and Deployment restarts. Applying manifests and deleting resources require additional configuration and higher authorization, rather than becoming available automatically when a connection is established.

## How it works

The server runs as an npm command through `npx -y @dockndevai/mcp-openshift` and communicates with the cluster API. Set the API endpoint in `OPENSHIFT_SERVER`, then authenticate with either a bearer token or a username and password. Tokens can come from the OpenShift web console or `oc whoami -t`. Password authentication uses the cluster's local OAuth flow and stores a cached token at `~/.mcp-openshift/token.json` with restrictive permissions.

The mcp-openshift MCP server applies its own safety checks in addition to the account's Kubernetes or OpenShift RBAC. Tools above the configured mode are not registered. Write operations can be limited to an allowlisted set of namespaces, while system namespaces remain readable but cannot be changed. Apply, delete, and scale-to-zero operations require human approval through MCP elicitation.

## Setup and configuration

A client configuration needs the server URL and a credential. `OPENSHIFT_MODE` defaults to `read-only`; use `read-write` or `admin` only when the broader operation set is appropriate. For clusters using a private certificate authority, provide `OPENSHIFT_CA_CERT`. `OPENSHIFT_INSECURE_TLS=true` disables certificate verification and is intended only for development.

Applying resources additionally requires `OPENSHIFT_ALLOW_APPLY` and a confirmation. Deletion requires admin mode, `OPENSHIFT_ALLOW_DELETE`, and confirmation. `OPENSHIFT_DRY_RUN` makes Kubernetes validate and admission-check writes without persisting them. Namespace controls are available through `OPENSHIFT_NAMESPACE_ALLOWLIST` and `OPENSHIFT_PROTECTED_NAMESPACES`.

The server can emit one JSON audit record per guarded operation to stderr with `OPENSHIFT_AUDIT_LOG`; Secret values are redacted. An optional `OPENSHIFT_GUARD_MODE` setting can make apply and delete consult a local laya-guard daemon. That guard can allow, request confirmation, or block an operation, and it fails closed.

## Tools and capabilities

Available read-only tools include:

- `whoami` for checking the authenticated identity
- `list_projects` for visible projects or namespaces
- `list_resources` for listing arbitrary resource kinds
- `get_resource` for retrieving a resource's full specification and status
- `pod_logs` for reading container logs
- `list_events` for recent namespace events

Higher modes add `scale` for Deployments or DeploymentConfigs and `rollout_restart` for Deployments. With the relevant gates enabled, `apply_resource` creates or updates resources from manifests using server-side apply, and `delete_resource` removes a resource.

## Limitations and notes

The server does not replace cluster RBAC: the connected account still determines what the API permits. Console tokens are short-lived and may need to be renewed; username/password authentication can re-login when its cached token expires. Passwords are sent to the cluster's OAuth endpoint and are not logged or written to disk.

The mcp-openshift MCP server is distributed under the MIT license. Its bundled `openshift-safe-operations` skill documents authentication, safety rules, and common triage workflows, but the server's enforced mode and approval gates remain the controlling safeguards.

_Full upstream README: https://allmcps.com/mcp/mcp-openshift/readme_

