K8s Cluster Ops MCP Server avatar

K8s Cluster Ops MCP Server

Pricing

$49.00/month + usage

Go to Apify Store
K8s Cluster Ops MCP Server

K8s Cluster Ops MCP Server

Operate your Kubernetes cluster via natural language. Get pod logs, scale deployments, check cluster health, apply manifests, and restart services. All mutating operations require explicit confirmation.

Pricing

$49.00/month + usage

Rating

0.0

(0)

Developer

Segun Zubair

Segun Zubair

Maintained by Community

Actor stats

1

Bookmarked

1

Total users

0

Monthly active users

a month ago

Last modified

Share

Manage Kubernetes clusters through natural language — list resources, inspect logs, scale deployments, apply manifests, and monitor cluster health. All mutating operations require explicit confirmation.

Quick Start

  1. Deploy on Apify — search "K8s Cluster Ops MCP" in the Apify Store, or run locally with Docker.
  2. Add the MCP server URL to your Claude Desktop config (claude_desktop_config.json):
    {
    "mcpServers": {
    "k8s-cluster-ops": {
    "url": "https://your-apify-actor-standby-url/sse"
    }
    }
    }
  3. Start managing your cluster with natural language in Claude.

Run locally

git clone <repo-url>
cd products/mcp-servers/k8s-cluster-ops
# Ensure kubectl is installed and kubeconfig is set
export KUBECONFIG="$HOME/.kube/config"
pip install -r requirements.txt
python src/server.py

The server starts on port 8080 by default (configure with PORT env var).

Configuration

ParameterRequiredDescriptionDefault
KUBECONFIGNoPath to kubeconfig file~/.kube/config
KUBECTL_PATHNoPath to kubectl binarykubectl
HOSTNoServer bind address0.0.0.0
PORTNoServer port8080

Available Tools

list_namespaces

List all namespaces in the cluster with their status and labels.

Parameters: None.

Example prompt: "What namespaces exist in my cluster?"

Example response:

{
"count": 4,
"namespaces": [
{ "name": "default", "status": "Active", "labels": {} },
{ "name": "production", "status": "Active", "labels": { "env": "prod" } },
{ "name": "staging", "status": "Active", "labels": { "env": "staging" } },
{ "name": "kube-system", "status": "Active", "labels": {} }
]
}

list_pods

List all pods in a namespace with status, readiness, and restart counts.

Parameters: namespace (required).

Example prompt: "Show me all pods in the production namespace"

list_deployments

List deployments in a namespace with replica counts and images.

Parameters: namespace (required).

Example prompt: "What deployments are running in staging?"

list_services

List services in a namespace with type, ClusterIP, and port mappings.

Parameters: namespace (required).

Example prompt: "List all services in the production namespace"

get_pod_logs

Tail logs from a specific pod.

Parameters: namespace (required), pod_name (required), container (optional), tail_lines (optional, default 100, max 1000).

Example prompt: "Show me the last 50 lines of logs from the api-server pod in production"

describe_resource

Get a detailed description of any Kubernetes resource (equivalent to kubectl describe).

Parameters: namespace (required), resource_type (required), resource_name (required).

Example prompt: "Describe the redis deployment in the cache namespace"

scale_deployment

Scale a deployment's replica count. Requires confirm: true.

Parameters: namespace (required), deployment_name (required), replicas (required), confirm (required, must be true).

Example prompt: "Scale the web-frontend deployment in production to 5 replicas"

Without confirm: true, returns a preview:

{
"warning": true,
"message": "This will scale deployment 'web-frontend' in namespace 'production' to 5 replicas. To proceed, call this tool again with confirm=true.",
"confirm_required": true
}

apply_manifest

Apply a YAML manifest to the cluster. Supports dry-run mode. Requires confirm: true for actual apply.

Parameters: manifest_yaml (required), namespace (optional), dry_run (optional, default false), confirm (required for non-dry-run).

Example prompt: "Apply this ConfigMap to the staging namespace (dry run first)"

get_cluster_health

Aggregate cluster health status — nodes, PVCs, and namespace overview.

Parameters: None.

Example prompt: "How healthy is my cluster right now?"

restart_deployment

Perform a rolling restart of a deployment. Requires confirm: true.

Parameters: namespace (required), deployment_name (required), confirm (required, must be true).

Example prompt: "Rolling restart the api-server deployment in production"

Safety Guardrails

  • Mutating operations (scale_deployment, apply_manifest, restart_deployment) require confirm: true. Without it, the tool returns a warning describing what would happen.
  • Blocked operations: kubectl delete namespace and kubectl delete node are permanently blocked.
  • Dry-run support: apply_manifest supports dry_run: true to preview changes without applying.
  • Namespace required: All pod/deployment/service operations require an explicit namespace — the server never defaults to default.

Example Prompts

  • "What namespaces exist in my cluster?"
  • "Show me all pods in the production namespace"
  • "Are there any pods crashing in staging?"
  • "Show me the logs for the auth-service pod in production"
  • "Scale the web-frontend to 3 replicas in staging"
  • "How healthy is my cluster?"
  • "Apply this deployment manifest to production (dry run first)"
  • "Rolling restart the api-gateway in production"

Pricing

PlanPriceIncludes
Starter$49/moRead-only tools (list, logs, describe, health)
Pro$149/moAll tools including scale, apply, and restart

Purchase on Apify Store or MCPize.

Local Development

# Install dependencies
pip install -r requirements.txt
# Run with hot reload (development)
python src/server.py
# Run tests
pytest tests/ -v
# Build Docker image
docker build -t k8s-cluster-ops-mcp .
docker run -p 8080:8080 \
-v "$HOME/.kube/config:/root/.kube/config:ro" \
k8s-cluster-ops-mcp

Troubleshooting

IssueSolution
kubectl not foundInstall kubectl or set KUBECTL_PATH to its location
connection refusedEnsure your kubeconfig points to a reachable cluster
forbiddenCheck RBAC — your kubeconfig user needs appropriate permissions
confirm requiredMutating operations need confirm: true — this is by design
Timeout errorsThe cluster may be unreachable; check network connectivity