Prometheus MCP 服务器
@qingshanyuluo
About Prometheus MCP 服务器
一个简化版的Prometheus MCP服务器,用于收集和暴露MCP服务器的指标
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"prometheus-mcp-server-qingshanyuluo": {
"command": "npx",
"args": [
"@modelcontextprotocol/inspector",
"node",
"build/index.js"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is Prometheus MCP 服务器?
Prometheus MCP 服务器是一个简化版的 MCP 服务器,用于查询 Prometheus 指标并提供 AI 分析。它通过 MCP 工具暴露 Prometheus 的查询能力,方便 AI 代理或客户端集成。
How to use Prometheus MCP 服务器?
设置环境变量 PROMETHEUS_URL 指定 Prometheus 端点,然后运行 go run cmd/server/main.go sse 启动服务器,默认监听 :8081 端口,通过 /sse 路径暴露 SSE 连接。MCP 客户端可通过配置 mcpServers 中的 url 为 http://localhost:8081/sse 连接使用。
Key features of Prometheus MCP 服务器
- 所有查询结果以 JSON 格式返回,便于 AI 解析
- 提供六个 MCP 工具用于指标搜索、标签查询和 PromQL 查询
- 支持即时查询和范围查询
- 范围查询可直接生成 base64 编码的 PNG 图表
- 支持正则表达式搜索指标名称
- 可选配置日志文件路径
Use cases of Prometheus MCP 服务器
- AI 代理通过自然语言对话查询 Prometheus 指标实时值
- 自动化监控告警场景中获取特定指标的标签和数值
- 生成过去一段时间内的指标趋势图表供 AI 分析
- 开发者通过 MCP 客户端快速探索 Prometheus 指标元数据
FAQ from Prometheus MCP 服务器
如何设置 Prometheus 地址?
通过环境变量 PROMETHEUS_URL 设置 Prometheus 端点,例如 export PROMETHEUS_URL=http://your-prometheus:9090。
服务器默认在哪个端口启动?
服务器默认在 :8081 端口启动,可通过代码或启动参数修改(当前默认固定)。
支持哪些 PromQL 查询类型?
支持即时查询(query)、范围查询(query_range)以及带图表的范围查询(query_chart)。
如何配置 MCP 客户端?
在 MCP 客户端配置文件中添加 mcpServers 项,指定 url 为服务器的 SSE 地址,例如 http://localhost:8081/sse。
查询结果以什么格式返回?
所有工具查询结果均以 JSON 格式返回,query_chart 额外返回 base64 编码的 PNG 图片。
More Developer Tools MCP servers
test
prysmaticlabsGo implementation of Ethereum proof of stake
test
cloudwegoThe ultimate LLM/AI application development framework in Go.
OpenSumi
opensumiA framework helps you quickly build AI Native IDE products. MCP Client, supports Model Context Protocol (MCP) tools via MCP server.
MCP-Scan: An MCP Security Scanner
invariantlabs-aiSecurity scanner for AI agents, MCP servers and agent skills.
MCP-Bridge
SecretiveShellA middleware to provide an openAI compatible endpoint that can call MCP tools
Comments