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 分