Kubernetes MCP
Provides tools for interacting with Kubernetes clusters, enabling inspection and deployment operations such as listing deployments and pods, retrieving logs and events, describing pods, and scaling or restarting deployments.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Kubernetes MCP
An MCP server that exposes common Kubernetes inspection and deployment operations to an MCP client.
The project is designed for local Kind clusters. It connects to the kubeconfig context in the
KUBERNETES_CONTEXT environment variable, defaulting to kind-dev101.
Features
The server provides these MCP tools:
Tool | Description |
| Returns the Kubernetes cluster version. |
| Lists deployments in a namespace. |
| Lists pods for a deployment, including restart counts and creation times. |
| Returns detailed status and container information for a pod. |
| Returns recent Kubernetes events for a namespace or pod. |
| Returns recent logs for a pod. |
| Changes the desired replica count for a deployment. |
| Triggers a rolling restart by updating the deployment pod template. |
Related MCP server: mcp-kubernetics
Prerequisites
Create the Kind clusters
Create the local clusters from PowerShell or a terminal:
kind create cluster --name dev101
kind create cluster --name sit101
kind create cluster --name prod101Kind creates these kubeconfig contexts:
kind-dev101
kind-sit101
kind-prod101Verify the contexts:
kubectl config get-contextsInstall dependencies
From the repository root:
uv syncRun the MCP server
Start the server over the standard MCP stdio transport:
uv run python src/kubernetes_mcp/__init__.pyThe server reads the Kubernetes configuration from the default kubeconfig location. Set
KUBERNETES_CONTEXT before launching it to choose a cluster:
PowerShell:
$env:KUBERNETES_CONTEXT = "kind-sit101"
uv run python src/kubernetes_mcp/__init__.pyFor production, use kind-prod101. If the variable is omitted, the server connects to
kind-dev101.
Configure an MCP client
Add the server to an MCP client that supports stdio servers. The command should point to this repository and use the same launcher shown above:
{
"mcpServers": {
"kubernetes": {
"command": "uv",
"env": {
"KUBERNETES_CONTEXT": "kind-sit101"
},
"args": [
"run",
"--directory",
"C:\\Users\\<your-user>\\kubernetes-mcp",
"python",
"src/kubernetes_mcp/__init__.py"
]
}
}
}Replace the repository path with the path on your machine. Keep the MCP server process attached to the client; it communicates through stdin and stdout.
Deploy the sample workload
The repository includes an NGINX deployment and service in k8s/deployment.yaml:
kubectl config use-context kind-dev101
kubectl apply -f k8s/deployment.yaml
kubectl get deployments,pods,services -n defaultThe sample deployment is named nginx and runs two replicas.
Example tool calls
Use the MCP client to call tools with arguments such as:
{
"namespace": "default",
"deployment": "nginx",
"replicas": 3
}This payload can be used with scale_deployment to scale NGINX to three replicas. To restart the
deployment, call restart_deployment with:
{
"namespace": "default",
"deployment": "nginx"
}Switching clusters
Set KUBERNETES_CONTEXT in the MCP client configuration and restart the server process. For
example, use kind-dev101, kind-sit101, or kind-prod101. The MCP server uses the selected
context directly, regardless of which context is active in kubectl.
Stop and delete clusters
To stop using the local clusters and remove their containers:
kind delete cluster --name dev101
kind delete cluster --name sit101
kind delete cluster --name prod101Deleting a Kind cluster removes its local Kubernetes resources. Do not run these commands for a cluster containing data you need to keep.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Deploy applications and manage governed Kubernetes preview spaces and capacity.
Managed Keycloak from any MCP client: clusters, realms, apps, SSO, users, domains, audit events.
Manage Kubernetes clusters, deployments, databases, secrets and observability on Mengi Cloud.
Manage Nife.io cloud apps, sites, secrets and Git integrations from MCP clients.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables real-time Kubernetes cluster observability and debugging through standardized MCP interface. Provides access to pods, services, nodes, events, and includes built-in tools for cluster health analysis and issue identification.-
- AlicenseNot gradedqualityDmaintenanceEnables Kubernetes cluster introspection via MCP tools, such as listing pods, namespaces, nodes, and events.4ISC
- AlicenseAqualityBmaintenanceEnables MCP clients to inspect and operate Kubernetes clusters across multiple contexts, with read-only/read-write/admin access modes and security flags controlling namespaces, contexts, deletes, applies, and exec.10106 npm3MIT
- AlicenseBqualityDmaintenanceEnables connection to a Kubernetes cluster to list and manage pods, services, deployments, and nodes, create/delete/describe pods, inspect namespaces, and retrieve logs for debugging.1113,114 npmMIT