Connect to a Kubernetes cluster and manage it.
10K+
22 Tools
Version 4.43 or later needs to be installed to add the server automatically
Use cases
About
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/b1bbbc4385aef0ccd0af0204ad93c0565fe4d235/Dockerfile |
| 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_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 | Forward a local port to a port on a Kubernetes resource |
stop_port_forward | Stop a port-forward process |
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
| Parameters | Type | Description |
|---|---|---|
command | string | Command to execute in the pod (string or array of args) |
name | string | Name of the pod to execute the command in |
container | stringoptional | Container name (required when pod has multiple containers) |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
namespace | stringoptional | Kubernetes namespace |
shell | stringoptional | Shell to use for command execution (e.g. '/bin/sh', '/bin/bash'). If not provided, will use command as-is. |
timeout | numberoptional | Timeout for command - 60000 milliseconds if not specified |
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 | stringoptional | API version to use (e.g. 'apps/v1') |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
output | stringoptional | Output format (plaintext or plaintext-openapiv2) |
recursive | booleanoptional | 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 | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
createNamespace | booleanoptional | Create namespace if it doesn't exist |
repo | stringoptional | Helm repository URL (optional if using local chart path) |
useTemplate | booleanoptional | Use helm template + kubectl apply instead of helm install (bypasses auth issues) |
values | objectoptional | Custom values to override chart defaults |
valuesFile | stringoptional | Path to values file (alternative to values object) |
kubectl_applyApply a Kubernetes YAML manifest from a string or file
| Parameters | Type | Description |
|---|---|---|
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
dryRun | booleanoptional | If true, only validate the resource, don't actually execute the operation |
filename | stringoptional | Path to a YAML file to apply (optional - use either manifest or filename) |
force | booleanoptional | If true, immediately remove resources from API and bypass graceful deletion |
manifest | stringoptional | YAML manifest to apply |
namespace | stringoptional | Kubernetes namespace |
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 | booleanoptional | Include detailed information about the context |
name | stringoptional | Name of the context to set as current (required for set operation) |
output | stringoptional | Output format |
showCurrent | booleanoptional | 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 | arrayoptional | Annotations to apply to the resource (e.g. ["key1=value1", "key2=value2"]) |
command | arrayoptional | Command to run in the container |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
dryRun | booleanoptional | If true, only validate the resource, don't actually execute the operation |
filename | stringoptional | Path to a YAML file to create resources from |
fromFile | arrayoptional | Path to file for creating configmap (e.g. ["key1=/path/to/file1", "key2=/path/to/file2"]) |
fromLiteral | arrayoptional | Key-value pair for creating configmap (e.g. ["key1=value1", "key2=value2"]) |
image | stringoptional | Image to use for the containers in the deployment |
labels | arrayoptional | Labels to apply to the resource (e.g. ["key1=value1", "key2=value2"]) |
manifest | stringoptional | YAML manifest to create resources from |
name | stringoptional | Name of the resource to create |
namespace | stringoptional | Kubernetes namespace |
output | stringoptional | Output format. One of: json |
port | numberoptional | Port that the container exposes |
replicas | numberoptional | Number of replicas to create for the deployment |
resourceType | stringoptional | Type of resource to create (namespace, configmap, deployment, service, etc.) |
schedule | stringoptional | Cron schedule expression for the CronJob (e.g. "*/5 * * * *") |
secretType | stringoptional | Type of secret to create (generic, docker-registry, tls) |
serviceType | stringoptional | Type of service to create (clusterip, nodeport, loadbalancer, externalname) |
suspend | booleanoptional | Whether to suspend the CronJob |
tcpPort | arrayoptional | Port pairs for tcp service (e.g. ["80:8080", "443:8443"]) |
validate | booleanoptional | 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 |
|---|---|---|
name | string | Name of the resource to delete |
namespace | string | Kubernetes namespace |
resourceType | string | Type of resource to delete (e.g., pods, deployments, services, etc.) |
allNamespaces | booleanoptional | If true, delete resources across all namespaces |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
filename | stringoptional | Path to a YAML file to delete resources from (optional) |
force | booleanoptional | If true, immediately remove resources from API and bypass graceful deletion |
gracePeriodSeconds | numberoptional | Period of time in seconds given to the resource to terminate gracefully |
labelSelector | stringoptional | Delete resources matching this label selector (e.g. 'app=nginx') |
manifest | stringoptional | YAML manifest defining resources to delete (optional) |
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 | booleanoptional | If true, describe resources across all namespaces |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
namespace | stringoptional | 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) |
args | arrayoptional | Additional command arguments |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
flags | objectoptional | Command flags as key-value pairs |
name | stringoptional | Resource name |
namespace | stringoptional | Kubernetes namespace |
outputFormat | stringoptional | Output format (e.g. json, yaml, wide) |
resourceType | stringoptional | Resource type (e.g. pod, deployment) |
subCommand | stringoptional | 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 |
|---|---|---|
name | string | Name of the resource (optional - if not provided, lists all resources of the specified type) |
namespace | string | Kubernetes namespace |
resourceType | string | Type of resource to get (e.g., pods, deployments, services, configmaps, events, etc.) |
allNamespaces | booleanoptional | If true, list resources across all namespaces |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
fieldSelector | stringoptional | Filter resources by field selector (e.g. 'metadata.name=my-pod') |
labelSelector | stringoptional | Filter resources by label selector (e.g. 'app=nginx') |
output | stringoptional | Output format |
sortBy | stringoptional | 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 | stringoptional | Container name (required when pod has multiple containers) |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
follow | booleanoptional | Follow logs output (not recommended, may cause timeouts) |
labelSelector | stringoptional | Filter resources by label selector |
previous | booleanoptional | Include logs from previously terminated containers |
since | stringoptional | Show logs since relative time (e.g. '5s', '2m', '3h') |
sinceTime | stringoptional | Show logs since absolute time (RFC3339) |
tail | numberoptional | Number of lines to show from end of logs |
timestamps | booleanoptional | 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 | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
dryRun | booleanoptional | If true, only validate the resource, don't actually execute the operation |
namespace | stringoptional | Kubernetes namespace |
patchData | objectoptional | Patch data as a JSON object |
patchFile | stringoptional | Path to a file containing the patch data (alternative to patchData) |
patchType | stringoptional | Type of patch to apply |
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 | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
revision | numberoptional | Revision to rollback to (for undo subcommand) |
timeout | stringoptional | The length of time to wait before giving up (e.g., '30s', '1m', '2m30s') |
toRevision | numberoptional | Revision to roll back to (for history subcommand) |
watch | booleanoptional | Watch the rollout status in real-time until completion |
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 | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
namespace | stringoptional | Kubernetes namespace |
resourceType | stringoptional | Resource type to scale (deployment, replicaset, statefulset) |
list_api_resourcesList the API resources available in the cluster
| Parameters | Type | Description |
|---|---|---|
apiGroup | stringoptional | API group to filter by |
context | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
namespaced | booleanoptional | If true, only show namespaced resources |
output | stringoptional | Output format (wide, name, or no-headers) |
verbs | arrayoptional | 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 | booleanoptional | Explicit confirmation to drain the node (required for drain operation) |
deleteLocalData | booleanoptional | Delete local data even if emptyDir volumes are used (for drain operation) |
dryRun | booleanoptional | Show what would be done without actually doing it (for drain operation) |
force | booleanoptional | Force the operation even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (for drain operation) |
gracePeriod | numberoptional | 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 | booleanoptional | Ignore DaemonSet-managed pods (for drain operation) |
nodeName | stringoptional | Name of the node to operate on (required for cordon, drain, uncordon) |
timeout | stringoptional | 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 | stringoptional |
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 | stringoptional | 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 | stringoptional | Kubeconfig Context to use for the command (optional - defaults to null) |
repo | stringoptional | Helm repository URL (optional if using local chart path) |
values | objectoptional | Custom values to override chart defaults |
valuesFile | stringoptional | Path to values file (alternative to values object) |
{
"mcpServers": {
"kubernetes": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/local-directory:/local-directory",
"mcp/kubernetes"
]
}
}
}
Manual installation
You can install the MCP server using:
Installation for