# OpenShift MCP server

> Enables AI assistants to manage OpenShift and Kubernetes clusters using the oc CLI for resource deployment, scaling, and troubleshooting.

- Repository: https://github.com/sanjaypsachdev/mcp-server-openshift
- Page: https://hostedmcp.org/servers/sanjaypsachdev/mcp-server-openshift
- Transport: stdio
- Stars: 1
- License: MIT
- Latest version: 1.2.0

## Install

### Claude Code

```sh
claude mcp add mcp-server-openshift -- npx -y mcp-server-openshift
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "mcp-server-openshift": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-openshift"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "mcp-server-openshift": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-openshift"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"mcp-server-openshift","type":"stdio","command":"npx","args":["-y","mcp-server-openshift"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "mcp-server-openshift": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-openshift"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add mcp-server-openshift -- npx -y mcp-server-openshift
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.mcp-server-openshift]
command = "npx"
args = ["-y", "mcp-server-openshift"]
```

### Gemini CLI

```sh
gemini mcp add -s user mcp-server-openshift npx -- -y mcp-server-openshift
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "mcp-server-openshift": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-openshift"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `OPENSHIFT_CONTEXT` | no | no | Default OpenShift/Kubernetes context |
| `OPENSHIFT_CONTEXT` | no | no | Default OpenShift/Kubernetes context |
| `OPENSHIFT_NAMESPACE` | no | no | Default namespace/project |
| `OPENSHIFT_NAMESPACE` | no | no | Default namespace/project |

## Tools (13)

- `oc_login`
- `oc_api_resources`
- `oc_explain`
- `oc_get`
- `oc_create`
- `oc_apply`
- `oc_delete`
- `oc_patch`
- `oc_describe`
- `oc_new_app`
- `oc_scale`
- `oc_logs`
- `oc_install_operator`

## FAQ

### How can I deploy an application using this server?

You can use the `oc_new_app` tool to deploy applications directly from Git repositories using S2I builds.

### What are the prerequisites for running the OpenShift MCP server?

You need Node.js 20 or higher, the OpenShift CLI (oc) installed and configured, and access to an OpenShift cluster.

### How does the server handle authentication?

The server provides an `oc_login` tool that supports secure login via tokens or username and password.
