SuperAPIAI Directory

alertmanager-mcp-server

github.com · AI developer platforms

alertmanager-mcp-server is a Model Context Protocol (MCP) server for Prometheus Alertmanager that enables AI assistants and tools to securely query and manage Alertmanager resources programmatically. It supports querying status, alerts, silences, receivers, and alert groups, provides pagination to prevent large numbers of alerts from overflowing the LLM context window, and supports creating, updating, and deleting silences as well as creating new alerts. The project supports Basic authentication via environment variables, multi-tenancy (Mimir/Cortex) via ALERTMANAGER_TENANT, and provides Docker containerized deployment. Communication transports support stdio, http, and sse, with configurable host, port, and an optional Bearer API Key.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux · API

About this tool

Purpose: This project is a Model Context Protocol (MCP) server used to connect AI assistants with Prometheus Alertmanager, enabling AI to query and manage Alertmanager resources via natural language or tool calls.

Main capabilities:

  • Query Alertmanager status, alerts, silences, receivers, and alert groups.
  • Provide pagination support for alerts, silences, and alert groups to prevent large amounts of data from overflowing the LLM context window. Alerts default to 10 per page with a maximum of 25; silences default to 10 per page with a maximum of 50; alert groups default to 3 per page with a maximum of 5.
  • Create, update, and delete silences.
  • Create new alerts.
  • Support configuring Basic authentication via environment variables.
  • Support multi-tenancy (via ALERTMANAGER_TENANT, suitable for Mimir/Cortex); the tenant is fixed at startup and does not use the X-Scope-OrgId request header, to prevent clients from arbitrarily selecting tenants.
  • Support Docker containerized deployment.

Usage:

  • Prerequisites: uv is required for dependency management; Docker is optional, for containerized deployment; the environment running the MCP server must be able to access the Prometheus Alertmanager server.
  • Can be automatically installed for Claude Desktop via Smithery, or run locally after cloning the repository, or run using Docker.
  • Configure Prometheus server-related environment variables via a .env file or system environment variables.
  • The transport mode is controlled by MCP_TRANSPORT, with options stdio, http, sse, defaulting to stdio; in http/sse mode, the bind address and port are controlled by MCP_HOST (default 127.0.0.1) and MCP_PORT (default 8000).
  • MCP_API_KEY can be set as an optional Bearer/API Key; once set, all http/sse requests must carry Authorization: Bearer <key>, otherwise 401 is returned. When not set, the server warns at startup that the web transport is unauthenticated.
  • Security recommendation: deployments exposed to network access should always set MCP_API_KEY; By default, it binds only to the loopback address 127.0.0.1. If external access is needed, it should be exposed to 0.0.0.0 only behind a trusted proxy or firewall.
  • Command-line flags take precedence over environment variables. The stdio transport communicates via standard input and output and ignores host and port; the http (streamable HTTP) and sse transports are served through an ASGI application (uvicorn) and use the host and port configuration.
  • You can add the server configuration to a client configuration file (for example, Claude Desktop), or install it using the make command, and then restart Claude Desktop to load the configuration. After that, you can use natural language to have Claude interact with Alertmanager, for example "show current alerts", "filter alerts related to CPU issues", "get the details of this alert", "create a silence for this alert for the next 2 hours".
  • When running with Docker, you can use a prebuilt image or build it yourself; when running via Docker in Claude Desktop, you can use -e to pass only the variable names and provide the actual values in the env object.

Tool interface (follows Alertmanager API v2):

  • get_status(): get status.
  • get_alerts(filter, silenced, inhibited, active, count, offset): list alerts with pagination support, returning a structure containing data and pagination (total, offset, count, has_more).
  • get_silences(filter, count, offset): list silences with pagination support.
  • post_silence(silence_dict): create a silence.
  • delete_silence(silence_id): delete a silence.
  • get_receivers(): list receivers.
  • get_alert_groups(silenced, inhibited, active, count, offset): list alert groups with pagination support; because each group contains all alerts in the group, the pagination limit is lower.

Use cases: suitable for operations and monitoring scenarios that require an AI assistant to query alert status, filter alerts, view details, manage silences, and browse alert groups in a controlled manner, especially suitable forenvironments with a large number of alerts that require pagination to control context size.

Limitations: the materials do not provide specific charges, prices, performance metrics, or effectiveness data; the pagination limits are fixed (maximum 25 alerts, maximum 50 silences, maximum 5 alert groups); the multi-tenant tenant ID is fixed at startup and cannot be switched per request; network deployment requires configuring MCP_API_KEY yourself and paying attention to binding address security.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools