Prometheus MCP 服务器
一个概念验证的Prometheus MCP服务器,它很可能使Claude AI能够通过模型上下文协议(Model Context Protocol)与Prometheus监控系统进行交互。
可用工具 (2 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
prometheus_query_range 4 个参数 需填 4 项
Query Prometheus /query_range API endpoint and return an image of a plot of the time series monitoring data. Use this tool whenever the user asks about the status of their compute infrastructure.
必填参数:query、start_time、end_time、step
prometheus_alert_rules
Query the Prometheus /rules API. Returns a list of alerting and recording rules that are currently loaded. In addition it returns the currently active alerts fired by the Prometheus instance of each alerting rule.
该工具无需必填参数,直接调用即可
服务介绍
Prometheus MCP
Prometheus MCP 服务器的概念验证。
先决条件
安装 uv:https://docs.astral.sh/uv/getting-started/installation/
使用 uv,你也可以安装 Python。
如何运行
克隆此仓库。
更新 .env 文件
uv add "mcp[cli]" pillow google-auth matplotlib requests python-dotenv
与 Claude 集成
你可以通过以下命令运行服务器:
uv --directory "/directory/to/prometheus-mcp" run server.py
这样你就可以将此 MCP 服务器添加到你的 Claude MCP 服务器配置中
{
"mcpServers": {
"Prometheus MCP": {
"command": "/path/to/uv",
"args": [
"--directory",
"/directory/to/prometheus-mcp",
"run",
"server.py"
]
}
}
}
有关 Claude 特定说明的更多详细信息,请参阅 MCP 快速入门。
