gitops-oncall-mcp
Integrates with Argo CD and Argo Rollouts to provide visibility into Application sync status, health, deployed revision, Rollout state, and AnalysisRun verdicts. Proposed Git changes can be synced by Argo CD and canaried by Argo Rollouts.
Uses GitHub for deployment history, commit diffs, file history, and opening pull requests against the config repository. Also supports confirmed rollback workflows by dispatching the deploy workflow at an older tag.
Provides a read-only Kubernetes on-call surface using a ServiceAccount with no write verbs. Planned reads include pod status and restarts, events, Rollout state, and AnalysisRun verdicts.
Queries Prometheus for observability signals including 5xx error rate, p95 latency, CPU usage, memory usage, and disk usage over recent windows.
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., "@gitops-oncall-mcpwhat's the error rate and are any alerts firing?"
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.
gitops-oncall-mcp
An MCP server that gives an LLM agent a typed, auditable on-call surface over a GitOps-on-Kubernetes platform: Kubernetes, Argo CD, Argo Rollouts, Prometheus, Loki, Tempo and GitHub.
Requires a Kubernetes cluster. The resource tools read cAdvisor and kube-state-metrics per pod, and the delivery tools read Argo CD and Argo Rollouts custom resources, so there is no meaningful way to run this against plain hosts.
Status: work in progress. Forked from lgtm-oncall-mcp, which targets a hosted Grafana LGTM stack. This one targets a cluster you run yourself, and adds the Kubernetes and Argo surface the other project has no reason to carry.
Why an MCP server and not a shell
The easy version of an on-call agent hands a model kubectl and a terminal. It demos well and is indefensible, because the agent's capability becomes "anything the kubeconfig can do", and the only thing standing between a hallucination and a deleted namespace is the model's judgement.
This inverts it. The agent gets a fixed set of typed tools and nothing else. What it is able to do becomes a code review question rather than a prompting question.
The layering is also the folder structure:
Layer | Enforced by | Where |
What the identity can do | the cluster | a ServiceAccount with read verbs only |
What the agent can express | this code |
|
What a human agreed to | runtime |
|
What happened | after the fact |
|
Related MCP server: mcp-devops-server
The property worth stating
The agent never writes to the cluster. It writes to Git.
Its ServiceAccount carries no write verbs at all, so mutation is unavailable to it even if every other layer fails. A change it proposes becomes a pull request against the config repository, which Argo CD then syncs and Argo Rollouts then canaries. Every safety mechanism the platform already has applies to the agent for free, and undoing it is git revert, exactly as it would be for a human.
Tools
Reads, no side effects:
Tool | Source | Returns |
| Prometheus | 5xx as a percentage of all requests, or |
| Prometheus | p95 request duration in seconds, or |
| Prometheus | cores per pod, against that pod's own limit |
| Prometheus | working-set MiB per pod, against that pod's own limit |
| Prometheus | root filesystem percent per node |
| Alertmanager, else Prometheus | firing alerts, worst severity first |
| Loki | log lines matching a substring in a window, labelled by pod |
| Kubernetes | phase, readiness, restarts, age, and what looks wrong |
| Kubernetes | recent warnings, within a recency window |
| Argo Rollouts | running image tag, canary step, whether traffic is fully shifted |
| Argo Rollouts | the verdict that advanced or aborted a canary, and why |
| Argo CD | sync status, health, target revision, last sync |
| GitHub | release tags across every application repo, newest first |
| GitHub | the diff for one commit |
| GitHub | history for one path |
Two of these carry a deliberate warning in their docstring, because the obvious
reading is wrong. Events are historical, so an event from hours ago may already
be resolved. And an Argo CD Application can read Synced while a rollout is
aborted, because Argo CD compares the spec and the refusal lives in the
rollout's status.
Writes, split in two so a single confused turn cannot act:
Propose | Confirm | Effect |
|
| open a pull request pinning one service to an older tag |
|
| open a pull request against the config repository |
propose_* has no side effect and returns a proposal id with a TTL. confirm_* refuses without a live id. Both ends are written to the audit log.
Planned, not built yet:
Source | Reads |
Tempo | traces and span timings |
A rollback is a one-line change to the environment's values file, not a
pipeline trigger: propose_rollback reads the tag pinned right now and returns
both ends of the move, so the human approving it sees v1.0.11 -> v1.0.9
before anything happens. The file is edited line-by-line rather than through a
YAML round-trip, which would reformat the whole file and bury a one-line change
in an unreadable diff.
Configuration
Every setting is an environment variable. Copy .env.example to .env and fill it in; the file documents each one.
The observability endpoints are addressed directly rather than through a Grafana datasource proxy, because in a cluster they are Services. That removes a hop, a dependency and a credential.
Variable | Required | Purpose |
| yes | Prometheus HTTP API |
| yes | Loki HTTP API |
| no | Alertmanager HTTP API. Unset falls back to Prometheus, which evaluates the alerts but cannot see silences |
| no | bearer sent to all three, for setups behind an auth proxy |
| yes | the one namespace the Kubernetes tools may read |
| no | where Argo CD runs, default |
| no | label that identifies the environment, default |
| no | maps the environment names the agent uses onto the label values your metrics carry |
| yes | fine-grained PAT, scoped to the repositories below and nothing else |
| yes | the config repository, where pull requests are opened |
| no | application repositories, which is where release tags live |
| no | values file per environment, |
| when not loopback | shared secret required on every request |
The namespace is configuration rather than a tool argument on purpose: the model chooses what to ask about, never what it has access to.
Running
python3 -m venv .venv && .venv/bin/pip install -e .
set -a && . ./.env && set +a
.venv/bin/gitops-oncall-mcpThe server speaks MCP over HTTP on MCP_PORT, default 8765. Point an MCP client at http://127.0.0.1:8765/mcp.
To develop against a real cluster from a laptop, port-forward Prometheus and Loki and set the URLs to localhost.
Development
python3 -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest -q
.venv/bin/ruff check .Tests use respx to record HTTP, so the suite needs no cluster and no credentials.
Licence
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Git-backed platform for skills, tools, and context for AI agents
Fail-closed policy guardrails for AI agents running kubectl, terraform, helm, and argocd.
- emisarOAuthdev.emisar
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
- SuperlogOAuthsh.superlog
Open-source agent that observes and fixes your application. Query logs, traces, metrics, incidents.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceAn AI SRE copilot for Kubernetes that lets LLM agents inspect cluster health and, with explicit human confirmation, restart or scale deployments.2-
- AlicenseBqualityBmaintenanceEnables AI agents to execute read-only DevOps operations including kubectl, terraform, helm, docker, and AWS cost analysis through natural language.11MIT
- FlicenseNot gradedqualityDmaintenanceA Kubernetes diagnostic agent that provides on-demand root cause analysis and human-in-the-loop remediation via Slack, using LLM reasoning with OPA-bounded security controls.1-
- AlicenseAqualityBmaintenanceEnables AI agents to safely inspect and execute version-controlled operational runbooks with policy checks, dry-run planning, and out-of-band approvals.3MIT