OpenShift MCP Server

v1.2.0
io.github.sanjaypsachdev/mcp-server-openshift Checked 11 hours ago Published 5 months ago

OpenShift/Kubernetes cluster management via the oc CLI for MCP clients

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

oc_get

Get OpenShift resources like pods, deploymentconfigs, routes, projects, etc.

ParameterTypeDescription
resourceType *stringType of resource to get (e.g., pods, deploymentconfigs, routes, projects, services)
allNamespacesbooleanList resources across all namespaces
contextstringOpenShift context to use (optional)
fieldSelectorstringFilter resources by field selector
labelSelectorstringFilter resources by label selector (e.g., app=nginx)
namestringName of the resource (optional - if not provided, lists all resources)
namespacestringOpenShift namespace/project
outputstringOutput format

oc_create

Create OpenShift resources like projects, deploymentconfigs, routes, etc.

ParameterTypeDescription
contextstringOpenShift context to use (optional)
descriptionstringDescription for project
displayNamestringDisplay name for project
dryRunbooleanValidate only, don't create
filenamestringPath to YAML file to create resources from
hostnamestringHostname for route
imagestringContainer image for deploymentconfig
manifeststringYAML manifest to create resources from
namestringName of the resource
namespacestringOpenShift namespace/project
replicasnumberNumber of replicas
resourceTypestringType of resource to create (project, deploymentconfig, route, service, etc.)
servicestringService name for route

oc_install_operator

Install an Operator on the OpenShift/Kubernetes cluster using OLM, Helm, or direct manifests

ParameterTypeDescription
operatorName *stringName of the operator to install (e.g., "prometheus-operator", "cert-manager")
channelstringUpdate channel for the operator (stable, alpha, beta, etc.)
contextstringOpenShift context to use (optional)
createNamespacebooleanCreate namespace if it does not exist
helmRepostringHelm repository URL (required if source is helm)
installPlanApprovalstringInstall plan approval strategy for OLM
manifestUrlstringURL to operator manifest (required if source is manifest)
namespacestringTarget namespace for operator installation
sourcestringInstallation method: olm (Operator Lifecycle Manager), helm (Helm chart), or manifest (direct YAML)
versionstringVersion of the operator to install (if not specified, installs latest available)

oc_new_app

Create a new application from a GitHub repository using S2I build and expose it with an edge-terminated route

ParameterTypeDescription
gitRepo *stringGitHub repository URL for the source code
appNamestringName for the application (if not specified, derives from repo name)
builderImagestringBuilder image for S2I build (e.g., "nodejs:18-ubi8", "python:3.9-ubi8")
contextstringOpenShift context to use (optional)
contextDirstringContext directory within the Git repository
createNamespacebooleanCreate namespace if it does not exist
envarrayEnvironment variables in KEY=VALUE format
exposeRoutebooleanCreate an edge-terminated route to expose the application
gitRefstringGit reference (branch, tag, or commit) to build from (default: main/master)
labelsarrayLabels in KEY=VALUE format
namespacestringTarget namespace for the application
routeHostnamestringCustom hostname for the route (if not specified, uses default)
strategystringBuild strategy: source (S2I) or docker

oc_scale

Scale the number of pods in a deployment, deploymentconfig, replicaset, or statefulset to the specified number of replicas

ParameterTypeDescription
name *stringName of the resource to scale
replicas *numberNumber of replicas to scale to
contextstringOpenShift context to use (optional)
namespacestringOpenShift namespace/project
resourceTypestringResource type to scale (deployment, deploymentconfig, replicaset, statefulset)

oc_describe

Describe any OpenShift resource and share the output in various formats including human-readable summary

ParameterTypeDescription
name *stringName of the resource to describe
resourceType *stringType of resource to describe (pod, deployment, service, route, etc.)
contextstringOpenShift context to use (optional)
namespacestringOpenShift namespace/project
outputstringOutput format: text (default oc describe), yaml, json, or human-readable (concise summary)

oc_apply

Apply YAML manifests to OpenShift cluster with comprehensive error handling and validation for all scenarios

ParameterTypeDescription
cascadestringDeletion cascade strategy
contextstringOpenShift context to use (optional)
dryRunbooleanValidate only, don't apply (client or server)
fieldManagerstringField manager name for server-side apply
filenamestringPath to YAML file to apply
forcebooleanForce apply, ignore conflicts
gracePeriodnumberGrace period for resource deletion (seconds)
kustomizebooleanApply kustomization directory
manifeststringYAML manifest content to apply
namespacestringOpenShift namespace/project
overwritebooleanOverwrite existing resources
prunebooleanPrune resources not in current configuration
pruneWhitelistarrayResource types to include in pruning
recursivebooleanProcess directory recursively
selectorstringLabel selector for pruning
serverSideApplybooleanUse server-side apply
timeoutstringTimeout for wait operation (e.g., "60s", "5m")
urlstringURL to YAML manifest to apply
validatebooleanValidate resources before applying
waitbooleanWait for resources to be ready

oc_delete

Delete OpenShift resources with comprehensive safety checks, validation, and error handling

ParameterTypeDescription
allbooleanDelete all resources of the specified type
allNamespacesbooleanDelete resources across all namespaces
cascadestringDeletion cascade strategy
confirmbooleanRequire explicit confirmation for destructive operations
contextstringOpenShift context to use (optional)
dryRunbooleanShow what would be deleted without actually deleting
fieldSelectorstringDelete resources matching field selector
filenamestringPath to YAML file to delete resources from
forcebooleanForce deletion (bypass finalizers)
gracePeriodSecondsnumberGrace period for deletion in seconds
ignore404booleanIgnore 404 errors if resource does not exist
labelSelectorstringDelete resources matching label selector
manifeststringYAML manifest defining resources to delete
namestringName of the resource to delete
namespacestringOpenShift namespace/project
recursivebooleanProcess directory recursively
resourceTypestringType of resource to delete (required if not using manifest/filename)
timeoutstringTimeout for deletion operation (e.g., "60s", "5m")
urlstringURL to YAML manifest defining resources to delete
waitbooleanWait for deletion to complete

oc_logs

Get logs from OpenShift resources like pods, deployments, builds, etc. with advanced filtering and streaming options

ParameterTypeDescription
name *stringName of the resource
allContainersbooleanGet logs from all containers in the pod
containerstringContainer name (for pods with multiple containers)
contextstringOpenShift context to use (optional)
followbooleanFollow logs output (stream live logs)
limitBytesnumberMaximum bytes to return
maxLogRequestsnumberMaximum number of concurrent log requests when using selectors
namespacestringOpenShift namespace/project
previousbooleanShow logs from previous terminated container
resourceTypestringType of resource to get logs from
selectorstringLabel selector to filter pods
sincestringShow logs since relative time (e.g. 5s, 2m, 3h) or absolute time
sinceTimestringShow logs since absolute timestamp (RFC3339)
tailnumberNumber of lines to show from end of logs (-1 for all)
timestampsbooleanInclude timestamps in log output

oc_patch

Patch OpenShift resources with strategic merge, JSON merge, or JSON patch operations

ParameterTypeDescription
name *stringName of the resource to patch
patch *stringPatch content as JSON string or YAML. For strategic merge patch (default), provide the fields to update. For JSON patch, use RFC 6902 format.
resourceType *stringType of resource to patch (pod, deployment, service, route, configmap, secret, etc.)
contextstringOpenShift context to use (optional)
dryRunbooleanPerform a dry run without making actual changes
fieldManagerstringField manager name for server-side apply tracking
forcebooleanForce the patch operation, ignoring conflicts
namespacestringNamespace/project for the resource (not required for cluster-scoped resources)
patchTypestringType of patch operation
recordHistorybooleanRecord the patch operation in the resource annotation for rollback purposes
subresourcestringSubresource to patch (e.g., status, scale)

oc_login

Securely log into an OpenShift cluster using username/password or token authentication

ParameterTypeDescription
authMethod *stringAuthentication method to use
server *stringOpenShift cluster server URL (e.g., https://api.cluster.example.com:6443)
certificateAuthoritystringPath to certificate authority file for TLS verification
contextstringContext name to save the login session (optional)
insecureSkipTlsVerifybooleanSkip TLS certificate verification (not recommended for production)
namespacestringDefault namespace to set after login
passwordstringPassword for password authentication (required if authMethod is password)
timeoutnumberLogin timeout in seconds
tokenstringOpenShift authentication token (required if authMethod is token)
usernamestringUsername for password authentication (required if authMethod is password)

oc_api_resources

List all available API resources in the OpenShift cluster with their details

ParameterTypeDescription
apiGroupstringFilter by specific API group (e.g., apps, extensions, networking.k8s.io)
categoriesbooleanGroup resources by categories (core, apps, networking, etc.)
contextstringOpenShift context to use (optional)
namespacedbooleanFilter by namespaced resources only
outputstringOutput format for the API resources list
verbsarrayFilter by supported verbs (e.g., ["get", "list", "create", "delete"])

oc_explain

Explain OpenShift/Kubernetes resource schemas, fields, and API documentation

ParameterTypeDescription
resource *stringResource type to explain (e.g., pod, deployment, service, route.route.openshift.io)
apiVersionstringSpecific API version to explain (e.g., apps/v1, route.openshift.io/v1)
contextstringOpenShift context to use (optional)
fieldstringSpecific field path to explain (e.g., spec.containers, metadata.labels)
outputstringOutput format for the explanation
recursivebooleanShow all fields recursively

oc_expose

Expose an OpenShift resource (service, deployment, etc.) with secure route endpoints supporting SSL/TLS termination

ParameterTypeDescription
name *stringName of the resource to expose
resourceType *stringResource type to expose (service, deploymentconfig, deployment)
annotationsarrayAnnotations to apply to the route in KEY=VALUE format
caCertificatestringPath to CA certificate file
certificatestringPath to TLS certificate file
contextstringOpenShift context to use (optional)
destinationCaCertificatestringPath to destination CA certificate file (for reencrypt)
dryRunbooleanShow what would be created without actually creating it
hostnamestringCustom hostname for the route
insecureEdgeTerminationPolicystringPolicy for insecure traffic: None (reject), Allow (allow), Redirect (redirect to secure)
keystringPath to TLS private key file
labelsarrayLabels to apply to the route in KEY=VALUE format
namespacestringOpenShift namespace/project
pathstringPath for the route (e.g., /api)
portstringTarget port to expose (port name or number)
routeNamestringName for the route (if not specified, derives from resource name)
routeTypestringType of secure route: edge (SSL termination at router), passthrough (SSL passthrough), reencrypt (SSL re-encryption)
tlsTerminationstringTLS termination type (deprecated, use routeType instead)
weightnumberWeight for this route (0-256)
wildcardPolicystringWildcard policy for the route