Mcp Alertmanager

io.github.jeanlopezxyz由 GitHub 帳號 jeanlopezxyz 發布v2.1.1更新於 Oct 24, 2026

A Model Context Protocol (MCP) server for Prometheus Alertmanager

概覽

AI 產生的概覽

針對 Prometheus Alertmanager 的 MCP 伺服器,讓助理讀取告警、檢視靜默與接收器,並建立或刪除靜默。

可以做什麼
查詢告警,包括分組檢視、僅嚴重告警,以及含嚴重等級計數與命名空間的彙總。依狀態列出靜默、為告警建立靜默,或依 ID 刪除靜默。檢視 Alertmanager 狀態、版本、叢集資訊與已設定的通知接收器。深入調查特定告警、檢視告警歷史,並依共用標籤找出相關告警。
適用情境
適合在執行 Prometheus Alertmanager(直接部署或在 OpenShift/Kubernetes 中)時使用,讓助理在事故期間分流告警、彙總告警狀態,或設定與清除靜默。
執行需求
需要本機執行環境來執行 npm 套件(透過 npx)或 Go 二進位檔。需要能存取 Alertmanager 端點:透過 ALERTMANAGER_URL 環境變數或 --url 參數指定,或使用 kubeconfig 或叢集內設定自動連線至 Kubernetes 中的 alertmanager 服務。
安裝前請注意
建立與刪除靜默會改變線上告警行為,可能抑制通知,讓助理執行前應先確認。Kubernetes 自動連線會使用你的 kubeconfig 或叢集內憑證,伺服器將以這些權限運作。預設透過 https 連線至叢集服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Alertmanager,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Alertmanager MCP Server (Go)

[License: MIT] [npm version] [Go] [GitHub release]

A Model Context Protocol (MCP) server for Prometheus Alertmanager integration. Native Go binary with built-in Kubernetes connectivity via client-go.

Installation

npx

bash
npx -y mcp-alertmanager@latest

MCP Client Configuration

Add to your MCP client configuration (VS Code, Cursor, Windsurf, etc.):

json
{  "mcpServers": {    "alertmanager": {      "command": "npx",      "args": ["-y", "mcp-alertmanager@latest"],      "env": {        "ALERTMANAGER_URL": "http://localhost:9093"      }    }  }}

VS Code

shell
code --add-mcp '{"name":"alertmanager","command":"npx","args":["-y","mcp-alertmanager@latest"],"env":{"ALERTMANAGER_URL":"http://localhost:9093"}}'

Kubernetes Auto-Connect

Automatically connects to Alertmanager running in OpenShift/Kubernetes via the K8S API service proxy. Uses native kubeconfig/in-cluster config via client-go. No kubectl or port-forwarding required.

Default: openshift-monitoring/alertmanager-operated:9093

json
{  "mcpServers": {    "alertmanager": {      "command": "npx",      "args": ["-y", "mcp-alertmanager@latest"]    }  }}

Binary

Download from GitHub Releases or build from source:

bash
make build./mcp-alertmanager

Configuration

Environment Variables

VariableDescription
ALERTMANAGER_URLDirect Alertmanager API URL (overrides K8S auto-connect)

CLI Flags

FlagDescriptionDefault
--urlDirect Alertmanager URL-
--namespaceKubernetes namespaceopenshift-monitoring
--serviceKubernetes service namealertmanager-operated
--service-portKubernetes service port9093
--service-schemeService scheme (http/https)https
--kubeconfigPath to kubeconfig fileauto-detect

Precedence: --url / ALERTMANAGER_URL > K8S auto-connect

Connection strategy:

  1. Direct URL (if --url or ALERTMANAGER_URL is set)
  2. K8S API proxy (auto-detect kubeconfig or in-cluster config)

Tools (12)

Alerts

ToolDescription
getAlertsGet alerts with optional filters
getAlertGroupsGet alerts grouped by routing labels
getCriticalAlertsGet critical severity alerts only
getAlertingSummarySummary: counts by severity, top alerts, namespaces

Silences

ToolDescription
getSilencesList silences by state
createSilenceCreate a silence for an alert
deleteSilenceDelete a silence by ID

Status

ToolDescription
getAlertmanagerStatusServer status, version, cluster info
getReceiversList notification receivers

Troubleshooting

ToolDescription
investigateAlertDeep investigation of a specific alert
getAlertHistoryAlert history and analysis guidance
correlateAlertsFind correlated alerts by shared labels

Example Prompts

"What alerts are currently firing?""Are there any critical alerts?""Give me a summary of the alerting status""Investigate the HighMemoryUsage alert""Create a 2-hour silence for PodCrashLooping""What receivers are configured?""Find correlated alerts to identify the root cause""Show me alert history for KubeNodeNotReady"

Development

Build

bash
make build              # Build for current platformmake build-all-platforms # Cross-compile for all platforms

Container

bash
podman build -f Containerfile -t mcp-alertmanager .

Kubernetes / OpenShift Deployment

Container Image

The container image is available on GitHub Container Registry:

ghcr.io/jeanlopezxyz/mcp-alertmanager:latest

Helm Chart

Deploy using the included Helm chart:

bash
# Add the chart repository (or use local chart)helm upgrade --install mcp-alertmanager ./charts/mcp-alertmanager \  --namespace mcp-servers \  --create-namespace \  --set openshift=true
Helm Values
ParameterDescriptionDefault
image.registryContainer registryghcr.io
image.repositoryImage repositoryjeanlopezxyz/mcp-alertmanager
image.versionImage taglatest
openshiftEnable OpenShift Routesfalse
service.portService port8080
alertmanager.namespaceAlertmanager namespaceopenshift-monitoring
alertmanager.serviceAlertmanager service namealertmanager-operated
rbac.useClusterReaderUse cluster-reader roletrue
Example with custom Alertmanager
bash
helm upgrade --install mcp-alertmanager ./charts/mcp-alertmanager \  --namespace mcp-servers \  --set openshift=true \  --set alertmanager.url=http://alertmanager.monitoring:9093

License

MIT

來源:README.md,提交 649cf0d

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v2.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分