Prometheus MCP Server
Prometheus 的 MCP 服务器
一个模型上下文协议 (MCP) 服务器,用于从 Prometheus 数据库检索数据。该 MCP 服务器支持大型语言模型 (LLM) 调用工具函数,这些函数可以通过预定义的路由检索和分析海量指标数据、搜索指标使用情况、执行复杂查询以及执行其他相关任务,并增强对使用情况的控制。
数据检索:从 Prometheus 获取特定指标或数据范围。
指标分析:对检索到的指标执行统计分析。
使用情况搜索:查找并探索指标使用模式。
复杂查询:执行高级 PromQL 查询以进行深入数据探索。
能力
✅ 从 Prometheus 检索全面的指标信息,包括名称和描述
✅ 使用指标名称获取并分析特定指标数据
✅ 分析自定义时间范围内的指标数据
🚧 使用特定标签过滤和匹配数据(正在开发中)
⏳ 计划中的附加功能...
Related MCP server: Proms MCP Server
入门
MCP 运行需要一个 python 虚拟环境(venv),所有包都应安装到此 venv 中,以便 MCP 服务器可以自动启动。
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 Prometheus MCP 服务器:
npx -y @smithery/cli install @CaesarYangs/prometheus_mcp_server --client claude手动安装
准备python环境
cd ./src/prometheus_mcp_server
python3 -m venv .venv# linux/macos:
source .venv/bin/activate
# windows:
.venv\Scripts\activate然后它就可以用作专用的 python 环境了。
安装所需的软件包
确保 pip 已正确安装。如果您的 venv 没有安装 pip,请使用以下命令手动安装:
wget https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py然后安装所有必需的软件包:
pip install -r requirements.txt用法
使用光标环境
准备更新依赖于更易于使用的Cursor环境。
在“光标设置”的 MCP 部分中进行设置:
uv --directory /path/to/prometheus_mcp_server run server.py
配合MCP客户端(含Claude Desktop)
在~/Library/Application Support/Claude/claude_desktop_config.json (macos) 配置您的 Claude Desktop 应用程序的配置
{
"mcpServers": {
"prometheus": {
"command": "uv",
"args": [
"--directory",
"/path/to/prometheus_mcp_server",
"run",
"server.py"
],
"env": {
"PROMETHEUS_HOST": "http://localhost:9090"
}
}
}
}独立 MCP 服务器
单独启动此 MCP 服务器:
紫外线法
uv --directory /path/to/prometheus_mcp_server run server.py这也是一种确保此 MCP 服务器可以自动启动的方法,因为 Claude Desktop 使用这种 ux 脚本方式在应用程序启动时启动。
常规 Python 方法
python3 server.py贡献
欢迎贡献!以下是快速指南:
复制仓库
创建你的功能分支(
git checkout -b feature/AmazingFeature)提交您的更改(
git commit -m 'Add some AmazingFeature')推送到分支(
git push origin feature/AmazingFeature)打开拉取请求
对于重大更改,请先打开一个问题来讨论您想要更改的内容。
感谢您的贡献!
执照
MIT 许可证
参考文献与致谢
该项目受到以下开源项目的启发或使用了以下开源项目的代码:
Prometheus API Client - 基于此库修改了Prometheus API调用代码
MySQL MCP 服务器- 类似面向数据库的 MCP 服务器实现
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityFmaintenanceA Model Context Protocol server that enables AI assistants to query Prometheus metrics, discover available data, and analyze system performance through natural language interactions.576MIT
- AlicenseNot gradedqualityDmaintenanceA lean MCP server that provides LLM agents with transparent access to multiple Prometheus instances for metrics analysis and SRE operations.4GPL 2.0
- AlicenseNot gradedqualityCmaintenanceA Model Context Protocol server that enables AI agents to interact directly with Prometheus metrics data through natural language queries.MIT
- FlicenseNot gradedqualityCmaintenanceAn MCP server that enables autonomous self-healing AIOps by monitoring system metrics and executing dynamic remediation through LLM-driven tool routing, with support for Streamlit UI and CLI.
Related MCP Connectors
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/CaesarYangs/prometheus_mcp_server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server