mcp-k8s-observability
Provides tools for interacting with Kubernetes clusters, including listing pods, retrieving cluster events, and diagnosing pod health.
Executes PromQL queries against Prometheus to retrieve metrics for observability and diagnostics.
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., "@mcp-k8s-observabilityWhy is payment-service in CrashLoopBackOff?"
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.
mcp-k8s-observability
Servidor MCP en Python que conecta agentes de IA (Claude Desktop, Cursor, etc.) con la infraestructura de Kubernetes y el stack de observabilidad.
La idea es simple: en vez de copiar y pegar outputs de kubectl y curl en el chat, el agente puede llamar directamente a las herramientas y obtener el estado de los pods, hacer queries a Prometheus y buscar logs en Loki.
Que hace
El servidor expone 5 herramientas via JSON-RPC (transporte stdio):
get_kubernetes_pods- Lista pods con su estado, reinicios y nodo asignadoget_cluster_events- Eventos del cluster (BackOff, OOMKilled, FailedScheduling)query_prometheus_metrics- Ejecuta PromQL contra Prometheusquery_loki_logs- Ejecuta LogQL contra Lokidiagnose_pod_health- Herramienta compuesta: cruza estado del pod + metricas + eventos + logs y saca una puntuacion de salud (0-100) con acciones sugeridas
Related MCP server: OpenTelemetry MCP Server
Modo mock
Todo funciona sin cluster real. Con MCP_MODE=mock genera datos sinteticos que simulan pods en CrashLoopBackOff, OOMKilled, etc. Util para probar prompts y ver como reacciona el agente sin necesidad de tener infraestructura activa.
Como probarlo
git clone https://github.com/NeoScraids/mcp-k8s-observability.git
cd mcp-k8s-observability
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Correr el cliente de prueba
python test_client.pyLa salida muestra el handshake MCP, la lista de herramientas y un diagnostico automatico de un pod simulado con OOMKilled.
Conectar con Claude Desktop
Agregar en claude_desktop_config.json:
{
"mcpServers": {
"k8s-observability": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/ruta/a/mcp-k8s-observability",
"env": { "MCP_MODE": "mock" }
}
}
}Estructura
src/
config.py # Variables de entorno y settings
models.py # Esquemas Pydantic
server.py # Loop stdio + despachador JSON-RPC
tools/
k8s_tools.py # Pods y eventos (live con kubernetes-client o mock)
prometheus_tools.py # Queries PromQL
loki_tools.py # Queries LogQL
test_client.py # Prueba rapida sin cliente externo
Dockerfile # Multi-stage, 70MB aproxPor que existe esto
En el trabajo uso herramientas similares para no tener que estar saltando entre terminales, Grafana y Slack cuando llega una alerta. Este repo es una version limpia de esa idea, sin datos corporativos, que cualquiera puede clonar y adaptar.
Licencia
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
The Google GKE MCP server is a managed Model Context Protocol server that provides AI applications with tools to manage Google Kubernetes Engine (GKE) clusters and Kubernetes resources. It exposes a structured, discoverable interface that allows AI agents to interact with GKE and Kubernetes APIs, enabling them to inspect cluster configurations, retrieve Kubernetes resource YAMLs, monitor operations like cluster upgrades, diagnose issues, and optimize costs—all without needing to parse text output or use complex kubectl commands.
- SpanlyOAuthcom.spanly
MCP observability. Query live traffic, errors, duration, and alerts from your AI agent.
MCP-native AI SRE: ask what's broken in production, get a reviewed GitHub fix PR.
MCP-Native LLM Orchestration Agent
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.-
- FlicenseAqualityDmaintenanceEnables AI agents to query Prometheus metrics and Loki logs for intelligent alert investigation and troubleshooting. Provides service discovery, metric querying, log searching, and correlation tools to help identify root causes of issues.9-
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to investigate production incidents by exposing service health, logs, and deployment data through MCP tools.10 npm-
- FlicenseNot gradedqualityBmaintenanceProvides read-only Kubernetes cluster operations via MCP, enabling LLMs to query nodes, pods, logs, events, and watch real-time status for troubleshooting.2-