K8s Cluster Ops Mcp
Pricing
$49.00/month + usage
K8s Cluster Ops Mcp
Operate your Kubernetes cluster via natural language. Get pod logs, scale deployments, check cluster health, apply manifests, and restart services.
Pricing
$49.00/month + usage
Rating
0.0
(0)
Developer

Segun Zubair
Actor stats
0
Bookmarked
1
Total users
0
Monthly active users
4 days ago
Last modified
Categories
Share
K8s Cluster Ops MCP Server
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
- Deploy on Apify — search "K8s Cluster Ops MCP" in the Apify Store, or run locally with Docker.
- 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"}}} - 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 setexport KUBECONFIG="$HOME/.kube/config"pip install -r requirements.txtpython src/server.py
The server starts on port 8080 by default (configure with PORT env var).
Configuration
| Parameter | Required | Description | Default |
|---|---|---|---|
KUBECONFIG | No | Path to kubeconfig file | ~/.kube/config |
KUBECTL_PATH | No | Path to kubectl binary | kubectl |
HOST | No | Server bind address | 0.0.0.0 |
PORT | No | Server port | 8080 |
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) requireconfirm: true. Without it, the tool returns a warning describing what would happen. - Blocked operations:
kubectl delete namespaceandkubectl delete nodeare permanently blocked. - Dry-run support:
apply_manifestsupportsdry_run: trueto 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
| Plan | Price | Includes |
|---|---|---|
| Starter | $49/mo | Read-only tools (list, logs, describe, health) |
| Pro | $149/mo | All tools including scale, apply, and restart |
Purchase on Apify Store or MCPize.
Local Development
# Install dependenciespip install -r requirements.txt# Run with hot reload (development)uvicorn src.server:app --reload --port 8080# Run testspytest tests/ -v# Build Docker imagedocker build -t k8s-cluster-ops-mcp .docker run -p 8080:8080 \-v "$HOME/.kube/config:/root/.kube/config:ro" \k8s-cluster-ops-mcp
Troubleshooting
| Issue | Solution |
|---|---|
kubectl not found | Install kubectl or set KUBECTL_PATH to its location |
connection refused | Ensure your kubeconfig points to a reachable cluster |
forbidden | Check RBAC — your kubeconfig user needs appropriate permissions |
confirm required | Mutating operations need confirm: true — this is by design |
| Timeout errors | The cluster may be unreachable; check network connectivity |