Skip to main content

Alertmanager MCP Server

Python 3.12+ MCP License: Apache 2.0 Alertmanager GitHub Discord

Alertmanager is the notification brain of the Prometheus ecosystem — but operating it effectively requires deep knowledge. Understanding the routing tree to know who gets paged, creating silences with the right matchers and durations, auditing why an alert didn't reach the right receiver, and managing maintenance windows all require intimate familiarity with Alertmanager's configuration model. If you ask an AI assistant to help, it typically guesses at matcher syntax, creates overly broad silences, or can't explain the routing logic.

This server fixes that. It gives AI assistants (Claude, Cline, Cursor, or your own agent) structured, safe tools to operate Alertmanager natively. Instead of guessing at matchers or writing silence payloads from memory, your AI can now confidently manage the entire alert lifecycle:

  1. On-Call Triage. The AI summarizes active alerts grouped by severity and service, explains routing paths, and identifies alerts falling into the default route — all in one guided workflow.
  2. Safe Silence Management. Mandatory preview dry-runs before creating silences, duplicate detection, 24-hour duration caps, blast-radius warnings, and policy validation — preventing overly broad silences that could mask real incidents.
  3. Routing Introspection. Simulate routing for any label set, inspect the full routing tree, list receivers with integration types, and audit which alerts hit the default route.
  4. Governance & Compliance. Export effective configuration for Git storage, audit recent silence changes with author tracking, and validate proposed silences against organizational policy.
  5. Multi-Backend Support. Manage multiple Alertmanager backends with explicit backend_id on every call — no hidden defaults.

Key Features

Backend Discovery & Multi-Backend

  • Discover and inspect multiple Alertmanager backends
  • Health checks, version info, cluster peer status
  • Supports standalone and clustered Alertmanager deployments

Alert Triage & On-Call

  • List and filter alerts by label, severity, state, and receiver
  • Alert group inspection (Alertmanager's native grouping)
  • Human-readable on-call summaries with severity/service breakdowns
  • Push test alerts to verify notification integrations

Silence Lifecycle Management

  • Full CRUD: create, update (extend), expire silences
  • Mandatory preview dry-run before broad silences
  • Duplicate silence detection — blocks creating equivalent active silences
  • 24-hour duration cap (configurable)
  • LLM-friendly silence_alert helper with scope control (instance/service/env)
  • Policy validation for compliance checks

Routing & Notification Introspection

  • Full nested routing tree inspection
  • Receiver enumeration with integration type detection (Slack, PagerDuty, email, webhook)
  • Route simulation for any label set with human-readable explanations
  • Default route audit — identifies misconfigured alerts

Governance & Audit

  • Export effective configuration as YAML or JSON
  • Track recent silence lifecycle changes with author attribution
  • In-memory audit log for all MCP-initiated operations
  • Silence policy validation (duration caps, comment requirements, blast radius)

Architecture

The server translates high-level MCP requests into Alertmanager v2 API calls through a service layer.

How it works:

  1. An AI assistant connects via HTTP, SSE, or stdio
  2. The AI loads am://system/backends resource to discover available backends
  3. Every subsequent tool call requires an explicit backend_id — no hidden state
  4. The service layer interacts with Alertmanager's v2 HTTP API
  5. Safety guardrails enforce silence duration caps and blast-radius warnings

Relationship with Prometheus MCP Server

The Alertmanager and Prometheus MCP Servers are complementary:

ConcernPrometheus MCP ServerAlertmanager MCP Server
MetricsQuery, explore, onboard
Alert RulesDraft, test, simulate, deploy
Active AlertsTriage, summarize, filter
SilencesCreate, preview, expire, audit
RoutingInspect, simulate, audit
NotificationsReceiver enumeration, test alerts

Use both together for full observability coverage — Prometheus for the metric and rule layer, Alertmanager for the notification and silence layer.


Tech Stack

CategoryTechnologies
LanguagePython 3.12+
MCP FrameworkFastMCP ≥2.13.3
ProtocolModel Context Protocol (MCP)
AlertmanagerHTTP API v2 · Silence API · Route Simulation
TransportHTTP · SSE · Streamable-HTTP · stdio
InfrastructureDocker · uv

Quick Start

You'll need access to an Alertmanager instance (standalone or clustered).

Docker (recommended):

docker run --rm -it \
-p 8768:8768 \
-e ALERTMANAGER_BASE_URL=http://host.docker.internal:9093 \
-e MCP_TRANSPORT=http \
talkopsai/alertmanager-mcp-server:latest

Point your MCP client at it:

{
"mcpServers": {
"alertmanager": {
"url": "http://localhost:8768/mcp",
"description": "MCP Server for Alertmanager alert triage, silence management, and routing"
}
}
}

Security

  • Never expose the MCP server to the public internet without proper authentication
  • Silences affect real alert notifications — always preview before creating silences in production
  • Test alerts fire real notificationsam_push_test_alert will trigger downstream integrations (Slack, PagerDuty, email)
  • Configuration export may contain sensitive routing rules — treat exported configs as confidential

Project Layout

alertmanager-mcp-server/
├── alertmanager_mcp_server/
│ ├── tools/ # 14 MCP Tools across 6 categories
│ ├── resources/ # 11 MCP Resources (am:// URIs)
│ ├── prompts/ # 3 Guided workflow prompts
│ ├── services/ # Alertmanager HTTP API wrapper
│ ├── server/ # FastMCP setup
│ ├── utils/ # Matcher logic, audit log
│ ├── models/ # Pydantic data models
│ ├── exceptions/ # Custom exception hierarchy
│ ├── config.py # Environment parsing
│ └── main.py # Entry point
├── tests/ # Test suites
├── docs/ # Workflow guides & test documentation
├── Dockerfile
├── pyproject.toml
└── README.md

Next Steps

  • Configuration — Environment variables, Docker setup, multi-backend, silence safety
  • Tools — Full reference for all 14 MCP tools
  • Resources — 11 MCP resources for discovery and monitoring
  • Common Workflows — Step-by-step workflow guides
  • Examples — Quick reference and natural language prompts