mcp/kubernetes

Verified Publisher

By mcp

Updated 2 months ago

Connect to a Kubernetes cluster and manage it

Image
Machine learning & AI
17

50K+

mcp/kubernetes repository overview

Kubernetes MCP Server

Connect to a Kubernetes cluster and manage it.

What is an MCP Server?

MCP Info

Image Building Info

AttributeDetails
Dockerfilehttps://github.com/Flux159/mcp-server-kubernetes/blob/25c01dd171ecc07126cb95ccadca2e0ccf56bafb/Dockerfile
Commit25c01dd171ecc07126cb95ccadca2e0ccf56bafb
Docker Image built byDocker Inc.
Docker Scout Health ScoreDocker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/kubernetes --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceMIT License

Available Tools (22)

Tools provided by this ServerShort Description
cleanupCleanup all managed resources
exec_in_podExecute a command in a Kubernetes pod or container and return the output
explain_resourceGet documentation for a Kubernetes resource or field
install_helm_chartInstall a Helm chart with support for both standard and template-based installation
kubectl_applyApply a Kubernetes YAML manifest from a string or file
kubectl_contextManage Kubernetes contexts - list, get, or set the current context
kubectl_createCreate Kubernetes resources using various methods (from file or using subcommands)
kubectl_deleteDelete Kubernetes resources by resource type, name, labels, or from a manifest file
kubectl_describeDescribe Kubernetes resources by resource type, name, and optionally namespace
kubectl_genericExecute any kubectl command with the provided arguments and flags
kubectl_getGet or list Kubernetes resources by resource type, name, and optionally namespace
kubectl_logsGet logs from Kubernetes resources like pods, deployments, or jobs
kubectl_patchUpdate field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch
kubectl_rolloutManage the rollout of a resource (e.g., deployment, daemonset, statefulset)
kubectl_scaleScale a Kubernetes deployment
list_api_resourcesList the API resources available in the cluster
node_managementManage Kubernetes nodes with cordon, drain, and uncordon operations
pingVerify that the counterpart is still responsive and the connection is alive.
port_forwardForward a local port to a port on a Kubernetes resource
stop_port_forwardStop a port-forward process
uninstall_helm_chartUninstall a Helm chart release
upgrade_helm_chartUpgrade an existing Helm chart release

Tools Details

Tool: cleanup

Cleanup all managed resources

Tool: exec_in_pod

Execute a command in a Kubernetes pod or container and return the output

ParametersTypeDescription
commandstringCommand to execute in the pod (string or array of args)
namestringName of the pod to execute the command in
containerstring optionalContainer name (required when pod has multiple containers)
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
namespacestring optionalKubernetes namespace
shellstring optionalShell to use for command execution (e.g. '/bin/sh', '/bin/bash'). If not provided, will use command as-is.
timeoutnumber optionalTimeout for command - 60000 milliseconds if not specified

Tool: explain_resource

Get documentation for a Kubernetes resource or field

ParametersTypeDescription
resourcestringResource name or field path (e.g. 'pods' or 'pods.spec.containers')
apiVersionstring optionalAPI version to use (e.g. 'apps/v1')
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
outputstring optionalOutput format (plaintext or plaintext-openapiv2)
recursiveboolean optionalPrint the fields of fields recursively

This tool is read-only. It does not modify its environment.


Tool: install_helm_chart

Install a Helm chart with support for both standard and template-based installation

ParametersTypeDescription
chartstringChart name (e.g., 'nginx') or path to chart directory
namestringName of the Helm release
namespacestringKubernetes namespace
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
createNamespaceboolean optionalCreate namespace if it doesn't exist
repostring optionalHelm repository URL (optional if using local chart path)
useTemplateboolean optionalUse helm template + kubectl apply instead of helm install (bypasses auth issues)
valuesobject optionalCustom values to override chart defaults
valuesFilestring optionalPath to values file (alternative to values object)

Tool: kubectl_apply

Apply a Kubernetes YAML manifest from a string or file

ParametersTypeDescription
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
dryRunboolean optionalIf true, only validate the resource, don't actually execute the operation
filenamestring optionalPath to a YAML file to apply (optional - use either manifest or filename)
forceboolean optionalIf true, immediately remove resources from API and bypass graceful deletion
manifeststring optionalYAML manifest to apply
namespacestring optionalKubernetes namespace

Tool: kubectl_context

Manage Kubernetes contexts - list, get, or set the current context

ParametersTypeDescription
operationstringOperation to perform: list contexts, get current context, or set current context
detailedboolean optionalInclude detailed information about the context
namestring optionalName of the context to set as current (required for set operation)
outputstring optionalOutput format
showCurrentboolean optionalWhen listing contexts, highlight which one is currently active

This tool is read-only. It does not modify its environment.


Tool: kubectl_create

Create Kubernetes resources using various methods (from file or using subcommands)

ParametersTypeDescription
annotationsarray optionalAnnotations to apply to the resource (e.g. ["key1=value1", "key2=value2"])
commandarray optionalCommand to run in the container
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
dryRunboolean optionalIf true, only validate the resource, don't actually execute the operation
filenamestring optionalPath to a YAML file to create resources from
fromFilearray optionalPath to file for creating configmap (e.g. ["key1=/path/to/file1", "key2=/path/to/file2"])
fromLiteralarray optionalKey-value pair for creating configmap (e.g. ["key1=value1", "key2=value2"])
imagestring optionalImage to use for the containers in the deployment
labelsarray optionalLabels to apply to the resource (e.g. ["key1=value1", "key2=value2"])
manifeststring optionalYAML manifest to create resources from
namestring optionalName of the resource to create
namespacestring optionalKubernetes namespace
outputstring optionalOutput format. One of: json
portnumber optionalPort that the container exposes
replicasnumber optionalNumber of replicas to create for the deployment
resourceTypestring optionalType of resource to create (namespace, configmap, deployment, service, etc.)
schedulestring optionalCron schedule expression for the CronJob (e.g. "*/5 * * * *")
secretTypestring optionalType of secret to create (generic, docker-registry, tls)
serviceTypestring optionalType of service to create (clusterip, nodeport, loadbalancer, externalname)
suspendboolean optionalWhether to suspend the CronJob
tcpPortarray optionalPort pairs for tcp service (e.g. ["80:8080", "443:8443"])
validateboolean optionalIf true, validate resource schema against server schema

Tool: kubectl_delete

Delete Kubernetes resources by resource type, name, labels, or from a manifest file

ParametersTypeDescription
namestringName of the resource to delete
namespacestringKubernetes namespace
resourceTypestringType of resource to delete (e.g., pods, deployments, services, etc.)
allNamespacesboolean optionalIf true, delete resources across all namespaces
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
filenamestring optionalPath to a YAML file to delete resources from (optional)
forceboolean optionalIf true, immediately remove resources from API and bypass graceful deletion
gracePeriodSecondsnumber optionalPeriod of time in seconds given to the resource to terminate gracefully
labelSelectorstring optionalDelete resources matching this label selector (e.g. 'app=nginx')
manifeststring optionalYAML manifest defining resources to delete (optional)

This tool may perform destructive updates.


Tool: kubectl_describe

Describe Kubernetes resources by resource type, name, and optionally namespace

ParametersTypeDescription
namestringName of the resource to describe
resourceTypestringType of resource to describe (e.g., pods, deployments, services, etc.)
allNamespacesboolean optionalIf true, describe resources across all namespaces
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
namespacestring optionalKubernetes namespace

This tool is read-only. It does not modify its environment.


Tool: kubectl_generic

Execute any kubectl command with the provided arguments and flags

ParametersTypeDescription
commandstringThe kubectl command to execute (e.g. patch, rollout, top)
argsarray optionalAdditional command arguments
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
flagsobject optionalCommand flags as key-value pairs
namestring optionalResource name
namespacestring optionalKubernetes namespace
outputFormatstring optionalOutput format (e.g. json, yaml, wide)
resourceTypestring optionalResource type (e.g. pod, deployment)
subCommandstring optionalSubcommand if applicable (e.g. 'history' for rollout)

This tool may perform destructive updates.


Tool: kubectl_get

Get or list Kubernetes resources by resource type, name, and optionally namespace

ParametersTypeDescription
namestringName of the resource (optional - if not provided, lists all resources of the specified type)
namespacestringKubernetes namespace
resourceTypestringType of resource to get (e.g., pods, deployments, services, configmaps, events, etc.)
allNamespacesboolean optionalIf true, list resources across all namespaces
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
fieldSelectorstring optionalFilter resources by field selector (e.g. 'metadata.name=my-pod')
labelSelectorstring optionalFilter resources by label selector (e.g. 'app=nginx')
outputstring optionalOutput format
sortBystring optionalSort events by a field (default: lastTimestamp). Only applicable for events.

This tool is read-only. It does not modify its environment.


Tool: kubectl_logs

Get logs from Kubernetes resources like pods, deployments, or jobs

ParametersTypeDescription
namestringName of the resource
namespacestringKubernetes namespace
resourceTypestringType of resource to get logs from
containerstring optionalContainer name (required when pod has multiple containers)
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
followboolean optionalFollow logs output (not recommended, may cause timeouts)
labelSelectorstring optionalFilter resources by label selector
previousboolean optionalInclude logs from previously terminated containers
sincestring optionalShow logs since relative time (e.g. '5s', '2m', '3h')
sinceTimestring optionalShow logs since absolute time (RFC3339)
tailnumber optionalNumber of lines to show from end of logs
timestampsboolean optionalInclude timestamps in logs

This tool is read-only. It does not modify its environment.


Tool: kubectl_patch

Update field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch

ParametersTypeDescription
namestringName of the resource to patch
resourceTypestringType of resource to patch (e.g., pods, deployments, services)
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
dryRunboolean optionalIf true, only validate the resource, don't actually execute the operation
namespacestring optionalKubernetes namespace
patchDataobject optionalPatch data as a JSON object
patchFilestring optionalPath to a file containing the patch data (alternative to patchData)
patchTypestring optionalType of patch to apply

Tool: kubectl_rollout

Manage the rollout of a resource (e.g., deployment, daemonset, statefulset)

ParametersTypeDescription
namestringName of the resource
namespacestringKubernetes namespace
resourceTypestringType of resource to manage rollout for
subCommandstringRollout subcommand to execute
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
revisionnumber optionalRevision to rollback to (for undo subcommand)
timeoutstring optionalThe length of time to wait before giving up (e.g., '30s', '1m', '2m30s')
toRevisionnumber optionalRevision to roll back to (for history subcommand)
watchboolean optionalWatch the rollout status in real-time until completion

Tool: kubectl_scale

Scale a Kubernetes deployment

ParametersTypeDescription
namestringName of the deployment to scale
replicasnumberNumber of replicas to scale to
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
namespacestring optionalKubernetes namespace
resourceTypestring optionalResource type to scale (deployment, replicaset, statefulset)

Tool: list_api_resources

List the API resources available in the cluster

ParametersTypeDescription
apiGroupstring optionalAPI group to filter by
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
namespacedboolean optionalIf true, only show namespaced resources
outputstring optionalOutput format (wide, name, or no-headers)
verbsarray optionalList of verbs to filter by

This tool is read-only. It does not modify its environment.


Tool: node_management

Manage Kubernetes nodes with cordon, drain, and uncordon operations

ParametersTypeDescription
operationstringNode operation to perform
confirmDrainboolean optionalExplicit confirmation to drain the node (required for drain operation)
deleteLocalDataboolean optionalDelete local data even if emptyDir volumes are used (for drain operation)
dryRunboolean optionalShow what would be done without actually doing it (for drain operation)
forceboolean optionalForce the operation even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (for drain operation)
gracePeriodnumber optionalPeriod of time in seconds given to each pod to terminate gracefully (for drain operation). If set to -1, uses the kubectl default grace period.
ignoreDaemonsetsboolean optionalIgnore DaemonSet-managed pods (for drain operation)
nodeNamestring optionalName of the node to operate on (required for cordon, drain, uncordon)
timeoutstring optionalThe length of time to wait before giving up (for drain operation, e.g., '5m', '1h')

This tool may perform destructive updates.


Tool: ping

Verify that the counterpart is still responsive and the connection is alive.

Tool: port_forward

Forward a local port to a port on a Kubernetes resource

ParametersTypeDescription
localPortnumber
resourceNamestring
resourceTypestring
targetPortnumber
namespacestring optional

Tool: stop_port_forward

Stop a port-forward process

ParametersTypeDescription
idstring

Tool: uninstall_helm_chart

Uninstall a Helm chart release

ParametersTypeDescription
namestringName of the Helm release to uninstall
namespacestringKubernetes namespace
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)

This tool may perform destructive updates.


Tool: upgrade_helm_chart

Upgrade an existing Helm chart release

ParametersTypeDescription
chartstringChart name or path to chart directory
namestringName of the Helm release to upgrade
namespacestringKubernetes namespace
contextstring optionalKubeconfig Context to use for the command (optional - defaults to null)
repostring optionalHelm repository URL (optional if using local chart path)
valuesobject optionalCustom values to override chart defaults
valuesFilestring optionalPath to values file (alternative to values object)

Use this MCP Server

{
  "mcpServers": {
    "kubernetes": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/local-directory:/local-directory",
        "mcp/kubernetes"
      ]
    }
  }
}

Why is it safer to run MCP Servers with Docker?

Install from MCP:Hub

Tag summary

Content type

Image

Digest

sha256:c1c4bf650

Size

585.1 MB

Last updated

2 months ago

Requires Docker Desktop 4.37.1 or later.

This week's pulls

Pulls:

1,178

Last week