Prometheus Alertmanager

A Model Context Protocol (MCP) server that enables AI assistants to integreate with Prometheus Alertmanager
  • python

16

GitHub Stars

python

Language

6 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ntk148v-alertmanager-mcp-server": {
      "command": "python3",
      "args": [
        "-m",
        "src.alertmanager_mcp_server.server"
      ],
      "env": {
        "ALERTMANAGER_URL": "YOUR_ALERTMANAGER_URL",
        "ALERTMANAGER_TENANT": "YOUR_TENANT",
        "ALERTMANAGER_PASSWORD": "YOUR_PASSWORD",
        "ALERTMANAGER_USERNAME": "YOUR_USERNAME"
      }
    }
  }
}

Prometheus Alertmanager MCP enables you to query and manage Alertmanager resources through a programmable interface. It supports multi-tenant access, authentication, and smart pagination to keep interactions efficient when dealing with large sets of alerts, silences, and groups.

How to use

You can interact with Prometheus Alertmanager MCP using a client that speaks the MCP API. You’ll authenticate as needed, choose a tenant if your deployment uses multi-tenant access, and perform actions such as viewing status and alerts, creating or deleting silences, and querying alert groups. The MCP server returns paginated results so you can browse large collections in manageable chunks. Use per-request tenant switching when your environment hosts multiple tenants.

Typical use patterns include: log in with a username/password if enabled, fetch current alerts and their statuses, list active silences, create a silence for an ongoing issue, or retrieve details for a specific alert. When querying large lists, specify offset and count to page through results. The system respects a maximum page size to keep responses concise, and it indicates whether more pages are available.

To support multi-tenant setups, provide the tenant identifier either statically via configuration or per-request via the X-Scope-OrgId header. The header takes precedence over static settings, enabling dynamic tenant scoping per interaction.

How to install

Prerequisites you need before installing: Python 3.12 or newer, uv for dependency handling, and Docker if you plan to run in a container. Ensure your Prometheus Alertmanager instance is reachable from the environment where you install the MCP server.

Install via Smithery to obtain the MCP server client for Claude Desktop or other clients that support MCP.

Local run steps are shown below. Copy and paste each block exactly as written.

Local run

# Clone the repository
$ git clone https://github.com/ntk148v/alertmanager-mcp-server.git
# Change into the directory
$ cd alertmanager-mcp-server

Set environment variables for your Alertmanager connection. You can place these in a .env file or export them in your shell.

# Example environment variables
ALERTMANAGER_URL=http://your-alertmanager:9093
ALERTMANAGER_USERNAME=your_username  # optional
ALERTMANAGER_PASSWORD=your_password  # optional
ALERTMANAGER_TENANT=your_tenant_id   # optional, for multi-tenant setups

Run the MCP server locally using Python. You can enable a specific transport if you wish; the typical local command runs the module directly.

MCP_TRANSPORT=sse MCP_HOST=0.0.0.0 MCP_PORT=8080 python3 -m src.alertmanager_mcp_server.server

Docker run

Run a pre-built container image and pass the required environment values. This is convenient for quick experimentation.

$ docker run -e ALERTMANAGER_URL=http://your-alertmanager:9093 \
  -e ALERTMANAGER_USERNAME=your_username \
  -e ALERTMANAGER_PASSWORD=your_password \
  -e ALERTMANAGER_TENANT=your_tenant_id \
  -p 8000:8000 ghcr.io/ntk148v/alertmanager-mcp-server

Claude Desktop configuration example

If you want to wire the MCP server directly into Claude Desktop, you can define an MCP server entry that runs the component in a container or as a Python module. Below are two approaches shown for illustration. Use the approach that matches your environment.

{
  "mcpServers": {
    "alertmanager_py": {
      "command": "python3",
      "args": ["-m", "src.alertmanager_mcp_server.server"],
      "env": {
        "ALERTMANAGER_URL": "http://your-alertmanager:9093",
        "ALERTMANAGER_USERNAME": "your_username",
        "ALERTMANAGER_PASSWORD": "your_password",
        "ALERTMANAGER_TENANT": "your_tenant_id"
      }
    }
  }
}

Notes and tips

  • For environments with many alerts, silences, or alert groups, pagination reduces context size while preserving navigability. The default page size is limited to keep responses compact.

  • If you use multi-tenancy, prefer per-request tenant switching when supported by clients to simplify access control and data isolation.

Available tools

get_status

Get the current status of the MCP server and connectivity to Alertmanager.

get_alerts

List alerts with optional filters and pagination to avoid context overflow.

get_silences

List silences with pagination and optional filtering.

post_silence

Create a new silence in Alertmanager.

delete_silence

Delete a silence by its ID.

get_receivers

List configured Alertmanager receivers.

get_alert_groups

List alert groups with pagination and filters to limit context size.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational