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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Kubernetes MCPList all pods in the default namespace"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: Kubernetes MCP Server
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.
This server cannot be deployed
Maintenance
Related MCP Connectors
- SkycloakOAuthio.skycloak
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.
Provides read access to your GKE and Kubernetes resources.
Governed MCP gateway: one endpoint for your tools, with credential custody and audit log.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides MCP multi-cluster Kubernetes management and operations, featuring a management interface, logging, and nearly 50 built-in tools covering common DevOps and development scenarios. Supports both standard and CRD resources.880MIT
- 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.-
- FlicenseNot gradedqualityDmaintenanceEnables Kubernetes cluster introspection via MCP tools, such as listing pods, namespaces, nodes, and events.4-
- FlicenseNot gradedqualityBmaintenanceEnables read-only Kubernetes incident investigation through MCP tools for listing pods, describing resources, fetching logs, and searching runbooks.1-