Prometheus Alertmanager MCP Server

Prometheus Alertmanager MCP Server

site icon
2025.03.29 0
TypeScript警报管理AI集成开发效率
Prometheus Alertmanager MCP Server 是一个基于 Model Context Protocol (MCP) 的服务,用于集成 Prometheus Alertmanager 和 Claude AI。它作为一个桥梁,允许 Claude AI 通过标准化接口与 Alertmanager 交互和管理警报。
View on GitHub

Overview

基本能力

产品定位

Prometheus Alertmanager MCP Server 是一个中间件服务,旨在连接 Prometheus Alertmanager 和 Claude AI,提供警报管理和交互功能。

核心功能

  1. 警报检索:从 Alertmanager 获取并格式化当前警报,支持可选过滤功能。
  2. 警报详情:提供特定警报的详细信息,通过指纹引用。
  3. 静默管理:提供创建、列出和删除静默的工具,用于抑制特定警报的通知。
  4. 警报分组:检索由 Alertmanager 组织的警报组。

适用场景

  • 需要将 Prometheus Alertmanager 与 Claude AI 集成的场景。
  • 需要自动化管理和交互警报的场景。
  • 需要分析和响应警报的场景。

工具列表

  1. get-alerts:检索警报列表,支持过滤。
  2. get-alert-details:获取特定警报的详细信息。
  3. create-silence:为匹配条件的警报创建静默。
  4. get-silences:检索静默列表,支持过滤。
  5. delete-silence:按 ID 删除静默。
  6. get-alert-groups:获取警报组,支持过滤。

常见问题解答

  • 需要访问正在运行的 Prometheus Alertmanager 实例。
  • 需要 Node.js v18 或更高版本。

使用教程

使用依赖

  • 访问正在运行的 Prometheus Alertmanager 实例。
  • 安装 Node.js v18 或更高版本。

安装教程

  1. 使用 npm 直接运行: bash npx alertmanager-mcp
  2. 全局安装: bash npm install -g alertmanager-mcp alertmanager-mcp

调试方式

  1. 配置 Claude for Desktop 使用 MCP 服务器: json { "mcpServers": { "alertmanager": { "command": "docker", "args": [ "run", "--rm", "-i", "--network=host", "-e", "ALERTMANAGER_URL=http://your-alertmanager-url:9093", "ghcr.io/kaznak/alertmanager-mcp:latest" ], "env": {} } } }
  2. 重启 Claude for Desktop 以加载新配置。
  3. 使用自然语言与 Claude 交互:
  4. "Show me current alerts"
  5. "Filter alerts related to CPU issues"
  6. "Get details for this alert"
  7. "Create a silence for this alert for the next 2 hours"

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。