claude-log-analyzer
Connects to a live Kubernetes cluster via kubeconfig to fetch pod logs, pod status, resource metrics, and events, then runs anomaly detection (CPU/memory spikes, error bursts, restart storms, OOM kills, event floods), correlates events across services to surface cascading failures, and produces evidence-backed root cause analysis reports exported to Markdown or TXT files.
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., "@claude-log-analyzer run a root cause analysis on the crashlooping pods in the payments 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.
What it does
Fetches pod logs, status, metrics, and events from a live K8s cluster
Detects anomalies: CPU/memory spikes, error bursts, restart storms, OOM kills
Correlates events across services to identify cascading failures
Produces evidence-backed root cause analysis reports (MD or TXT)
Every finding cites actual log lines, metric values, or event data
Related MCP server: k8s-ops-mcp-server
Install
Add to your project's .mcp.json:
{
"mcpServers": {
"k8s-analyzer": {
"command": "npx",
"args": ["-y", "claude-log-analyzer"]
}
}
}Windows users: Use
"command": "cmd"with"args": ["/c", "npx", "-y", "claude-log-analyzer"]
Prerequisites
A valid kubeconfig (
~/.kube/configor setKUBECONFIGenv var)RBAC permissions to read pods, logs, events, and metrics
metrics-server on the cluster (optional, for resource metrics)
Tools
Tool | Description |
| List all namespaces in the cluster |
| Fetch and filter pod logs with severity detection and noise removal |
| Pod phase, conditions, container states, restart counts |
| CPU/memory usage via Metrics API with % against limits |
| Kubernetes events (Warning/Normal) with filtering |
| High-level cluster health overview |
| Run anomaly detection on a namespace |
| Deep dive on a specific service |
| Full RCA with exported report |
Configuration
Environment variables
Variable | Default | Description |
|
| Path to kubeconfig file |
| current-context | Kubernetes context to use |
|
| Default namespace |
|
| Max log lines per pod |
|
| Default time window in minutes |
|
| Default mode: |
Pass env vars through MCP config:
{
"mcpServers": {
"k8s-analyzer": {
"command": "npx",
"args": ["-y", "claude-log-analyzer"],
"env": {
"KUBECONFIG": "/path/to/kubeconfig",
"K8S_TIME_WINDOW": "30",
"K8S_MODE": "logs"
}
}
}
}Per-call configuration
Every analysis tool accepts:
timeWindowMinutes— override the default time windowmode—"logs","metrics", or"both"
The get_root_cause_analysis tool also accepts:
exportFormat—"md"(default) or"txt"exportPath— custom file path for the report
Token efficiency
The server minimizes token usage by:
Filtering out noise (health checks, liveness/readiness probes)
Detecting log severity to skip irrelevant lines
Summarizing log results (error counts, top errors) alongside raw data
Truncating with a
truncatedflag so Claude can narrow queriesReturning only a summary from the RCA tool (full details go to the exported report)
Anomaly detection
CPU/memory spikes — peer comparison (z-score against sibling pods) + threshold-based (% of limit)
Error bursts — 1-minute bucketing, flags statistical outliers (mean + 3σ) and absolute thresholds
Restart storms — restart count thresholds + CrashLoopBackOff detection
OOM kills — container termination reason + event scanning
Event floods — warning event count per object with auto-escalation for critical reasons
Report output
Reports are written to disk, not returned in full to the LLM. Every claim is backed by evidence:
### [CRITICAL] OOM Kill — pod/payments-7f8b9-x2k4
- **Description:** Container 'payments' was OOM killed (exit code: 137)
- **Value:** 7 (threshold: 3)
### [HIGH] Error Burst — pod/payments-7f8b9-x2k4
- **Description:** 142 errors/min detected (baseline: 3.0/min). 284 total errors in window.
- **Sample log lines:**
- `java.lang.OutOfMemoryError: Java heap space`
- `Failed to process transaction: heap exhausted`License
Available Tools
9 toolsanalyze_serviceA
Deep dive on a specific service. Combines pod status, logs, metrics, events, and anomaly detection into a single view.
Inputs: namespace (required), serviceName (required), mode, timeWindowMinutes.
detect_anomaliesA
Run anomaly detection on a namespace. Detects CPU/memory spikes, error bursts, restart storms, OOM kills, event floods. Returns evidence-backed findings.
Inputs: namespace (required), mode, labelSelector, timeWindowMinutes.
fetch_pod_logsA
Fetch and filter pod logs. Intelligently filters noise (health checks, probes) and extracts severity. Returns summarized results to minimize token usage.
Inputs: namespace (required), podName, tailLines, grepPattern, +4 more.
get_cluster_healthA
Get a high-level cluster health overview: pod counts, problem pods, recent warnings. Good starting point for investigation.
Inputs: namespace.
get_eventsA
Fetch Kubernetes events (Warning/Normal) for a namespace or cluster-wide. Useful for spotting OOM kills, scheduling failures, and pod issues.
Inputs: eventType, namespace, sinceMinutes, involvedObjectKind, +1 more.
get_pod_statusA
Get detailed pod status including phase, conditions, container states, restart counts, and termination reasons.
Inputs: namespace (required), podName, labelSelector.
get_resource_metricsA
Fetch CPU and memory usage via Kubernetes Metrics API. Returns usage with percentage against limits/requests. Requires metrics-server.
Inputs: namespace (required), podName, labelSelector.
get_root_cause_analysisB
Full root cause analysis: fetches all data, detects anomalies, correlates events, and exports an evidence-backed report. This is the main analysis tool.
Inputs: namespace (required), mode, exportPath, exportFormat, +2 more.
list_namespacesA
List all Kubernetes namespaces in the cluster. Use this first to discover available namespaces.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Most tools have distinct scope: list_namespaces, fetch_pod_logs, get_pod_status, get_resource_metrics, and get_events each target a specific resource/action. The analysis layer overlaps somewhat — analyze_service, detect_anomalies, get_cluster_health, and get_root_cause_analysis all bundle similar underlying data, though descriptions differentiate by scope (single service vs namespace vs whole cluster vs full report).
All nine tools follow a clean snake_case verb_noun pattern (list_namespaces, fetch_pod_logs, get_pod_status, detect_anomalies). Verb choices (list/get/fetch/analyze/detect) are semantically consistent with the operation type, making the set predictable.
Nine tools is well within the sweet spot for a Kubernetes diagnostic server. Each tool covers a distinct layer (discovery, raw data retrieval, aggregation, analysis) without obvious redundancy.
There is a notable discovery gap: list_namespaces exists, but no list_pods, list_services, or list_deployments, so analyze_service and get_pod_status require names the agent has no reliable way to enumerate. Read-only diagnostic coverage is otherwise solid (logs, metrics, events, health, anomalies, RCA), but lifecycle/workload discovery operations are missing.
Maintenance
Related MCP Connectors
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
1Fail-closed policy guardrails for AI agents running kubectl, terraform, helm, and argocd.
Monitoring + status pages set up by talking to Claude. Auto-detects 30+ SDKs and your URLs.
AI SRE: investigate production incidents across your observability stack.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables Claude Desktop to interact with Kubernetes clusters using kubectl and helm, providing tools for querying pods, services, Helm releases, and analyzing versions.6MIT
- FlicenseAqualityDmaintenanceConnects Claude Desktop to any Kubernetes cluster, enabling natural language queries for diagnostics and operations such as listing pods, viewing logs, scaling deployments, and more.8-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to diagnose Kubernetes clusters through read-only MCP tools, such as inspecting pod status, logs, events, nodes, deployments, and HPA metrics via natural language queries.MIT

kubestellar-mcpofficial
AlicenseNot gradedqualityAmaintenanceEnables AI agents to inspect and operate multiple Kubernetes clusters through natural language, providing multi-cluster diagnostics, RBAC analysis, security checks, and app-centric deployment with GitOps and smart workload placement.2Apache 2.0