Kubernetes

Kubernetes

Connect to a Kubernetes cluster and manage it.

10K+

14

22 Tools

Signed
Built by Docker
Add to Docker Desktop

Version 4.43 or later needs to be installed to add the server automatically

About

Kubernetes MCP Server

Connect to a Kubernetes cluster and manage it.

What is an MCP Server?

Characteristics

AttributeDetails
Docker Imagemcp/kubernetes
AuthorFlux159
Repositoryhttps://github.com/Flux159/mcp-server-kubernetes
Dockerfilehttps://github.com/Flux159/mcp-server-kubernetes/blob/main/Dockerfile
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
containerstringoptionalContainer name (required when pod has multiple containers)
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
namespacestringoptionalKubernetes namespace
shellstringoptionalShell to use for command execution (e.g. '/bin/sh', '/bin/bash'). If not provided, will use command as-is.
timeoutnumberoptionalTimeout 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')
apiVersionstringoptionalAPI version to use (e.g. 'apps/v1')
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
outputstringoptionalOutput format (plaintext or plaintext-openapiv2)
recursivebooleanoptionalPrint the fields of fields recursively

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
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
createNamespacebooleanoptionalCreate namespace if it doesn't exist
repostringoptionalHelm repository URL (optional if using local chart path)
useTemplatebooleanoptionalUse helm template + kubectl apply instead of helm install (bypasses auth issues)
valuesobjectoptionalCustom values to override chart defaults
valuesFilestringoptionalPath to values file (alternative to values object)

Tool: kubectl_apply

Apply a Kubernetes YAML manifest from a string or file

ParametersTypeDescription
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
dryRunbooleanoptionalIf true, only validate the resource, don't actually execute the operation
filenamestringoptionalPath to a YAML file to apply (optional - use either manifest or filename)
forcebooleanoptionalIf true, immediately remove resources from API and bypass graceful deletion
manifeststringoptionalYAML manifest to apply
namespacestringoptionalKubernetes 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
detailedbooleanoptionalInclude detailed information about the context
namestringoptionalName of the context to set as current (required for set operation)
outputstringoptionalOutput format
showCurrentbooleanoptionalWhen listing contexts, highlight which one is currently active

Tool: kubectl_create

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

ParametersTypeDescription
annotationsarrayoptionalAnnotations to apply to the resource (e.g. ["key1=value1", "key2=value2"])
commandarrayoptionalCommand to run in the container
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
dryRunbooleanoptionalIf true, only validate the resource, don't actually execute the operation
filenamestringoptionalPath to a YAML file to create resources from
fromFilearrayoptionalPath to file for creating configmap (e.g. ["key1=/path/to/file1", "key2=/path/to/file2"])
fromLiteralarrayoptionalKey-value pair for creating configmap (e.g. ["key1=value1", "key2=value2"])
imagestringoptionalImage to use for the containers in the deployment
labelsarrayoptionalLabels to apply to the resource (e.g. ["key1=value1", "key2=value2"])
manifeststringoptionalYAML manifest to create resources from
namestringoptionalName of the resource to create
namespacestringoptionalKubernetes namespace
outputstringoptionalOutput format. One of: json
portnumberoptionalPort that the container exposes
replicasnumberoptionalNumber of replicas to create for the deployment
resourceTypestringoptionalType of resource to create (namespace, configmap, deployment, service, etc.)
schedulestringoptionalCron schedule expression for the CronJob (e.g. "*/5 * * * *")
secretTypestringoptionalType of secret to create (generic, docker-registry, tls)
serviceTypestringoptionalType of service to create (clusterip, nodeport, loadbalancer, externalname)
suspendbooleanoptionalWhether to suspend the CronJob
tcpPortarrayoptionalPort pairs for tcp service (e.g. ["80:8080", "443:8443"])
validatebooleanoptionalIf 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.)
allNamespacesbooleanoptionalIf true, delete resources across all namespaces
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
filenamestringoptionalPath to a YAML file to delete resources from (optional)
forcebooleanoptionalIf true, immediately remove resources from API and bypass graceful deletion
gracePeriodSecondsnumberoptionalPeriod of time in seconds given to the resource to terminate gracefully
labelSelectorstringoptionalDelete resources matching this label selector (e.g. 'app=nginx')
manifeststringoptionalYAML manifest defining resources to delete (optional)

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.)
allNamespacesbooleanoptionalIf true, describe resources across all namespaces
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
namespacestringoptionalKubernetes namespace

Tool: kubectl_generic

Execute any kubectl command with the provided arguments and flags

ParametersTypeDescription
commandstringThe kubectl command to execute (e.g. patch, rollout, top)
argsarrayoptionalAdditional command arguments
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
flagsobjectoptionalCommand flags as key-value pairs
namestringoptionalResource name
namespacestringoptionalKubernetes namespace
outputFormatstringoptionalOutput format (e.g. json, yaml, wide)
resourceTypestringoptionalResource type (e.g. pod, deployment)
subCommandstringoptionalSubcommand if applicable (e.g. 'history' for rollout)

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.)
allNamespacesbooleanoptionalIf true, list resources across all namespaces
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
fieldSelectorstringoptionalFilter resources by field selector (e.g. 'metadata.name=my-pod')
labelSelectorstringoptionalFilter resources by label selector (e.g. 'app=nginx')
outputstringoptionalOutput format
sortBystringoptionalSort events by a field (default: lastTimestamp). Only applicable for events.

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
containerstringoptionalContainer name (required when pod has multiple containers)
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
followbooleanoptionalFollow logs output (not recommended, may cause timeouts)
labelSelectorstringoptionalFilter resources by label selector
previousbooleanoptionalInclude logs from previously terminated containers
sincestringoptionalShow logs since relative time (e.g. '5s', '2m', '3h')
sinceTimestringoptionalShow logs since absolute time (RFC3339)
tailnumberoptionalNumber of lines to show from end of logs
timestampsbooleanoptionalInclude timestamps in logs

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)
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
dryRunbooleanoptionalIf true, only validate the resource, don't actually execute the operation
namespacestringoptionalKubernetes namespace
patchDataobjectoptionalPatch data as a JSON object
patchFilestringoptionalPath to a file containing the patch data (alternative to patchData)
patchTypestringoptionalType 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
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
revisionnumberoptionalRevision to rollback to (for undo subcommand)
timeoutstringoptionalThe length of time to wait before giving up (e.g., '30s', '1m', '2m30s')
toRevisionnumberoptionalRevision to roll back to (for history subcommand)
watchbooleanoptionalWatch 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
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
namespacestringoptionalKubernetes namespace
resourceTypestringoptionalResource type to scale (deployment, replicaset, statefulset)

Tool: list_api_resources

List the API resources available in the cluster

ParametersTypeDescription
apiGroupstringoptionalAPI group to filter by
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
namespacedbooleanoptionalIf true, only show namespaced resources
outputstringoptionalOutput format (wide, name, or no-headers)
verbsarrayoptionalList of verbs to filter by

Tool: node_management

Manage Kubernetes nodes with cordon, drain, and uncordon operations

ParametersTypeDescription
operationstringNode operation to perform
confirmDrainbooleanoptionalExplicit confirmation to drain the node (required for drain operation)
deleteLocalDatabooleanoptionalDelete local data even if emptyDir volumes are used (for drain operation)
dryRunbooleanoptionalShow what would be done without actually doing it (for drain operation)
forcebooleanoptionalForce the operation even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (for drain operation)
gracePeriodnumberoptionalPeriod of time in seconds given to each pod to terminate gracefully (for drain operation). If set to -1, uses the kubectl default grace period.
ignoreDaemonsetsbooleanoptionalIgnore DaemonSet-managed pods (for drain operation)
nodeNamestringoptionalName of the node to operate on (required for cordon, drain, uncordon)
timeoutstringoptionalThe length of time to wait before giving up (for drain operation, e.g., '5m', '1h')

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
namespacestringoptional

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
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)

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
contextstringoptionalKubeconfig Context to use for the command (optional - defaults to null)
repostringoptionalHelm repository URL (optional if using local chart path)
valuesobjectoptionalCustom values to override chart defaults
valuesFilestringoptionalPath to values file (alternative to values object)

Use this MCP Server

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

Why is it safer to run MCP Servers with Docker?

Manual installation

You can install the MCP server using:

Installation for

Related servers