Skip to main content

Alertmanager MCP server

The Alertmanager MCP Server is a Model Context Protocol server for Prometheus Alertmanager incident triage, maintenance silence management, and routing tree introspection. It exposes 14 tools, 11 am:// resources, and 3 guided operational prompts with built-in blast-radius previews and duration caps to prevent overly broad silences.

Core capabilities​

Capability DomainWhat the Server Provides
On-Call Alert TriageFilters active alerts by label matchers, severity, state, and receiver; groups alerts natively and produces concise on-call shift summaries.
Safe Silence LifecycleEnforces dry-run blast-radius previews before creating broad silences, blocks duplicate active silences, caps maximum duration (24h default), and requires author/ticket attribution.
Routing Tree IntrospectionParses the full nested Alertmanager routing tree, enumerates receivers (PagerDuty, Slack, OpsGenie, webhook), simulates routing paths for arbitrary label sets, and audits unrouted default-route alerts.
Governance & ComplianceExports effective Alertmanager configurations as YAML/JSON, tracks silence creation/expiration history, and validates proposed silences against organizational policy.

How Prometheus and Alertmanager MCP servers work together​

Operational ConcernPrometheus MCP ServerAlertmanager MCP Server
Time-Series MetricsExecute PromQL, onboard /metrics, manage exporters—
Alerting RulesDraft, unit-test, simulate, and deploy PrometheusRule CRDs—
Firing Alerts—Triage, group, filter, and summarize active alerts
Maintenance Silences—Preview blast radius, create, extend, expire, and audit silences
Notification Routing—Simulate label routing, inspect receivers, and push test alerts

Architecture​

Quickstart​

1
Verify prerequisites

Ensure you have network access to a standalone or clustered Alertmanager HTTP API v2 endpoint (default port 9093).

2
Start the Alertmanager MCP Server container

Run the container pointing to your Alertmanager base URL:

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
3
Register the server in your MCP client

Add the endpoint to your MCP client configuration:

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

Security and silence guardrails​

  • Mandatory blast-radius preview: Always preview which active alerts match a proposed matcher set (am_preview_silence) before creating a production silence.
  • Test alert caution: Calling am_push_test_alert dispatches a real notification through your Alertmanager routing tree—target non-paging receivers when testing integrations.
  • Explicit backend_id scoping: Every tool invocation requires an explicit backend_id so silences are never created on the wrong cluster.

Project structure​

alertmanager-mcp-server/
├── alertmanager_mcp_server/
│ ├── tools/ # 14 MCP tools across 6 functional categories
│ ├── resources/ # 11 MCP resources (am:// URIs)
│ ├── prompts/ # 3 guided workflow prompts
│ ├── services/ # Alertmanager v2 HTTP API client service
│ ├── server/ # FastMCP server setup
│ ├── utils/ # Matcher evaluation and in-memory audit log
│ ├── models/ # Pydantic schemas
│ └── config.py # Multi-backend and silence policy configuration
├── tests/ # Automated test suite
├── Dockerfile
└── pyproject.toml