AgentRecipes
Recipes › Engineering & security

How to diagnose Kubernetes alerts with an n8n agent and MCP servers

Engineering & securityn8n

The problem

When an alert fires at night, the on-call engineer spends the first minutes gathering context from several dashboards before they can start fixing anything.

Tools needed

Step-by-step recipe

  1. Point an Alertmanager webhook at an n8n workflow.
  2. Deduplicate alerts over a window (48 hours in the source) and fetch the triggering PromQL expression from the Prometheus Rules API.
  3. Let an AI agent investigate read-only through Kubernetes, Grafana, cloud and GitHub MCP servers plus a vector store of internal docs.
  4. Have it write a report: summary, event timeline, up to two root-cause hypotheses and troubleshooting steps.
  5. Find the original alert post in Mattermost and reply in its thread.

Copyable prompt

Prompt template
An alert fired: {{alert_name}} with expression {{promql}} and labels {{labels}}.
Investigate using the read-only tools available (Kubernetes, Grafana, docs). Do not change anything.
Reply with: 1) a one-paragraph summary, 2) a timeline of relevant events, 3) up to two root-cause hypotheses with the evidence for each, 4) next troubleshooting steps for the on-call engineer. If a tool call fails, retry once, then continue without it and say what's missing.

Original template written by AgentRecipes, not copied from the source. Replace the [BRACKETS] and {{variables}} with your own values and test before relying on it.

What the builder reported

The source gives no measured results; it describes the report format. The author was still weighing extra data sources such as database stats and pipeline status.

These are the source author's own claims. AgentRecipes has not tested or verified them.

Watch out for

Source

Original write-up: n8n Community forum ↗

Found via Agent Use Cases: “Diagnose Kubernetes alerts with MCP servers”. This recipe summarises the source in our own words; read the original for the full details. Link last checked 2026-10-15.

More engineering & security recipes

Review GitHub pull requests automatically with an n8n AI agentSmall teams want a first review pass on every pull request, checked against their own coding conventions, before a human looks.n8nMonitor new CVEs and get AI-scored alerts with n8nSecurity teams need to know quickly when a relevant vulnerability is published, without reading every advisory feed.n8n

New agent recipes in your inbox

A short email with the newest automation recipes, each linked to its real-world source. No spam, unsubscribe anytime.