Skip to main content
Glama

mcp-server-prometheus

by loglmhq

mcp-服务器-prometheus

MCP 服务器用于与 Prometheus 指标和数据交互。

这是一个基于 TypeScript 的 MCP 服务器,实现了 Prometheus API 接口。它通过模型上下文协议 (MCP) 在 Claude 和你的 Prometheus 服务器之间架起了一座桥梁。

演示

演示

特征

资源

  • 列出并访问 Prometheus 指标架构
  • 每个指标资源提供:
    • 指标名称和描述
    • Prometheus 的详细元数据
    • 统计信息(计数、最小值、最大值)
  • 用于结构化数据访问的 JSON MIME 类型

当前能力

  • 列出所有可用的 Prometheus 指标及其描述
  • 阅读详细的指标信息,包括:
    • 元数据和帮助文本
    • 当前统计数据(计数、最小值、最大值)
  • 对安全 Prometheus 实例的基本身份验证支持

配置

服务器需要以下环境变量:

  • PROMETHEUS_URL :您的 Prometheus 实例的基本 URL

可选的身份验证配置:

  • PROMETHEUS_USERNAME :基本身份验证的用户名(如果需要)
  • PROMETHEUS_PASSWORD :基本身份验证的密码(如果需要)

发展

安装依赖项:

npm install

构建服务器:

npm run build

对于使用自动重建的开发:

npm run watch

安装

要与 Claude Desktop 一起使用,请添加服务器配置:

在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "mcp-server-prometheus": { "command": "/path/to/mcp-server-prometheus/build/index.js", "env": { "PROMETHEUS_URL": "http://your-prometheus-instance:9090" } } } }

调试

由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们建议使用MCP Inspector

npm run inspector

检查器将提供一个 URL 来访问浏览器中的调试工具。

API结构

服务器通过以下 URI 结构公开 Prometheus 指标:

  • 基本 URI: http://your-prometheus-instance:9090
  • 指标 URI: http://your-prometheus-instance:9090/metrics/{metric_name}

每个指标资源返回包含以下内容的 JSON 数据:

  • 指标名称
  • 元数据(帮助文本、类型)
  • 当前统计数据(计数、最小值、最大值)
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

MCP 服务器用于与 Prometheus 指标和数据交互。

  1. 演示
    1. 特征
      1. 资源
      2. 当前能力
    2. 配置
      1. 发展
        1. 安装
          1. 调试
        2. API结构

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            An MCP server that enables Large Language Models to retrieve, analyze, and query metric data from Prometheus databases through pre-defined routes.
            Last updated -
            24
            Python
            MIT License
            • Linux
            • Apple
          • A
            security
            F
            license
            A
            quality
            An MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.
            Last updated -
            39
            28
            • Apple
          • A
            security
            A
            license
            A
            quality
            Provides access to Prometheus metrics and queries through standardized Model Context Protocol interfaces, allowing AI assistants to execute PromQL queries and analyze metrics data.
            Last updated -
            5
            111
            Python
            MIT License
            • Linux
            • Apple
          • A
            security
            A
            license
            A
            quality
            A proof-of-concept Prometheus MCP server, which likely enables Claude AI to interact with Prometheus monitoring systems through the Model Context Protocol.
            Last updated -
            2
            Python
            MIT License

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/loglmhq/mcp-server-prometheus'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server