KubeWhisper
An AI-DevOps MCP server that gives LLMs read-only-by-default access to Kubernetes clusters, Prometheus metrics, and GitHub Actions, enabling natural language queries about infrastructure status and safe write operations with previews.
README
π£οΈ KubeWhisper
An AI-DevOps MCP server β talk to your infrastructure in plain English, safely.
KubeWhisper is a Model Context Protocol (MCP) server that gives an LLM like Claude read-only-by-default access to a live environment, so you can ask:
"Which pods are crash-looping in
staging?" "What's the p95 latency right now?" "Did the last GitHub Actions run onmainpass?" "Scale thewebdeployment to 5 β but show me the preview first."
β¦and the model answers grounded in your actual cluster, metrics, and CI β not generic guesses.
MCP crossed ~97M monthly SDK downloads in March 2026 and is now adopted by Anthropic, OpenAI, Google, Microsoft and Amazon. Plenty of people use MCP servers; far fewer have built one for real DevOps work. This is a small, honest, safety-first example of how.
β¨ Tools
| Tool | Mode | What it does |
|---|---|---|
list_clusters |
π’ read-only | list configured clusters + their routing hints |
resolve_cluster |
π’ read-only | decide which cluster an alert/error belongs to |
k8s_get_resources |
π’ read-only | pods / deployments / services / nodes / events, with status |
prometheus_query |
π’ read-only | run an instant PromQL query |
github_actions_runs |
π’ read-only | list recent workflow runs for a repo |
scale_deployment |
π΄ write | scale a Deployment β disabled by default, previews first, every call audited |
send_slack_message |
π‘ outbound | post an incident/remediation note to Slack |
π Multi-cluster + error-context routing
Drop a clusters.json next to the server (or point KUBEWHISPER_CLUSTERS at it).
Each cluster maps to a kubeconfig context, a Prometheus URL, and routing hints:
{
"default_cluster": "prod-mumbai",
"clusters": [
{ "name": "prod-mumbai", "kube_context": "gke_proj_asia-south1_prod",
"prometheus_url": "http://prometheus.prod-mumbai:9090",
"match": { "keywords": ["prod","mumbai","live","p1"], "namespaces": ["streaming","ingest"] } },
{ "name": "staging", "kube_context": "gke_proj_asia-south1_staging",
"prometheus_url": "http://prometheus.staging:9090",
"match": { "keywords": ["staging","qa"], "namespaces": ["streaming-staging"] } }
]
}
Now the agent can route by the error context: given an alert like
"P1: transcode pods OOMing on the Mumbai live stream", it calls resolve_cluster,
matches mumbai / live / transcode β prod-mumbai, and targets that cluster's
kube context + Prometheus automatically. Every cluster-scoped tool also accepts an
explicit cluster argument. With no clusters.json, it falls back to your current
kube context. See clusters.example.json.
π¬ Slack bot
Two ways to use Slack:
- Outbound notes from any MCP client β the
send_slack_messagetool (setSLACK_BOT_TOKENorSLACK_WEBHOOK_URL). - A full Slack bot (
slack_bridge.py) β @mention it in a channel ("@KubeWhisper which pods are failing in prod?") and it runs a Claude tool-use loop over these tools, routes to the right cluster, and replies in-thread.
pip install -r requirements-slack.txt
export ANTHROPIC_API_KEY=... # console.anthropic.com
export SLACK_BOT_TOKEN=xoxb-... # scopes: app_mentions:read, chat:write
export SLACK_APP_TOKEN=xapp-... # Socket Mode
python slack_bridge.py
The bot is read-only by default β scale_deployment stays preview-only unless an
operator sets KUBEWHISPER_ALLOW_WRITES=true on the bot process.
π Safety model (the whole point)
- Read-only by default. The single write tool is off unless
KUBEWHISPER_ALLOW_WRITES=true. - Preview, then confirm. A write with
confirm=Falseonly describes the change. - Audit trail. Every write intent β refused, previewed, or applied β is appended to a JSONL log.
- No destructive verbs.
delete/drain/cordonare deliberately not implemented in v0.
See docs/architecture.md for the diagram.
π Quickstart
# 1. Install
python -m venv .venv && source .venv/bin/activate # (Windows: .venv\Scripts\activate)
pip install -r requirements.txt
# 2. Point at a cluster + Prometheus (a local `kind` cluster is perfect)
export PROMETHEUS_URL=http://localhost:9090
# KUBEWHISPER_ALLOW_WRITES stays unset β read-only
# 3. Run it
python -m kubewhisper.server
Use it from Claude Desktop
Copy the block in config.example.json into your
claude_desktop_config.json, fix the cwd path, restart Claude Desktop, and ask it about your cluster.
π§ͺ Tests
pip install pytest
pytest -q # guardrail tests prove writes are refused unless explicitly enabled
CI runs lint + import check + guardrail tests on every push (see .github/workflows/ci.yml).
πΊοΈ Roadmap
- v0.1 β read-only tools + guarded scale + audit (this release)
- v0.2 β Terraform
plan(read-only) tool + deploy "what-changed" diff - v0.3 β eval suite proving destructive-op refusal + OPA policy layer over writes
- v0.4 β one-command
docker run, publish to an MCP registry
β οΈ Disclaimer
A learning / portfolio project. Run it against clusters you own. Keep it in read-only mode unless you fully understand the write path. Built independently, on personal infrastructure.
π License
MIT β see LICENSE.
Built by Abdulhussain Kanchwala Β· Portfolio Β· LinkedIn Β· GitHub
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.