alertmanager-mcp-server

Apache 2.0
  • Linux
  • Apple

Integrations

  • Supports containerized deployment of the MCP server through Docker, with configuration via environment variables for connecting to Alertmanager instances.

  • Enables querying and managing Prometheus Alertmanager resources including status, alerts, silences, receivers, and alert groups. Supports creating new alerts, managing silences (create, update, delete), and retrieving alert information through the Alertmanager API v2.

目次

1. はじめに

Prometheus Alertmanager MCPは、Prometheus Alertmanager用のモデルコンテキストプロトコル(MCP)サーバーです。AIアシスタントやツールがプログラム的に、かつ安全にAlertmanagerリソースを照会・管理することを可能にします。

2. 特徴

  • [x] Alertmanagerのステータス、アラート、サイレンス、レシーバー、アラートグループのクエリ
  • [x] サイレンスの作成、更新、削除
  • [x] 新しいアラートを作成する
  • [x] 認証サポート(環境変数経由の基本認証)
  • [x] Dockerコンテナ化のサポート

3. クイックスタート

3.1. 前提条件

  • Python 3.12以上
  • uv (高速な依存関係管理用)。
  • Docker (オプション、コンテナ化されたデプロイメント用)。
  • この MCP サーバーを実行する環境から Prometheus Alertmanager サーバーにアクセスできることを確認します。

3.2. ローカル実行

  • リポジトリをクローンします。
# Clone the repository $ git clone https://github.com/ntk148v/alertmanager-mcp-server.git
  • .env ファイルまたはシステム環境変数を使用して、Prometheus サーバーの環境変数を構成します。
# Set environment variables (see .env.sample) ALERTMANAGER_URL=http://your-alertmanager:9093 ALERTMANAGER_USERNAME=your_username # optional ALERTMANAGER_PASSWORD=your_password # optional
  • サーバー設定をクライアント設定ファイルに追加します。例えば、Claude Desktopの場合は以下のようになります。
{ "mcpServers": { "alertmanager": { "command": "uv", "args": [ "--directory", "<full path to alertmanager-mcp-server directory>", "run", "src/alertmanager_mcp_server/server.py" ], "env": { "ALERTMANAGER_URL": "http://your-alertmanager:9093s", "ALERTMANAGER_USERNAME": "your_username", "ALERTMANAGER_PASSWORD": "your_password" } } } }

3.3. Docker 実行

  • 事前にビルドされたイメージで実行します (または自分でビルドすることもできます)。
$ docker run -e ALERTMANAGER_URL=http://your-alertmanager:9093 \ -e ALERTMANAGER_USERNAME=your_username \ -e ALERTMANAGER_PASSWORD=your_password \ -p 8000:8000 ghcr.io/ntk148v/alertmanager-mcp-server
  • Claude Desktop で Docker を実行する:
{ "mcpServers": { "alertmanager": { "command": "docker", "args": [ "run", "--rm", "-i", "-e", "ALERTMANAGER_URL", "-e", "ALERTMANAGER_USERNAME", "-e", "ALERTMANAGER_PASSWORD", "ghcr.io/ntk148v/alertmanager-mcp-server:latest" ], "env": { "ALERTMANAGER_URL": "http://your-alertmanager:9093s", "ALERTMANAGER_USERNAME": "your_username", "ALERTMANAGER_PASSWORD": "your_password" } } } }

この構成では、変数名のみを指定した-eフラグを使用し、 envオブジェクトに実際の値を指定して、Claude Desktop から Docker コンテナーに環境変数を渡します。

4. ツール

MCP サーバーは、API v2に従って、Alertmanager を照会および管理するためのツールを公開します。

  • ステータスを取得する: get_status()
  • アラートの一覧表示: get_alerts()
  • 無音部分を一覧表示する: get_silences()
  • 無音部分を作成: post_silence(silence_dict)
  • 無音部分を削除: delete_silence(silence_id)
  • 受信者の一覧を取得する: get_receivers()
  • アラートグループの一覧表示: get_alert_groups()

完全な API の詳細については、src/alertmanager_mcp_server/server.pyを参照してください。

5. 開発

貢献を歓迎します!ご提案や改善点がありましたら、問題を報告するか、プルリクエストを送信してください。

このプロジェクトは依存関係の管理にUVを使用しています。お使いのプラットフォームの指示に従ってUVをインストールしてください。

# Clone the repository $ git clone https://github.com/ntk148v/alertmanager-mcp-server.git $ uv venv $ source .venv/bin/activate # On Unix/macOS $ .venv\Scripts\activate # On Windows $ uv pip install -e . # run test $ pytest

6. ライセンス

アパッチ 2.0


You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

アラートマネージャーMCPサーバー

  1. はじめに
    1. 特徴
      1. クイックスタート
        1. 3.1. 前提条件
        2. 3.2. ローカル実行
        3. 3.3. Docker 実行
      2. ツール
        1. 開発
          1. ライセンス

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A simple MCP server that can send notifications on mac devices.
              Last updated -
              5
              9
              8
              TypeScript
              MIT License
              • Apple
            • -
              security
              A
              license
              -
              quality
              The MCP server that keeps you informed by sending the notification on phone using ntfy.sh
              Last updated -
              18
              6
              JavaScript
              Apache 2.0
              • Linux
              • Apple

            View all related MCP servers

            ID: oblhy82ylg