openshift-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@openshift-mcplist my projects in the OpenShift cluster"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
openshift-mcp
OpenShift-focused MCP server with multi-cluster Amazon Redshift access, built from the skeleton-mcp architecture.
This implementation keeps the skeleton contract intact:
Secrets are persistent in Vault.
Configuration is persistent in Postgres.
Token and config operations are user-scoped (multi-user by design).
Mutating MCP tools can be locked behind
MCP_ADMIN_AUTH_KEY.
Architecture
Runtime flow:
src/index.jsboots stdio mode.src/http/index.jsboots HTTP mode.src/config/env.jsvalidates all runtime settings.src/services/configStore.jspersists configuration in Postgres (${APP_NAME}_config).src/services/vault.jspersists secret material in Vault KV.src/services/targetService.jswraps OpenShift API requests.src/services/redshift.jsconnects to the Redshift cluster selected by each request.src/mcp/server.jsregisters OpenShift, Redshift, and token lifecycle MCP tools.
Related MCP server: Spotinst MCP Server
OpenShift MCP Tools
The server exposes 32 OpenShift-specific tools, 6 Redshift tools, 3 MCP admin-auth tools, and 2 Postgres configuration tools (43 total).
Shared Invocation Contract
Use this contract for all tools unless a tool-specific note says otherwise.
Access type:
Read-only tools do not mutate OpenShift, Postgres, or Vault.
Mutating tools can change cluster state, config state, token state, or queryable data.
High-risk tools can revoke credentials, run SQL, or issue arbitrary mutating API calls.
Permission model:
If
MCP_ADMIN_AUTH_KEYis configured and migrated to Vault, mutating operations requireauthorizationKey.Read-only operations do not require
authorizationKey.All OpenShift operations execute with the selected user's token (if present) and are constrained by OpenShift RBAC.
Environment and scope selection:
userIdis optional on many tools. If omitted, the server usesMCP_CONFIG_DEFAULT_USER_ID(ordefault).Redshift tools also require
clusterIdto select one named cluster within that user scope.OpenShift tools use runtime base URL/timeouts from environment (
OPENSHIFT_API_BASE_URL,OPENSHIFT_TIMEOUT_MS, auth mode settings).
Parameter rules:
Strings use
min(1)unless noted.clusterIdis normalized to lowercase and must match^[a-z0-9][a-z0-9_-]{0,62}$.Mutating HTTP verbs are
POST,PUT,PATCH,DELETE.
Response shape:
Success payload is serialized into MCP text content and includes
{ ok: true, status: 200, data: ... }.Errors include
{ ok: false, status, error, details? }and setisError: true.
Common failure conditions:
401invalid or missingauthorizationKeyfor required mutating calls.403OpenShift RBAC denial.404missing project/resource/cluster config.409auth rotation requested before bootstrap.422missing or invalid persisted credentials.503Vault/Postgres/OpenShift connectivity issues.
Tool Definitions
Notes:
UseandAvoiddefine when the tool should and should not be used.Riskvalues areread-only,mutating, orhigh-risk.Flowrecommends prerequisite and follow-up tools.Examplesnippets are valid request argument payloads.
OpenShift Read-Only Tools
Tool | Use / Avoid | Risk | Permissions and prerequisites | Parameters and constraints | Scope selection | Expected | Common failures | Flow | Example |
| Use to inspect MCP/OpenShift/Vault/Postgres wiring. Avoid for workload data. | read-only | Requires healthy service connections. |
| Uses resolved | server metadata, persistence health, connection info | 503 backend unavailable | Start here before troubleshooting, then |
|
| Use for API reachability/liveness. Avoid for version/capability details. | read-only | Requires OpenShift endpoint access; token optional by auth mode. |
| User token is loaded from Vault for that user. | upstream health response | 401/403 token or RBAC, 503 API down | After setting token, run before other OpenShift calls. |
|
| Use to read API server version. Avoid for upgrade planning details. | read-only | OpenShift API reachable. |
| Token by user scope. | Kubernetes/OpenShift version payload | 403/503 | After health check; pair with |
|
| Use to discover MCP-known convenience endpoints. Avoid for full dynamic API discovery. | read-only | None beyond server startup. | none | Not user-scoped. |
| rare; 500 internal only | Follow with |
|
| Use for full installed API group/version inventory. Avoid when dedicated tool already exists. | read-only | OpenShift discovery endpoints enabled. |
| Token by user scope affects visible groups. | groups/versions discovery | 403, 503 | Prerequisite for |
|
| Use to discover resources/verbs/subresources for one API version. Avoid guessing plural names. | read-only | Requires valid |
| Token by user scope. | resource list with verbs/subresources | 404 apiVersion missing, 403 | Run after |
|
| Use for schema-level request/response structure. Avoid for live objects. | read-only | OpenAPI v3 available on cluster. |
| Token by user scope. | OpenAPI index or one schema document | 404 schemaPath invalid, 503 | Use before crafting complex body payloads. |
|
| Use to enumerate accessible namespaces/projects. Avoid if exact project known. | read-only | User token should have project list/get rights. |
| Token by user scope. | project list | 403 | Use before namespace-scoped calls. |
|
| Use for one project details/status. Avoid for broad listings. | read-only | Project must exist and be visible by RBAC. |
| Token by user scope. | project object | 404, 403 | Follow |
|
| Use to list pods in namespace with selectors. Avoid for logs/details of one pod. | read-only | Namespace access required. |
| Namespace + user token scope. | pod list | 403, 404 namespace | Follow with |
|
| Use to inspect one pod state/containers. Avoid for historical log analysis. | read-only | Pod must exist and be readable. |
| Namespace + user token scope. | pod object | 404 pod, 403 | Start after |
|
| Use for container logs with tail/time controls. Avoid for metrics/events. | read-only | Pod/log RBAC needed. |
| Namespace + user token scope. | log text or structured log response | 400 invalid options, 404 pod/container | Use after identifying pod/container. |
|
| Use to troubleshoot warnings/failures by event stream. Avoid for object spec retrieval. | read-only | Event API and RBAC required. |
| Warning) | Cluster or namespace by args + user scope. | event list | 403 | Pair with pod/deployment diagnostics. |
| Use to inspect deployments in namespace. Avoid for scaling/restart actions. | read-only | Apps API readable. |
| Namespace + user token scope. | deployment list | 403, 404 | Pre-check before scale/restart. |
|
| Use to list service frontends. Avoid for route hostnames. | read-only | Core services API readable. |
| Namespace + user token scope. | service list | 403, 404 | Pair with routes/pods for traffic debugging. |
|
| Use to list OpenShift routes. Avoid on pure Kubernetes clusters without route API. | read-only | Route API installed and authorized. |
| Namespace + user token scope. | route list | 404 API absent, 403 | Follow with |
|
| Use for one route host/TLS/backends. Avoid for list use-cases. | read-only | Route must exist and be readable. |
| Namespace + user token scope. | route object | 404 route/API absent, 403 | After listing routes. |
|
| Use to assess operator health/degradation. Avoid for workload troubleshooting only. | read-only | OpenShift config APIs available. |
| Cluster scope, token by user. | ClusterOperator list/conditions | 404 API absent, 403 | Pair with cluster version and events. |
|
| Use to inspect desired/current updates and history. Avoid for node-level issues. | read-only | ClusterVersion API available. |
| Cluster scope, token by user. | ClusterVersion object | 404 API/name, 403 | Use with |
|
| Use for node inventory/conditions. Avoid for per-pod details. | read-only | Node list RBAC required. |
| Cluster scope, token by user. | node list | 403 | Pair with |
|
| Use for RBAC preflight checks. Avoid as a substitute for full policy audit. | read-only | SubjectAccessReview permission path available. |
| User token scope. | authorization decision details | 403 on SAR endpoint | Run before mutating operations to preflight rights. |
|
| Use to inspect namespace/cluster RoleBindings. Avoid for full RBAC graphing. | read-only | RBAC APIs readable. |
| Cluster-wide or namespace scope. | RoleBinding list | 403 | Follow with |
|
| Use to inventory installed CRDs. Avoid for CR instance data itself. | read-only | apiextensions API readable. |
| Cluster scope, token by user. | CRD list | 403, 404 API absent | Pair with discovery tools and |
|
| Use to inspect OLM subscriptions. Avoid if OLM not installed. | read-only | OLM APIs and RBAC required. |
| Cluster or namespace scope. | subscription list | 404 OLM API absent, 403 | Pair with operator troubleshooting flows. |
|
| Use for live metrics ( | read-only | Metrics API ( | `resourceType (pods | nodes) | Scope depends on resource type and namespace. | usage metrics list/object | 404 metrics API absent, 403 | Prereq: validate metrics API via discovery. |
| Use to verify token metadata/index state without exposing token. Avoid for setting/revoking token. | read-only | Metadata key and Vault token path may or may not exist. |
| Exact user scope required. | tokenConfigured flag, metadata record, index entry | 404/503 backing store errors | Use after set/deactivate operations to verify state. |
|
OpenShift Mutating and Generic Tools
Safety warning: these tools can alter production cluster state or credential state. Validate userId, namespace, and target name before invocation.
Tool | Use / Avoid | Risk | Permissions and prerequisites | Parameters and constraints | Scope selection | Expected | Common failures | Flow | Example |
| Use to change replica count. Avoid for rollout image/env changes. | mutating | Requires valid |
| Namespace + user token scope. | scale result/deployment summary | 401 auth key, 403 RBAC, 404 deployment | Prereq: |
|
| Use for restart via pod-template annotation patch. Avoid for full rollout strategy changes. | mutating | Requires mutating auth and deployment patch rights. |
| Namespace + user token scope. | rollout restart patch result | 401, 403, 404 | Prereq: check deployment health; follow with events/pod status. |
|
| Use for any discovered resource operation by coordinates. Avoid when a dedicated tool exists for safer validation. | high-risk for mutating verbs | For |
| Uses user token; namespace optional based on resource scope. | passthrough API response | 400 malformed coordinates/body, 401 mutating auth, 403 RBAC, 404 resource | Prereq: discovery tools; follow with targeted read tool. |
|
| Use for raw path/non-resource APIs not covered elsewhere. Avoid for common workflows where dedicated tools exist. | high-risk for mutating verbs | Mutating verbs require |
| Path is normalized to leading | passthrough API response | 400 invalid path/method, 401, 403, 404 | Prereq: |
|
| Use to create/rotate a user's OpenShift bearer token and metadata/index records. Avoid for temporary session-only tokens. | high-risk | Mutating auth required when configured; Vault and Postgres must be writable. |
| Writes to user-scoped Vault token path, shared token index, and user metadata key. | redacted token path/index metadata summary | 401, 422 Vault write/read issues, 503 backends | Prereq: |
|
| Use to revoke user token, mark index inactive, and delete user token secret. Avoid if you only need metadata inspection. | high-risk destructive | Mutating auth required when configured. Operation is destructive for direct token secret. |
| Affects only selected user scope and shared index entry for that token hash. |
| 401, 503 Vault/store failures | Prereq: confirm target with |
|
MCP Admin Authorization Tools
Safety warning: rotation invalidates prior mutating access immediately.
Tool | Use / Avoid | Risk | Permissions and prerequisites | Parameters and constraints | Scope selection | Expected | Common failures | Flow | Example |
| Use to confirm whether mutating guard is active and where verifier is sourced. Avoid for key validation. | read-only | Vault reachable for final source of truth. | none | Global server scope. |
| 503 Vault unavailable | Prereq for verify/rotate runbooks. |
|
| Use to test an | read-only security check | Requires candidate key. |
| Global auth verifier scope. |
| 401 invalid key, 503 vault issues | Run before all mutating calls. |
|
| Use to replace admin key hash in Vault. Avoid frequent unnecessary rotation in active automations without client coordination. | high-risk mutating | Requires currently valid |
| Global auth verifier scope. |
| 401 invalid current key, 409 not bootstrapped, 503 Vault | Prereq: status + verify; follow by updating all clients and re-verify. |
|
Redshift Tools
Safety warning: query and cluster mutation can affect data availability and integrity.
Tool | Use / Avoid | Risk | Permissions and prerequisites | Parameters and constraints | Scope selection | Expected | Common failures | Flow | Example |
| Use to list configured clusters for user without credentials. Avoid for connectivity validation. | read-only | Redshift feature enabled and config store readable. |
| User-scoped config prefix | metadata list with | 503 config store | Prereq before selecting |
|
| Use to inspect one cluster metadata. Avoid for secrets (never returned). | read-only | Cluster record must exist. |
| User + cluster selection. | one metadata record | 404 cluster missing, 400 invalid id | Follow |
|
| Use to validate connection/auth to selected cluster. Avoid for SQL validation. | read-only | Cluster metadata and Vault credentials must exist. |
| User + cluster selection. | connectivity/status fields | 404 cluster, 422 missing credentials, network errors | Run before |
|
| Use to create/replace cluster connection + credentials. Avoid storing ad-hoc temporary credentials. | high-risk mutating | Mutating auth required when configured; Vault and Postgres writable. |
| Writes metadata to Postgres and credentials to Vault for user+cluster. | stored metadata (credentials excluded) | 401, 400 invalid id/port, 503 stores | Prereq: verify admin key; follow with health check. |
|
| Use to delete metadata and credentials for one cluster. Avoid if you only want to disable query access temporarily. | high-risk destructive | Mutating auth required when configured. |
| Removes selected user+cluster config and secret. |
| 401, 400 invalid id, 503 store errors | Prereq: list/get to confirm target; follow by list check. |
|
| Use for parameterized SQL on a selected cluster. Avoid non-parameterized dynamic SQL from untrusted input. | high-risk mutating/data-impacting | Mutating auth required when configured; cluster and credentials must exist. |
| Executes in selected user+cluster context. | result rows/metadata limited by | 401, 404 cluster, 422 missing creds, SQL/runtime errors | Prereq: health check; follow with read-back validation query. |
|
Postgres Config Tools
Tool | Use / Avoid | Risk | Permissions and prerequisites | Parameters and constraints | Scope selection | Expected | Common failures | Flow | Example |
| Use to read user-scoped config keys. Avoid for secret material (use Vault-backed tools). | read-only | Postgres reachable. |
| Reads one key in selected user scope. |
| 503 db errors | Prereq: know exact key naming. |
|
| Use to write user-scoped non-secret config JSON. Avoid storing credentials/tokens in config. | mutating | Mutating auth required when configured; Postgres writable. |
| Writes one key in selected user scope. |
| 401, 503 db errors | Prereq: optional |
|
Destructive and High-Risk Operations Checklist
Before running these operations, explicitly verify target scope and identity:
openshift_deactivate_user_token: confirm exactuserId, then re-check metadata after revoke.redshift_remove_cluster: confirmclusterIdand user scope to avoid removing the wrong tenant config.mcp_admin_auth_rotate: coordinate client key rollout first to avoid automation lockout.openshift_api_requestandopenshift_resource_requestwith mutating methods: prefer dedicated tools unless you need unsupported endpoints.redshift_query: use parameterized SQL and conservativemaxRows.
Recommended preflight sequence for mutating sessions:
mcp_admin_auth_statusmcp_admin_auth_verifyopenshift_connection_infoorredshift_health_checkTargeted mutating tool
Matching read-only verification tool
MCP_ADMIN_AUTH_KEY is a bootstrap value. On first authorization or status operation, the server hashes it with SHA-256 and persists the verifier at ${APP_NAME}/admin/auth in Vault. Vault takes precedence on subsequent process starts. The plaintext bootstrap or replacement key is never stored or returned by the server. Use a minimum of 16 characters when rotating.
Dedicated tools cover routine operations with validated inputs:
Workloads and diagnostics: pods, logs, events, deployments, scaling, and rollout restart
Networking: services and OpenShift routes
Platform health: version, ClusterOperators, ClusterVersion, and nodes
Authorization: self-access reviews and RoleBindings
Extensibility: CRDs and Operator Lifecycle Manager subscriptions
Capacity: pod and node usage through
metrics.k8s.io
Multi-Cluster Redshift
Redshift connections are user-scoped and selected by the required clusterId argument. A single MCP process can hold any number of named clusters for each user.
redshift_set_clustercreates or replaces a cluster. Connection metadata is stored in Postgres, whileusernameandpasswordare stored in Vault.redshift_list_clustersandredshift_get_clusterreturn metadata without credentials.redshift_health_checkvalidates the selected connection.redshift_queryruns parameterized SQL and caps returned rows withmaxRows.redshift_remove_clusterdeletes both metadata and credentials for only the selected cluster.
Cluster configuration keys use redshift.cluster.{clusterId}. Credentials use ${APP_NAME}/redshift/users/{userId}/clusters/{clusterId} in Vault. Cluster IDs accept 1-63 lowercase letters, numbers, hyphens, or underscores. When MCP_ADMIN_AUTH_KEY is configured, setting/removing clusters and running SQL require authorizationKey.
Example cluster registration:
{
"clusterId": "analytics",
"host": "analytics.abc123.us-east-1.redshift.amazonaws.com",
"port": 5439,
"database": "warehouse",
"username": "mcp_user",
"password": "replace-with-secret",
"ssl": true,
"timeoutMs": 15000
}Configure another cluster with a different clusterId, then pass the intended ID to every health check or query. SQL parameters use PostgreSQL placeholders such as $1, $2, and are supplied through the parameters array.
Complete API Coverage
OpenShift API availability varies by release, enabled cluster features, aggregated API servers, installed Operators, and CustomResourceDefinitions. For that reason, complete coverage is discovery-driven rather than a fixed list of hard-coded endpoints.
openshift_discover_api_groupsreads/apiand/apisto enumerate every installed core and grouped API version.openshift_discover_api_resourcesreads the selected version endpoint and returns its resources, namespaced scope, supported verbs, short names, categories, and subresources.openshift_discover_openapireads/openapi/v3and its returned schema paths for request and response schemas.openshift_resource_requestaddresses any discovered resource usingapiVersion, pluralresource, optionalnamespace, optionalname, and optionalsubresource.openshift_api_requestcovers non-resource and specialized endpoints by raw path.
This covers Kubernetes APIs, OpenShift APIs, aggregated APIs such as metrics, Operator Lifecycle Manager APIs, installed Operator APIs, CRDs, and future APIs without requiring a server release. Actual discovery results and allowed operations are constrained by the selected user's OpenShift RBAC permissions.
Examples supported by openshift_resource_request:
Core namespaced resource:
apiVersion=v1,resource=pods,namespace=defaultCluster-scoped resource:
apiVersion=v1,resource=nodesOpenShift resource:
apiVersion=route.openshift.io/v1,resource=routes,namespace=my-projectOperator resource:
apiVersion=operators.coreos.com/v1alpha1,resource=subscriptions,namespace=openshift-operatorsArbitrary CRD: use the
apiVersionand plural resource returned by discoverySubresource: set
nameandsubresource, such asdeployments/{name}/scaleorpods/{name}/log
Multi-User Token Model
Each user token is stored in Vault and indexed for policy validation:
Direct user token secret path:
${OPENSHIFT_USER_TOKEN_SECRET_PATH_PREFIX}/{normalizedUserId}Shared token index path:
${OPENSHIFT_TOKEN_INDEX_PATH}
Token metadata is persisted to Postgres under:
key pattern:
${OPENSHIFT_TOKEN_METADATA_CONFIG_KEY_PREFIX}.{userId}
This lets each user independently rotate/revoke tokens without impacting other users.
Configuration Persistence Model
All runtime/user configuration is persisted in Postgres table ${APP_NAME}_config:
Primary key:
(user_id, key)Value type:
JSONB
config_get and config_set expose this persistence model through MCP.
Environment Variables
Core:
APP_NAMEMCP_SERVER_NAMEMCP_SERVER_VERSIONMCP_ALLOW_SENSITIVE_OUTPUTMCP_ADMIN_AUTH_KEYMCP_CONFIG_DEFAULT_USER_IDMCP_TRANSPORT_MODE
OpenShift:
OPENSHIFT_API_BASE_URLOPENSHIFT_TIMEOUT_MSOPENSHIFT_AUTH_MODE(none,bearer)OPENSHIFT_USER_TOKEN_SECRET_PATH_PREFIXOPENSHIFT_TOKEN_INDEX_PATHOPENSHIFT_TOKEN_METADATA_CONFIG_KEY_PREFIX
Postgres:
POSTGRES_HOSTPOSTGRES_PORTPOSTGRES_DBPOSTGRES_USERPOSTGRES_PASSWORD
Vault:
VAULT_ADDRVAULT_TOKENVAULT_AGENT_ENABLEDVAULT_AGENT_AUTH_MODEVAULT_AGENT_TOKEN_FILE_PATHVAULT_AGENT_LISTENER_ENABLEDVAULT_AGENT_LISTENER_ADDRVAULT_KV_MOUNTVAULT_WRITE_RETRY_ATTEMPTSVAULT_WRITE_RETRY_BASE_DELAY_MSVAULT_WRITE_RETRY_MAX_DELAY_MS
HTTP transport:
MCP_HTTP_HOSTMCP_HTTP_PORTMCP_HTTP_PATHMCP_HTTP_HEALTH_PATHMCP_HTTP_AUTH_MODEMCP_HTTP_AUTH_TOKENSMCP_HTTP_TRUST_PROXYMCP_HTTP_ALLOWED_ORIGINSMCP_HTTP_ALLOWED_IPSMCP_HTTP_MAX_BODY_BYTESMCP_HTTP_RATE_LIMIT_WINDOW_MSMCP_HTTP_RATE_LIMIT_MAX_REQUESTS
Use .env.example as the baseline.
Admin Key Bootstrap And Rotation
Set
MCP_ADMIN_AUTH_KEYfor the initial deployment.Call
mcp_admin_auth_status; this imports the hashed bootstrap verifier into Vault.Call
mcp_admin_auth_verifywithauthorizationKeyto confirm access.Call
mcp_admin_auth_rotatewith the currentauthorizationKeyandnewAuthorizationKey.Update the calling client's key. The previous key no longer authorizes mutations.
If Vault cannot be read, admin verification fails closed rather than falling back to process-only authorization.
Local Development
Install dependencies.
Copy
.env.exampleto.envand set OpenShift + Vault + Postgres values.Start local infra:
docker compose up -d
Start MCP:
stdio:
npm run start:stdioHTTP:
npm run start:http
Run tests:
npm test
External Services Mode
Use this when Vault and Postgres are managed externally.
Compose file:
docker-compose.external.ymlRequired external settings include:
POSTGRES_HOSTPOSTGRES_PORTPOSTGRES_DBPOSTGRES_USERPOSTGRES_PASSWORDVAULT_ADDRVAULT_TOKEN
The app-only compose path keeps this repo focused on MCP runtime while connecting to external Vault and Postgres services.
MCP Registration Example (stdio)
{
"mcpServers": {
"openshift-mcp": {
"command": "npm",
"args": ["run", "start:stdio"],
"cwd": "/Users/lesterjohn/Documents/GitHub/openshift-mcp"
}
}
}Maintenance
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/LesterAJohn/openshift-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server