Prometheus MCP server for querying metrics

Prometheus MCP server for querying metrics

prometheus-mcp-server-qingshanyuluo•byqingshanyuluo

A simplified Prometheus MCP server that lets AI systems query Prometheus metrics and run PromQL queries over SSE.

License: Not specified•Runtime: Awaiting documentation review•Category: cloud devops

WHAT IT DOES

  • •Exposes MCP tools for searching metric names by regular expression and inspecting a metric's labels and label values.
  • •Runs PromQL instant queries and range queries against Prometheus, returning results as JSON.
  • •Performs a range query and generates a chart image returned as base64-encoded PNG.

BEST FOR

  • •Letting AI assistants inspect available Prometheus metrics and their labels.
  • •Querying CPU usage or other metrics over a time window with PromQL.
  • •Producing chart visuals from Prometheus range queries for analysis.

ABOUT PROMETHEUS-MCP-SERVER-QINGSHANYULUO

Prometheus MCP server for querying metrics is cataloged as an MCP server attributed to qingshanyuluo. A simplified Prometheus MCP server that lets AI systems query Prometheus metrics and run PromQL queries over SSE. It is categorized under cloud devops. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Prometheus MCP server for querying metrics are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What does query_chart return?

It returns a chart image encoded as base64 PNG.

How are query results formatted?

All query results are returned in JSON format to make parsing easier for AI systems.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 62efc5879c47 · 采集于 2026-11-13 10:39:03 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Prometheus MCP 服务器

这是一个简化版的Prometheus MCP服务器,用于查询指标提供 ai 分析。

快速开始

启动

  1. 设置Prometheus地址环境变量:
export PROMETHEUS_URL=your_Prometheus_endpoint
  1. 启动服务器:
go run cmd/server/main.go sse

服务器将在:8081端口启动,可以通过以下URL访问:

  1. (可选) 设置日志文件路径:
export APP_LOG_FILE=/path/to/logfile.log

测试

npx @modelcontextprotocol/inspector node build/index.js

功能特性

AI友好化分析指标

  1. JSON格式输出:所有查询结果均以JSON格式返回,便于AI系统解析处理

MCP工具

  1. search_metrics - 按正则表达式搜索指标

    • 参数: pattern (指标名称模式,支持正则表达式)
    • 示例: http_.* 匹配所有以http_开头的指标
    • 返回: 匹配的指标名称列表(JSON格式)
  2. get_metric_labels - 获取指标的所有标签

    • 参数: name (指标名称)
    • 示例: http_requests_total
    • 返回: 该指标的所有标签列表(JSON格式,不包括__name__标签)
  3. get_metric_label_values - 获取指标标签的所有值

    • 参数:
      • name (指标名称)
      • label (标签名称)
    • 示例: 获取http_requests_total指标的method标签的所有值
    • 返回: 指定标签的所有值列表(JSON格式)
  4. query - 执行PromQL即时查询

    • 参数:
      • query (PromQL查询语句)
      • time (查询时间戳,格式为RFC3339或Unix时间戳,可选)
    • 示例: 查询当前CPU使用率
    • 返回: 查询结果(JSON格式)
  5. query_range - 执行PromQL范围查询

    • 参数:
      • query (PromQL查询语句)
      • start (开始时间,格式为RFC3339或Unix时间戳(毫秒))
      • end (结束时间,格式为RFC3339或Unix时间戳(毫秒))
      • step (查询步长,例如'15s'、'1m')
    • 示例: 查询过去1小时CPU使用率变化,每15秒一个数据点
    • 返回: 范围查询结果(JSON格式)
  6. query_chart - 执行PromQL范围查询并生成图表

    • 参数:
      • query (PromQL查询语句)
      • start (开始时间,格式为RFC3339或Unix时间戳(毫秒))
      • end (结束时间,格式为RFC3339或Unix时间戳(毫秒))
      • step (查询步长,例如'15s'、'1m')
      • title (图表标题,可选)
    • 示例: 查询过去1小时CPU使用率变化并生成图表
    • 返回: 图表图片(base64编码的PNG格式)

服务器端

  1. 设置Prometheus地址:
export PROMETHEUS_URL=your_Prometheus_endpoint
  1. 启动服务器:
go run cmd/server/main.go sse

服务器默认将在:8081端口暴露Prometheus指标。

mcp 客户端配置

配置示例:

{
  "mcpServers": {
    "products-sse": {
      "url": "http://localhost:8081/sse"
    }
  }
}

项目结构

.
├── cmd/           # 命令行程序入口
│   └── server/   # 服务器代码
├── internal/      # 内部实现
├── pkg/           # 可复用包
│   └── prometheus # Prometheus相关实现
└── go.mod         # Go模块定义

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Prometheus MCP server for querying metrics from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/prometheus-mcp-server-qingshanyuluo)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related cloud devops MCP Servers

Alternative and complementary servers in the same category

View all in cloud devops →
Huawei MCP Server
mcp-server-huaweiclouddeveloper•huaweiclouddeveloper

A Model Context Protocol server built on Huawei Cloud services that enables AI assistants to operate Huawei Cloud resources within conversational workflows, supporting ECS, OBS, GaussDB, and other cloud products.

Repository stats unavailable
Cloud & DevOps
Coolify MCP Server
coolify-mcp-server•wrediam

An MCP server that exposes the Coolify v4.3.1 REST API so AI clients can manage applications, databases, services, servers, deployments, and more.

Repository stats unavailable
Cloud & DevOps

A deprecated Model Context Protocol server for interacting with Kong Konnect APIs, enabling AI assistants to query and analyze Kong Gateway configurations, traffic, and analytics.

Repository stats unavailable
Cloud & DevOps