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
:基本身份验证的密码(如果需要)
发展
安装依赖项:
构建服务器:
对于使用自动重建的开发:
安装
要与 Claude Desktop 一起使用,请添加服务器配置:
在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json
调试
由于 MCP 服务器通过 stdio 进行通信,调试起来可能比较困难。我们建议使用MCP Inspector :
检查器将提供一个 URL 来访问浏览器中的调试工具。
API结构
服务器通过以下 URI 结构公开 Prometheus 指标:
- 基本 URI:
http://your-prometheus-instance:9090
- 指标 URI:
http://your-prometheus-instance:9090/metrics/{metric_name}
每个指标资源返回包含以下内容的 JSON 数据:
- 指标名称
- 元数据(帮助文本、类型)
- 当前统计数据(计数、最小值、最大值)
Related MCP Servers
- -securityAlicense-qualityAn MCP server that enables Large Language Models to retrieve, analyze, and query metric data from Prometheus databases through pre-defined routes.Last updated -24PythonMIT License
- AsecurityFlicenseAqualityAn MCP server implementation that enables interaction with the Unstructured API, providing tools to list, create, update, and manage sources, destinations, and workflows.Last updated -3928
- AsecurityAlicenseAqualityProvides 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 -5111PythonMIT License
- AsecurityAlicenseAqualityA proof-of-concept Prometheus MCP server, which likely enables Claude AI to interact with Prometheus monitoring systems through the Model Context Protocol.Last updated -2PythonMIT License