About flux159/mcp-server-kubernetes
flux159/mcp-server-kubernetes is an MCP server published by Flux159 in the Cloud category: mCP Server for kubernetes management commands. Conduid read 22 tools from its source: exec_in_pod, explain_resource, install_helm_chart, kubectl_apply, kubectl_context, kubectl_create and 16 more. It is published to npm as mcp-server-kubernetes and starts with npx.
The repository has 1.6K stars and 292 forks, is licensed MIT, and its last commit was on 18 Nov 2026. The latest release is v4.2.3 (13 Nov 2026): KUBECONFIG can now list several files, merged the way kubectl does (#397). It follows v4.2.2 (10 Nov 2026), and the 5 most recent releases go back to v4.1.9 (2 Oct 2026). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include cloud-native, devops, k8s and kubernetes.
Install
claude mcp add kubernetes -- npx mcp-server-kubernetesnpx mcp-server-kubernetesgit clone https://github.com/Flux159/mcp-server-kubernetesTools (22)
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.| Parameter | 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. |
| container | string | Container name (required when pod has multiple containers) |
| context | any | |
| name * | string | Name of the pod to execute the command in |
| namespace | any | |
| timeout | number | Timeout for command - 60000 milliseconds if not specified |
explain_resourceGet documentation for a Kubernetes resource or field| Parameter | Type | Description |
|---|---|---|
| apiVersion | string | API version to use (e.g. 'apps/v1') |
| context | any | |
| output | string | Output format (plaintext or plaintext-openapiv2) |
| recursive | boolean | Print the fields of fields recursively |
| resource * | string | Resource name or field path (e.g. 'pods' or 'pods.spec.containers') |
install_helm_chartInstall a Helm chart with support for both standard and template-based installation| Parameter | Type | Description |
|---|---|---|
| chart * | string | Chart name (e.g., 'nginx') or path to chart directory |
| context | any | |
| createNamespace | boolean | Create namespace if it doesn't exist |
| name * | string | Name of the Helm release |
| namespace * | any | |
| repo | string | Helm repository URL (optional if using local chart path) |
| useTemplate | boolean | Use helm template + kubectl apply instead of helm install (bypasses auth issues) |
| values | object | Custom values to override chart defaults |
| valuesFile | string | Path 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_applyApply a Kubernetes YAML manifest from a string or file| Parameter | Type | Description |
|---|---|---|
| context | any | |
| dryRun | any | |
| filename | string | Path 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 | boolean | If true, immediately remove resources from API and bypass graceful deletion |
| manifest | string | YAML manifest to apply |
| namespace | any |
kubectl_contextManage Kubernetes contexts - list, get, or set the current context| Parameter | Type | Description |
|---|---|---|
| detailed | boolean | Include detailed information about the context |
| name | string | Name of the context to set as current (required for set operation) |
| operation * | string | Operation to perform: list contexts, get current context, or set current context |
| output | string | Output format |
| showCurrent | boolean | When listing contexts, highlight which one is currently active |
kubectl_createCreate Kubernetes resources using various methods (from file or using subcommands)| Parameter | Type | Description |
|---|---|---|
| annotations | array | Annotations to apply to the resource (e.g. ["key1=value1", "key2=value2"]) |
| command | array | Command to run in the container |
| context | any | |
| dryRun | any | |
| filename | string | Path 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 | array | Path 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 | array | Inline 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 | array | Key-value pair for creating configmap (e.g. ["key1=value1", "key2=value2"]) |
| image | string | Image to use for the containers in the deployment |
| labels | array | Labels to apply to the resource (e.g. ["key1=value1", "key2=value2"]) |
| manifest | string | YAML manifest to create resources from |
| name | string | Name of the resource to create |
| namespace | any | |
| output | string | Output format. One of: json|yaml|name|go-template|template|jsonpath|jsonpath-as-json. The template formats take their template inline, e.g. 'jsonpath={.metadata.name}'. |
| port | number | Port that the container exposes |
| replicas | number | Number of replicas to create for the deployment |
| resourceType | string | Type of resource to create (namespace, configmap, deployment, service, etc.) |
| schedule | string | Cron schedule expression for the CronJob (e.g. "*/5 * * * *") |
| secretType | string | Type of secret to create (generic, docker-registry, tls) |
| serviceType | string | Type of service to create (clusterip, nodeport, loadbalancer, externalname) |
| suspend | boolean | Whether to suspend the CronJob |
| tcpPort | array | Port pairs for tcp service (e.g. ["80:8080", "443:8443"]) |
| validate | boolean | If true, validate resource schema against server schema |
kubectl_deleteDelete Kubernetes resources by resource type, name, labels, or from a manifest file| Parameter | Type | Description |
|---|---|---|
| allNamespaces | boolean | If true, delete resources across all namespaces |
| context | any | |
| filename | string | Path 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 | boolean | If true, immediately remove resources from API and bypass graceful deletion |
| gracePeriodSeconds | number | Period of time in seconds given to the resource to terminate gracefully |
| labelSelector | string | Delete resources matching this label selector (e.g. 'app=nginx') |
| manifest | string | YAML manifest defining resources to delete (optional) |
| name | string | Name of the resource to delete |
| namespace | any | |
| resourceType | string | Type of resource to delete (e.g., pods, deployments, services, etc.) |
kubectl_describeDescribe Kubernetes resources by resource type, name, and optionally namespace| Parameter | Type | Description |
|---|---|---|
| allNamespaces | boolean | If true, describe resources across all namespaces |
| context | any | |
| name * | string | Name of the resource to describe |
| namespace | any | |
| resourceType * | string | Type of resource to describe (e.g., pods, deployments, services, etc.) |
kubectl_genericExecute any kubectl command with the provided arguments and flags| Parameter | Type | Description |
|---|---|---|
| allNamespaces | boolean | If true, run the command across all namespaces |
| args | array | Additional command arguments |
| command * | string | The kubectl command to execute (e.g. patch, rollout, top) |
| context | any | |
| flags | object | Command flags as key-value pairs |
| name | string | Resource name |
| namespace | any | |
| outputFormat | string | Output format (e.g. json, yaml, wide) |
| resourceType | string | Resource type (e.g. pod, deployment) |
| subCommand | string | Subcommand if applicable (e.g. 'history' for rollout) |
kubectl_getGet or list Kubernetes resources by resource type, name, and optionally namespace| Parameter | Type | Description |
|---|---|---|
| allNamespaces | boolean | If true, list resources across all namespaces |
| context | any | |
| fieldSelector | string | Filter resources by field selector (e.g. 'metadata.name=my-pod') |
| labelSelector | string | Filter resources by label selector (e.g. 'app=nginx') |
| name | string | Name of the resource (optional - if not provided, lists all resources of the specified type) |
| namespace | any | |
| output | string | Output format |
| resourceType * | string | Type of resource to get (e.g., pods, deployments, services, configmaps, events, etc.) |
| sortBy | string | Sort events by a field (default: lastTimestamp). Only applicable for events. |
kubectl_logsGet logs from Kubernetes resources like pods, deployments, or jobs| Parameter | Type | Description |
|---|---|---|
| container | string | Container name (required when pod has multiple containers) |
| context | any | |
| follow | boolean | Follow logs output (not recommended, may cause timeouts) |
| labelSelector | string | Filter resources by label selector |
| name * | string | Name of the resource |
| namespace * | any | |
| previous | boolean | Include logs from previously terminated containers |
| resourceType * | string | Type of resource to get logs from |
| since | string | Show logs since relative time (e.g. '5s', '2m', '3h') |
| sinceTime | string | Show logs since absolute time (RFC3339) |
| tail | number | Number of lines to show from end of logs |
| timestamps | boolean | Include timestamps in logs |
kubectl_patchUpdate field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch| Parameter | Type | Description |
|---|---|---|
| context | any | |
| dryRun | any | |
| name * | string | Name of the resource to patch |
| namespace | any | |
| patchData | any | Patch data: a JSON object for 'strategic' and 'merge' patches, or an array of JSON Patch operations for patchType 'json' |
| patchFile | string | Path 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 | string | Type of patch to apply |
| resourceType * | string | Type of resource to patch (e.g., pods, deployments, services) |
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)| Parameter | Type | Description |
|---|---|---|
| context | any | |
| name * | string | Name of the resource |
| namespace * | any | |
| resourceType * | string | Type of resource to manage rollout for |
| revision | number | Revision to rollback to (for undo subcommand) |
| subCommand * | string | Rollout subcommand to execute |
| timeout | string | The length of time to wait before giving up (e.g., '30s', '1m', '2m30s') |
| toRevision | number | Revision to roll back to (for history subcommand) |
| watch | boolean | Watch the rollout status in real-time until completion |
kubectl_scaleScale a Kubernetes deployment| Parameter | Type | Description |
|---|---|---|
| context | any | |
| name * | string | Name of the deployment to scale |
| namespace | any | |
| replicas * | number | Number of replicas to scale to |
| resourceType | string | Resource type to scale (deployment, replicaset, statefulset) |
list_api_resourcesList the API resources available in the cluster| Parameter | Type | Description |
|---|---|---|
| apiGroup | string | API group to filter by |
| context | string | Kubeconfig Context to use for the command (optional - defaults to null) |
| namespaced | boolean | If true, only show namespaced resources |
| output | string | Output format (wide, name, or no-headers) |
| verbs | array | List of verbs to filter by |
node_managementManage Kubernetes nodes with cordon, drain, and uncordon operations| Parameter | Type | Description |
|---|---|---|
| confirmDrain | boolean | Explicit confirmation to drain the node (required for drain operation) |
| deleteLocalData | boolean | Delete local data even if emptyDir volumes are used (for drain operation) |
| dryRun | boolean | Show what would be done without actually doing it (for drain operation) |
| force | boolean | Force the operation even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet (for drain operation) |
| gracePeriod | number | 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 | Ignore DaemonSet-managed pods (for drain operation) |
| nodeName | string | Name of the node to operate on (required for cordon, drain, uncordon) |
| operation * | string | Node operation to perform |
| timeout | string | The length of time to wait before giving up (for drain operation, e.g., '5m', '1h') |
pingVerify that the counterpart is still responsive and the connection is alive.port_forwardForward a local port to a port on a Kubernetes resource| Parameter | Type | Description |
|---|---|---|
| localPort * | number | |
| namespace | string | |
| resourceName * | string | |
| resourceType * | string | |
| targetPort * | number |
stop_port_forwardStop a port-forward process| Parameter | Type | Description |
|---|---|---|
| id * | string |
uninstall_helm_chartUninstall a Helm chart release| Parameter | Type | Description |
|---|---|---|
| context | any | |
| name * | string | Name of the Helm release to uninstall |
| namespace * | any |
upgrade_helm_chartUpgrade an existing Helm chart release| Parameter | Type | Description |
|---|---|---|
| chart * | string | Chart name or path to chart directory |
| context | any | |
| name * | string | Name of the Helm release to upgrade |
| namespace * | any | |
| repo | string | Helm repository URL (optional if using local chart path) |
| values | object | Custom values to override chart defaults |
| valuesFile | string | Path 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. |
Security checks
Static checks derived from the repository 5 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 2.2K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by bun.lockb.
- ✓No dynamic code executionScanned 46 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- stdio, Streamable HTTP and HTTP with SSEsrc/index.ts:9, src/utils/streamable-http.ts:3, src/utils/sse.ts:3
- Starts other programs
- 2 callssrc/security/kubectl-flags.ts:591, src/tools/port_forward.ts:20
- Outbound network calls
- No outbound network calls
- Writes or deletes files
- 5 callssrc/utils/kubernetes-manager.ts:468, src/utils/kubernetes-manager.ts:480, src/utils/temp-file.ts:21
- Lockfile
- bun.lockb
Pattern matches on the source text of 46 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 2.2K words, fetched 5 days ago. The original in the repository is authoritative.
Read full README