Get the FREE Ultimate OpenClaw Setup Guide →

alertmanager

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

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ntk148v-alertmanager-mcp-server uv --directory <full path to alertmanager-mcp-server directory> run src/alertmanager_mcp_server/server.py \
  --env ALERTMANAGER_URL="http://your-alertmanager:9093" \
  --env ALERTMANAGER_TENANT="your_tenant_id" \
  --env ALERTMANAGER_PASSWORD="your_password" \
  --env ALERTMANAGER_USERNAME="your_username"

How to use

Prometheus Alertmanager MCP exposes a programmable interface to interact with your Alertmanager instance. It supports querying status, listing alerts with smart pagination, managing silences (create, delete), creating new alerts, and retrieving receivers and alert groups. The server also supports multi-tenant usage via the X-Scope-OrgId header and optional Basic authentication. You can run it locally with uv (Python) and connect a client such as Claude Desktop to issue natural language requests like 'Show me current alerts' or 'Create a silence for this alert for the next 2 hours'. The API surface mirrors Alertmanager API v2 semantics while adding pagination to prevent overwhelming LLMs. To use it, configure your MCP client with the provided server entry (alertmanager) and supply environment variables for the target Alertmanager instance.

How to install

Prerequisites:\n- Python 3.12+\n- uv (for fast dependency management)\n- Docker (optional, for containerized deployment)\n- Access to a Prometheus Alertmanager instance reachable from the MCP server host\n\nInstall via Smithery (automatic installation for Claude Desktop):\n``` npx -y @smithery/cli install @ntk148v/alertmanager-mcp-server --client claude

\nLocal run (from source):\n1) Clone the repository:\n```
$ git clone https://github.com/ntk148v/alertmanager-mcp-server.git
  1. Set up environment variables (example):\n``` 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
3) Run the server directly (example using uvicorn):\n```
MCP_TRANSPORT=http  MCP_HOST=0.0.0.0 MCP_PORT=8000 python3 -m src.alertmanager_mcp_server.server
  1. Alternatively, use the provided Docker run example to start a container with the necessary environment variables.\n\nDocker Run: (see Docker section in README for exact command)\n``` 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
\nIf you prefer an all-in-one install on Claude Desktop, you can add the MCP server configuration to Claude with the provided mcp_config example and then restart Claude Desktop to load the new server.

Additional notes

Tips and notes:\n- The MCP server supports multi-tenant deployments; use ALERTMANAGER_TENANT or the X-Scope-OrgId header to scope requests.\n- Pagination is applied to alerts, silences, and alert groups to keep responses manageable for LLMs; adjust count/offset via client requests if needed.\n- For secure access, enable Basic auth and supply credentials through environment variables.\n- When using Docker, the README shows how environment variables are passed into the container via -e flags and an env map in the MCP config.\n- If you encounter connection errors, verify ALERTMANAGER_URL is reachable from the MCP server and that any required credentials are correct.\n- The transport layer can be stdio, http, or sse; http/sse require proper host/port configuration (MCP_HOST, MCP_PORT).

Related MCP Servers

Sponsor this space

Reach thousands of developers