What it does
Kubernetes MCP gives an agent cluster-aware operations. It can inspect workloads and resources through the same kubeconfig context a developer already uses.
- Inspect cluster resources.
- Read workload and pod state.
- Work with Kubernetes manifests and namespaces.
- Pass resource names and namespaces explicitly.
- Keep kubeconfig and cluster credentials in the server environment.
Available functions
cleanup Cleanup all managed resources
exec_in_pod Execute a command in a Kubernetes pod or container and return the output. Command must be an array of strings where the first element is the executable and remaining elements are arguments. This executes directly without shell interpretation for security.
Arguments
-
commandrequired -
arrayCommand to execute as an array of strings (e.g. ["ls", "-la", "/app"]). First element is the executable, remaining are arguments. Shell operators like pipes, redirects, or command chaining are not supported - use explicit array format for security. -
container -
stringContainer name (required when pod has multiple containers) -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
namerequired -
stringName of the pod to execute the command in -
namespace -
stringKubernetes namespace Default:default -
timeout -
numberTimeout for command - 60000 milliseconds if not specified
explain_resource Get documentation for a Kubernetes resource or field
Arguments
-
apiVersion -
stringAPI version to use (e.g. 'apps/v1') -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
output -
stringOutput format (plaintext or plaintext-openapiv2) Allowed values: plaintext, plaintext-openapiv2 Default:plaintext -
recursive -
booleanPrint the fields of fields recursively Default:false -
resourcerequired -
stringResource name or field path (e.g. 'pods' or 'pods.spec.containers')
install_helm_chart Install a Helm chart with support for both standard and template-based installation
Arguments
-
chartrequired -
stringChart name (e.g., 'nginx') or path to chart directory -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
createNamespace -
booleanCreate namespace if it doesn't exist Default:true -
namerequired -
stringName of the Helm release -
namespacerequired -
stringKubernetes namespace Default:default -
repo -
stringHelm repository URL (optional if using local chart path) -
useTemplate -
booleanUse helm template + kubectl apply instead of helm install (bypasses auth issues) Default:false -
values -
objectCustom values to override chart defaults -
valuesFile -
stringPath to values file (alternative to values object). The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use 'values' to pass the values inline instead.
kubectl_apply Apply a Kubernetes YAML manifest from a string or file
Arguments
-
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
dryRun -
booleanIf true, only validate the resource, don't actually execute the operation Default:false -
filename -
stringPath to a YAML file to apply (optional - use either manifest or filename). The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use 'manifest' to pass the file's contents instead. -
force -
booleanIf true, immediately remove resources from API and bypass graceful deletion Default:false -
manifest -
stringYAML manifest to apply -
namespace -
stringKubernetes namespace Default:default
kubectl_context Manage Kubernetes contexts - list, get, or set the current context
Arguments
-
detailed -
booleanInclude detailed information about the context Default:false -
name -
stringName of the context to set as current (required for set operation) -
operationrequired -
stringOperation to perform: list contexts, get current context, or set current context Allowed values: list, get, set Default:list -
output -
stringOutput format Allowed values: json, yaml, name, custom Default:json -
showCurrent -
booleanWhen listing contexts, highlight which one is currently active Default:true
kubectl_create Create Kubernetes resources using various methods (from file or using subcommands)
Arguments
-
annotations -
arrayAnnotations to apply to the resource (e.g. ["key1=value1", "key2=value2"]) -
command -
arrayCommand to run in the container -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
dryRun -
booleanIf true, only validate the resource, don't actually execute the operation Default:false -
filename -
stringPath to a YAML file to create resources from. The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use 'manifest' to pass the file's contents instead. -
fromFile -
arrayPath to file for creating configmap/secret (e.g. ["key1=/path/to/file1", "key2=/path/to/file2"]). The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use "fromFileContent" to pass file contents directly instead. -
fromFileContent -
arrayInline file contents for creating a configmap/secret, provided by the client instead of a server-side path (e.g. [{"key": "app.conf", "content": "..."}]). Safe on all transports; use this instead of "fromFile" on remote (SSE/Streamable HTTP) servers. -
fromLiteral -
arrayKey-value pair for creating configmap (e.g. ["key1=value1", "key2=value2"]) -
image -
stringImage to use for the containers in the deployment -
labels -
arrayLabels to apply to the resource (e.g. ["key1=value1", "key2=value2"]) -
manifest -
stringYAML manifest to create resources from -
name -
stringName of the resource to create -
namespace -
stringKubernetes namespace Default:default -
output -
stringOutput format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file Allowed values: json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file Default:yaml -
port -
numberPort that the container exposes -
replicas -
numberNumber of replicas to create for the deployment Default:1 -
resourceType -
stringType of resource to create (namespace, configmap, deployment, service, etc.) -
schedule -
stringCron schedule expression for the CronJob (e.g. "*/5 * * * *") -
secretType -
stringType of secret to create (generic, docker-registry, tls) Allowed values: generic, docker-registry, tls -
serviceType -
stringType of service to create (clusterip, nodeport, loadbalancer, externalname) Allowed values: clusterip, nodeport, loadbalancer, externalname -
suspend -
booleanWhether to suspend the CronJob Default:false -
tcpPort -
arrayPort pairs for tcp service (e.g. ["80:8080", "443:8443"]) -
validate -
booleanIf true, validate resource schema against server schema Default:true
kubectl_delete Delete Kubernetes resources by resource type, name, labels, or from a manifest file
Arguments
-
allNamespaces -
booleanIf true, delete resources across all namespaces Default:false -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
filename -
stringPath to a YAML file to delete resources from (optional). The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use 'manifest' to pass the file's contents instead. -
force -
booleanIf true, immediately remove resources from API and bypass graceful deletion Default:false -
gracePeriodSeconds -
numberPeriod of time in seconds given to the resource to terminate gracefully -
labelSelector -
stringDelete resources matching this label selector (e.g. 'app=nginx') -
manifest -
stringYAML manifest defining resources to delete (optional) -
name -
stringName of the resource to delete -
namespace -
stringKubernetes namespace Default:default -
resourceType -
stringType of resource to delete (e.g., pods, deployments, services, etc.)
kubectl_describe Describe Kubernetes resources by resource type, name, and optionally namespace
Arguments
-
allNamespaces -
booleanIf true, describe resources across all namespaces Default:false -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
namerequired -
stringName of the resource to describe -
namespace -
stringKubernetes namespace Default:default -
resourceTyperequired -
stringType of resource to describe (e.g., pods, deployments, services, etc.)
kubectl_generic Execute any kubectl command with the provided arguments and flags
Arguments
-
allNamespaces -
booleanIf true, run the command across all namespaces Default:false -
args -
arrayAdditional command arguments -
commandrequired -
stringThe kubectl command to execute (e.g. patch, rollout, top) -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
flags -
objectCommand flags as key-value pairs -
name -
stringResource name -
namespace -
stringKubernetes namespace Default:default -
outputFormat -
stringOutput format (e.g. json, yaml, wide) Allowed values: json, yaml, wide, name, custom -
resourceType -
stringResource type (e.g. pod, deployment) -
subCommand -
stringSubcommand if applicable (e.g. 'history' for rollout)
kubectl_get Get or list Kubernetes resources by resource type, name, and optionally namespace
Arguments
-
allNamespaces -
booleanIf true, list resources across all namespaces Default:false -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
fieldSelector -
stringFilter resources by field selector (e.g. 'metadata.name=my-pod') -
labelSelector -
stringFilter resources by label selector (e.g. 'app=nginx') -
name -
stringName of the resource (optional - if not provided, lists all resources of the specified type) -
namespace -
stringKubernetes namespace Default:default -
output -
stringOutput format Allowed values: json, yaml, wide, name, custom Default:json -
resourceTyperequired -
stringType of resource to get (e.g., pods, deployments, services, configmaps, events, etc.) -
sortBy -
stringSort events by a field (default: lastTimestamp). Only applicable for events.
kubectl_logs Get logs from Kubernetes resources like pods, deployments, or jobs
Arguments
-
container -
stringContainer name (required when pod has multiple containers) -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
follow -
booleanFollow logs output (not recommended, may cause timeouts) Default:false -
labelSelector -
stringFilter resources by label selector -
namerequired -
stringName of the resource -
namespacerequired -
stringKubernetes namespace Default:default -
previous -
booleanInclude logs from previously terminated containers Default:false -
resourceTyperequired -
stringType of resource to get logs from Allowed values: pod, deployment, job, cronjob -
since -
stringShow logs since relative time (e.g. '5s', '2m', '3h') -
sinceTime -
stringShow logs since absolute time (RFC3339) -
tail -
numberNumber of lines to show from end of logs -
timestamps -
booleanInclude timestamps in logs Default:false
kubectl_patch Update field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch
Arguments
-
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
dryRun -
booleanIf true, only validate the resource, don't actually execute the operation Default:false -
namerequired -
stringName of the resource to patch -
namespace -
stringKubernetes namespace Default:default -
patchData -
objectPatch data as a JSON object -
patchFile -
stringPath to a file containing the patch data (alternative to patchData). The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use 'patchData' to pass the patch contents instead. -
patchType -
stringType of patch to apply Allowed values: strategic, merge, json Default:strategic -
resourceTyperequired -
stringType of resource to patch (e.g., pods, deployments, services)
kubectl_reconnect Reconnect to the Kubernetes API server by recreating all API clients. Use this after cluster upgrades (e.g., EKS control plane upgrades that rotate ENIs/IPs) to force fresh DNS resolution and new TCP connections.
kubectl_rollout Manage the rollout of a resource (e.g., deployment, daemonset, statefulset)
Arguments
-
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
namerequired -
stringName of the resource -
namespacerequired -
stringKubernetes namespace Default:default -
resourceTyperequired -
stringType of resource to manage rollout for Allowed values: deployment, daemonset, statefulset Default:deployment -
revision -
numberRevision to rollback to (for undo subcommand) -
subCommandrequired -
stringRollout subcommand to execute Allowed values: history, pause, restart, resume, status, undo Default:status -
timeout -
stringThe length of time to wait before giving up (e.g., '30s', '1m', '2m30s') -
toRevision -
numberRevision to roll back to (for history subcommand) -
watch -
booleanWatch the rollout status in real-time until completion Default:false
kubectl_scale Scale a Kubernetes deployment
Arguments
-
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
namerequired -
stringName of the deployment to scale -
namespace -
stringKubernetes namespace Default:default -
replicasrequired -
numberNumber of replicas to scale to -
resourceType -
stringResource type to scale (deployment, replicaset, statefulset) Default:deployment
list_api_resources List the API resources available in the cluster
Arguments
-
apiGroup -
stringAPI group to filter by -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
namespaced -
booleanIf true, only show namespaced resources -
output -
stringOutput format (wide, name, or no-headers) Allowed values: wide, name, no-headers Default:wide -
verbs -
arrayList of verbs to filter by
node_management Manage Kubernetes nodes with cordon, drain, and uncordon operations
Arguments
-
confirmDrain -
booleanExplicit confirmation to drain the node (required for drain operation) Default:false -
deleteLocalData -
booleanDelete local data even if emptyDir volumes are used (for drain operation) Default:false -
dryRun -
booleanShow what would be done without actually doing it (for drain operation) Default:false -
force -
booleanForce the operation even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (for drain operation) Default:false -
gracePeriod -
numberPeriod of time in seconds given to each pod to terminate gracefully (for drain operation). If set to -1, uses the kubectl default grace period. Default:-1 -
ignoreDaemonsets -
booleanIgnore DaemonSet-managed pods (for drain operation) Default:true -
nodeName -
stringName of the node to operate on (required for cordon, drain, uncordon) -
operationrequired -
stringNode operation to perform Allowed values: cordon, drain, uncordon -
timeout -
stringThe length of time to wait before giving up (for drain operation, e.g., '5m', '1h') Default:0
ping Verify that the counterpart is still responsive and the connection is alive.
port_forward Forward a local port to a port on a Kubernetes resource
Arguments
-
localPortrequired -
number -
namespace -
string -
resourceNamerequired -
string -
resourceTyperequired -
string -
targetPortrequired -
number
stop_port_forward Stop a port-forward process
Arguments
-
idrequired -
string
uninstall_helm_chart Uninstall a Helm chart release
Arguments
-
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
namerequired -
stringName of the Helm release to uninstall -
namespacerequired -
stringKubernetes namespace Default:default
upgrade_helm_chart Upgrade an existing Helm chart release
Arguments
-
chartrequired -
stringChart name or path to chart directory -
context -
stringKubeconfig Context to use for the command (optional - defaults to null) Default: -
namerequired -
stringName of the Helm release to upgrade -
namespacerequired -
stringKubernetes namespace Default:default -
repo -
stringHelm repository URL (optional if using local chart path) -
values -
objectCustom values to override chart defaults -
valuesFile -
stringPath to values file (alternative to values object). The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use 'values' to pass the values inline instead.
Resources
Kubernetes Deployments
k8s://default/deployments
List of deployments in the default namespace
Kubernetes Pods
k8s://default/pods
List of pods in the default namespace
Kubernetes Services
k8s://default/services
List of services in the default namespace
Kubernetes Namespaces
k8s://namespaces
List of all namespaces
Kubernetes Nodes
k8s://nodes
List of all nodes in the cluster
Prompts
k8s-diagnose
Diagnose Kubernetes Resources.
Arguments
-
keywordrequired - A keyword to search pod/node names.
-
namespace - Optional: Specify a namespace to narrow down the search.