Connect to a Kubernetes cluster and manage it
100K+
Connect to a Kubernetes cluster and manage it.
| Attribute | Details |
|---|---|
| Docker Image | mcp/kubernetes |
| Author | Flux159 |
| Repository | https://github.com/Flux159/mcp-server-kubernetes |
| Attribute | Details |
|---|---|
| Dockerfile | https://github.com/Flux159/mcp-server-kubernetes/blob/662a19193fa79de1e4fa4f53faa25191c41481dc/Dockerfile |
| Commit | 662a19193fa79de1e4fa4f53faa25191c41481dc |
| Docker Image built by | Docker Inc. |
| Docker Scout Health Score | |
| Verify Signature | COSIGN_REPOSITORY=mcp/signatures cosign verify mcp/kubernetes --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub |
| Licence | MIT License |
| Tools provided by this Server | Short Description |
|---|---|
cleanup | Cleanup all managed resources |
exec_in_pod | Execute a command in a Kubernetes pod or container and return the output. |
explain_resource | Get documentation for a Kubernetes resource or field |
install_helm_chart | Install a Helm chart with support for both standard and template-based installation |
kubectl_apply | Apply a Kubernetes YAML manifest from a string or file |
kubectl_context | Manage Kubernetes contexts - list, get, or set the current context |
kubectl_create | Create Kubernetes resources using various methods (from file or using subcommands) |
kubectl_delete | Delete Kubernetes resources by resource type, name, labels, or from a manifest file |
kubectl_describe | Describe Kubernetes resources by resource type, name, and optionally namespace |
kubectl_generic | Execute any kubectl command with the provided arguments and flags |
kubectl_get | Get or list Kubernetes resources by resource type, name, and optionally namespace |
kubectl_logs | Get logs from Kubernetes resources like pods, deployments, or jobs |
kubectl_patch | Update field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch |
kubectl_reconnect | Reconnect to the Kubernetes API server by recreating all API clients. |
kubectl_rollout | Manage the rollout of a resource (e.g., deployment, daemonset, statefulset) |
kubectl_scale | Scale a Kubernetes deployment |
list_api_resources | List the API resources available in the cluster |
node_management | Manage Kubernetes nodes with cordon, drain, and uncordon operations |
ping | Verify that the counterpart is still responsive and the connection is alive. |
port_forward | Port Forward |
stop_port_forward | Stop Port Forward |
uninstall_helm_chart | Uninstall a Helm chart release |
upgrade_helm_chart | Upgrade an existing Helm chart release |
cleanupCleanup all managed resources
exec_in_podExecute 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.
| Parameters | Type | Description |
|---|---|---|
command | array | Command 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. |
name | string | Name of the pod to execute the command in |
container | string optional | Container name (required when pod has multiple containers) |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
namespace | string optional | Kubernetes namespace |
timeout | number optional | Timeout for command - 60000 milliseconds if not specified |
This tool may perform destructive updates.
explain_resourceGet documentation for a Kubernetes resource or field
| Parameters | Type | Description |
|---|---|---|
resource | string | Resource name or field path (e.g. 'pods' or 'pods.spec.containers') |
apiVersion | string optional | API version to use (e.g. 'apps/v1') |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
output | string optional | Output format (plaintext or plaintext-openapiv2) |
recursive | boolean optional | Print the fields of fields recursively |
This tool is read-only. It does not modify its environment.
install_helm_chartInstall a Helm chart with support for both standard and template-based installation
| Parameters | Type | Description |
|---|---|---|
chart | string | Chart name (e.g., 'nginx') or path to chart directory |
name | string | Name of the Helm release |
namespace | string | Kubernetes namespace |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
createNamespace | boolean optional | Create namespace if it doesn't exist |
repo | string optional | Helm repository URL (optional if using local chart path) |
useTemplate | boolean optional | Use helm template + kubectl apply instead of helm install (bypasses auth issues) |
values | object optional | Custom values to override chart defaults |
valuesFile | string optional | Path to values file (alternative to values object) |
This tool may perform destructive updates.
kubectl_applyApply a Kubernetes YAML manifest from a string or file
| Parameters | Type | Description |
|---|---|---|
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
dryRun | boolean optional | If true, only validate the resource, don't actually execute the operation |
filename | string optional | Path to a YAML file to apply (optional - use either manifest or filename) |
force | boolean optional | If true, immediately remove resources from API and bypass graceful deletion |
manifest | string optional | YAML manifest to apply |
namespace | string optional | Kubernetes namespace |
This tool may perform destructive updates.
kubectl_contextManage Kubernetes contexts - list, get, or set the current context
| Parameters | Type | Description |
|---|---|---|
operation | string | Operation to perform: list contexts, get current context, or set current context |
detailed | boolean optional | Include detailed information about the context |
name | string optional | Name of the context to set as current (required for set operation) |
output | string optional | Output format |
showCurrent | boolean optional | When listing contexts, highlight which one is currently active |
This tool is read-only. It does not modify its environment.
kubectl_createCreate Kubernetes resources using various methods (from file or using subcommands)
| Parameters | Type | Description |
|---|---|---|
annotations | array optional | Annotations to apply to the resource (e.g. ["key1=value1", "key2=value2"]) |
command | array optional | Command to run in the container |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
dryRun | boolean optional | If true, only validate the resource, don't actually execute the operation |
filename | string optional | Path to a YAML file to create resources from |
fromFile | array optional | Path to file for creating configmap (e.g. ["key1=/path/to/file1", "key2=/path/to/file2"]) |
fromLiteral | array optional | Key-value pair for creating configmap (e.g. ["key1=value1", "key2=value2"]) |
image | string optional | Image to use for the containers in the deployment |
labels | array optional | Labels to apply to the resource (e.g. ["key1=value1", "key2=value2"]) |
manifest | string optional | YAML manifest to create resources from |
name | string optional | Name of the resource to create |
namespace | string optional | Kubernetes namespace |
output | string optional | Output format. One of: json |
port | number optional | Port that the container exposes |
replicas | number optional | Number of replicas to create for the deployment |
resourceType | string optional | Type of resource to create (namespace, configmap, deployment, service, etc.) |
schedule | string optional | Cron schedule expression for the CronJob (e.g. "*/5 * * * *") |
secretType | string optional | Type of secret to create (generic, docker-registry, tls) |
serviceType | string optional | Type of service to create (clusterip, nodeport, loadbalancer, externalname) |
suspend | boolean optional | Whether to suspend the CronJob |
tcpPort | array optional | Port pairs for tcp service (e.g. ["80:8080", "443:8443"]) |
validate | boolean optional | If true, validate resource schema against server schema |
kubectl_deleteDelete Kubernetes resources by resource type, name, labels, or from a manifest file
| Parameters | Type | Description |
|---|---|---|
allNamespaces | boolean optional | If true, delete resources across all namespaces |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
filename | string optional | Path to a YAML file to delete resources from (optional) |
force | boolean optional | If true, immediately remove resources from API and bypass graceful deletion |
gracePeriodSeconds | number optional | Period of time in seconds given to the resource to terminate gracefully |
labelSelector | string optional | Delete resources matching this label selector (e.g. 'app=nginx') |
manifest | string optional | YAML manifest defining resources to delete (optional) |
name | string optional | Name of the resource to delete |
namespace | string optional | Kubernetes namespace |
resourceType | string optional | Type of resource to delete (e.g., pods, deployments, services, etc.) |
This tool may perform destructive updates.
kubectl_describeDescribe Kubernetes resources by resource type, name, and optionally namespace
| Parameters | Type | Description |
|---|---|---|
name | string | Name of the resource to describe |
resourceType | string | Type of resource to describe (e.g., pods, deployments, services, etc.) |
allNamespaces | boolean optional | If true, describe resources across all namespaces |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
namespace | string optional | Kubernetes namespace |
This tool is read-only. It does not modify its environment.
kubectl_genericExecute any kubectl command with the provided arguments and flags
| Parameters | Type | Description |
|---|---|---|
command | string | The kubectl command to execute (e.g. patch, rollout, top) |
allNamespaces | boolean optional | If true, run the command across all namespaces |
args | array optional | Additional command arguments |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
flags | object optional | Command flags as key-value pairs |
name | string optional | Resource name |
namespace | string optional | Kubernetes namespace |
outputFormat | string optional | Output format (e.g. json, yaml, wide) |
resourceType | string optional | Resource type (e.g. pod, deployment) |
subCommand | string optional | Subcommand if applicable (e.g. 'history' for rollout) |
This tool may perform destructive updates.
kubectl_getGet or list Kubernetes resources by resource type, name, and optionally namespace
| Parameters | Type | Description |
|---|---|---|
resourceType | string | Type of resource to get (e.g., pods, deployments, services, configmaps, events, etc.) |
allNamespaces | boolean optional | If true, list resources across all namespaces |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
fieldSelector | string optional | Filter resources by field selector (e.g. 'metadata.name=my-pod') |
labelSelector | string optional | Filter resources by label selector (e.g. 'app=nginx') |
name | string optional | Name of the resource (optional - if not provided, lists all resources of the specified type) |
namespace | string optional | Kubernetes namespace |
output | string optional | Output format |
sortBy | string optional | Sort events by a field (default: lastTimestamp). Only applicable for events. |
This tool is read-only. It does not modify its environment.
kubectl_logsGet logs from Kubernetes resources like pods, deployments, or jobs
| Parameters | Type | Description |
|---|---|---|
name | string | Name of the resource |
namespace | string | Kubernetes namespace |
resourceType | string | Type of resource to get logs from |
container | string optional | Container name (required when pod has multiple containers) |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
follow | boolean optional | Follow logs output (not recommended, may cause timeouts) |
labelSelector | string optional | Filter resources by label selector |
previous | boolean optional | Include logs from previously terminated containers |
since | string optional | Show logs since relative time (e.g. '5s', '2m', '3h') |
sinceTime | string optional | Show logs since absolute time (RFC3339) |
tail | number optional | Number of lines to show from end of logs |
timestamps | boolean optional | Include timestamps in logs |
This tool is read-only. It does not modify its environment.
kubectl_patchUpdate field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch
| Parameters | Type | Description |
|---|---|---|
name | string | Name of the resource to patch |
resourceType | string | Type of resource to patch (e.g., pods, deployments, services) |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
dryRun | boolean optional | If true, only validate the resource, don't actually execute the operation |
namespace | string optional | Kubernetes namespace |
patchData | object optional | Patch data as a JSON object |
patchFile | string optional | Path to a file containing the patch data (alternative to patchData) |
patchType | string optional | Type of patch to apply |
This tool may perform destructive updates.
kubectl_reconnectReconnect 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_rolloutManage the rollout of a resource (e.g., deployment, daemonset, statefulset)
| Parameters | Type | Description |
|---|---|---|
name | string | Name of the resource |
namespace | string | Kubernetes namespace |
resourceType | string | Type of resource to manage rollout for |
subCommand | string | Rollout subcommand to execute |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
revision | number optional | Revision to rollback to (for undo subcommand) |
timeout | string optional | The length of time to wait before giving up (e.g., '30s', '1m', '2m30s') |
toRevision | number optional | Revision to roll back to (for history subcommand) |
watch | boolean optional | Watch the rollout status in real-time until completion |
This tool may perform destructive updates.
kubectl_scaleScale a Kubernetes deployment
| Parameters | Type | Description |
|---|---|---|
name | string | Name of the deployment to scale |
replicas | number | Number of replicas to scale to |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
namespace | string optional | Kubernetes namespace |
resourceType | string optional | Resource type to scale (deployment, replicaset, statefulset) |
This tool may perform destructive updates.
list_api_resourcesList the API resources available in the cluster
| Parameters | Type | Description |
|---|---|---|
apiGroup | string optional | API group to filter by |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
namespaced | boolean optional | If true, only show namespaced resources |
output | string optional | Output format (wide, name, or no-headers) |
verbs | array optional | List of verbs to filter by |
This tool is read-only. It does not modify its environment.
node_managementManage Kubernetes nodes with cordon, drain, and uncordon operations
| Parameters | Type | Description |
|---|---|---|
operation | string | Node operation to perform |
confirmDrain | boolean optional | Explicit confirmation to drain the node (required for drain operation) |
deleteLocalData | boolean optional | Delete local data even if emptyDir volumes are used (for drain operation) |
dryRun | boolean optional | Show what would be done without actually doing it (for drain operation) |
force | boolean optional | Force the operation even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (for drain operation) |
gracePeriod | number optional | Period of time in seconds given to each pod to terminate gracefully (for drain operation). If set to -1, uses the kubectl default grace period. |
ignoreDaemonsets | boolean optional | Ignore DaemonSet-managed pods (for drain operation) |
nodeName | string optional | Name of the node to operate on (required for cordon, drain, uncordon) |
timeout | string optional | The length of time to wait before giving up (for drain operation, e.g., '5m', '1h') |
This tool may perform destructive updates.
pingVerify that the counterpart is still responsive and the connection is alive.
port_forwardForward a local port to a port on a Kubernetes resource
| Parameters | Type | Description |
|---|---|---|
localPort | number | |
resourceName | string | |
resourceType | string | |
targetPort | number | |
namespace | string optional |
stop_port_forwardStop a port-forward process
| Parameters | Type | Description |
|---|---|---|
id | string |
uninstall_helm_chartUninstall a Helm chart release
| Parameters | Type | Description |
|---|---|---|
name | string | Name of the Helm release to uninstall |
namespace | string | Kubernetes namespace |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
This tool may perform destructive updates.
upgrade_helm_chartUpgrade an existing Helm chart release
| Parameters | Type | Description |
|---|---|---|
chart | string | Chart name or path to chart directory |
name | string | Name of the Helm release to upgrade |
namespace | string | Kubernetes namespace |
context | string optional | Kubeconfig Context to use for the command (optional - defaults to null) |
repo | string optional | Helm repository URL (optional if using local chart path) |
values | object optional | Custom values to override chart defaults |
valuesFile | string optional | Path to values file (alternative to values object) |
This tool may perform destructive updates.
{
"mcpServers": {
"kubernetes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/local-directory:/local-directory",
"mcp/kubernetes"
]
}
}
}
Content type
Image
Digest
sha256:5ffbf7f0a…
Size
556.7 MB
Last updated
11 days ago
docker pull mcp/kubernetesPulls:
5,126
Last week