home / mcp / kubernetes tools mcp server
Exposes Kubernetes read-only tooling as an MCP server for agents to query namespaces, pods, deployments, services, events, and logs.
Configuration
View docs{
"mcpServers": {
"benedatllc-k8stools": {
"command": "k8s-mcp-server",
"args": [],
"env": {
"KUBECONFIG": "path/to/kubeconfig"
}
}
}
}You run a Kubernetes-focused MCP server that exposes your cluster tools over a simple, queryable interface. This server lets you interact with Kubernetes data through an MCP client, enabling read-only monitoring and root-cause analysis workflows in a safe, tool-driven way.
Connect your MCP client to the available Kubernetes tools to fetch read-only data about your cluster. You can run the server locally and choose a transport that fits your workflow: use the stdio transport for local Coding Agents and the streamable HTTP transport for remote access. Once the MCP server is running, you can request pod, node, deployment, service information, logs, events, and more through the provided tools. Use the tools to build monitoring queries, RCA scenarios, or to power your custom chat UI with live cluster data.
Prerequisites: you need Python and a package manager to install and run the MCP server tools.
Install the Kubernetes tools package with Python's package manager:
pip install k8stoolsThe server can be run in two main ways: as a local stdio server or as a streamable HTTP server. The stdio configuration is tailored for local development with Coding Agents, while the HTTP option allows remote access.
Mock tools are available to test agents without connecting to a real Kubernetes cluster. Enable mock data when starting the MCP server to return realistic static values for testing.
Instruction files for Copilot-style agents can be customized to guide how the tools are used in your environment. Save additional instructions in your workspace to tailor agent behavior to your cluster.
Retrieve a list of Kubernetes namespaces, similar to the kubectl get namespaces command.
Fetch a summary of nodes in the cluster, including wide output details.
Return a list of pods with extended information comparable to kubectl get pods -o wide.
Return the status of each container within a specified pod.
Retrieve events related to a specific pod to aid in RCA.
Retrieve the pod specification for a given pod.
Fetch logs from a specified pod and container, useful for debugging.
List deployments with pertinent details similar to kubectl get deployments.
List services in the cluster with key metadata and status.
Helper to pretty-print the list of namespaces.
Helper to format node summaries for quick review.
Helper to display pod summaries in a readable format.
Helper to show container statuses in a readable table.
Helper to present pod events clearly.
Helper to present pod specifications in a readable form.
Helper to display deployment summaries succinctly.
Helper to present service summaries clearly.