Prometheus MCP Server
Model Context Protocol 这是一个基于Golang开发的Prometheus-MCP-Server,目前只支持sse运行模式

功能
- [x] Prometheus MCP Tools
- [x] 列出可用指标 (prometheus_list_metrics)
- [x] 发现并探索指标 (prometheus_get_targets)
- [x] 获取特定指标的元数据 (prometheus_get_metric_metadata)
- [x] 查看即时查询结果 (prometheus_execute_query)
- [x] 查看不同步长间隔的范围查询结果 (prometheus_execute_range_query)
- [x] 查看最近时长查询结果 (prometheus_execute_last_query)
- [x] 支持身份验证
- [x] 通过环境变量进行基本身份验证
- [x] 通过环境变量进行 Bearer Token 身份验证
- [x] 支持 Docker 容器化
使用方法
-
确保你的prometheus-mcp-server容器可以与prometheus-server通信.
-
使用以下命令运行prometheus-mcp-server容器
# 默认以sse方式运行mcp-server (prometheus无认证)
# 如需stdio模式,请自行将 MCP_SERVER_TRANSPORT=sse 修改为 MCP_SERVER_TRANSPORT=stdio
docker run -d --name prometheus-mcp-server \\
-e PROMETHEUS_URL=http://your-prometheus-server:9090 \\
-e MCP_SERVER_TRANSPORT=sse \\
shaxiaozz/prometheus-mcp-server:latest
# 默认以sse方式运行mcp-server (prometheus basic auth)
# 如需stdio模式,请自行将 MCP_SERVER_TRANSPORT=sse 修改为 MCP_SERVER_TRANSPORT=stdio
docker run -d --name prometheus-mcp-server \\
-e PROMETHEUS_URL=http://your-prometheus-server:9090 \\
-e PROMETHEUS_USERNAME=your_username \\
-e PROMETHEUS_PASSWORD=your_password \\
-e MCP_SERVER_TRANSPORT=sse \\
shaxiaozz/prometheus-mcp-server:latest
# 默认以sse方式运行mcp-server (prometheus token auth)
# 如需stdio模式,请自行将 MCP_SERVER_TRANSPORT=sse 修改为 MCP_SERVER_TRANSPORT=stdio
docker run -d --name prometheus-mcp-server \\
-e PROMETHEUS_URL=http://your-prometheus-server:9090 \\
-e PROMETHEUS_TOKEN=your_token \\
-e MCP_SERVER_TRANSPORT=sse \\
shaxiaozz/prometheus-mcp-server:latest
- 将服务器配置添加到客户端配置文件中。例如,Cursor Desktop:
url可直接通过命令: docker logs prometheus-mcp-server 查看
{
"mcpServers": {
"prometheus-mcp-server": {
"url": "http://10.0.0.1:8000/sse"
}
}
}

构建镜像
git clonse https://github.com/shaxiaozz/prometheus-mcp-server.git && cd prometheus-mcp-server
docker build -t prometheus-mcp-server .
致谢
License
GNU v3.0
Recommend MCP Servers 💡
fitbit-mcp
MCP implementation for Fitbit to enable AI assistants access to health and fitness data
ntfy-mcp
Welcome to ntfy-mcp, the MCP server that keeps you caffeinated and informed! 🚀☕️ This handy little server integrates with the Model Context Protocol to send you delightful ntfy notifications whenever your AI assistant completes a task. Because let's face it - you deserve that tea break while your code writes itself.
amap-mcp-server
高德地图MCP Server,提供地理编码、位置服务、路线规划等地图相关工具,支持stdio、sse和streamable-http传输方式
@oevortex/ddg_search
A MCP server for web search and AI-powered responses using DuckDuckGo and Felo AI, supporting URL content and metadata extraction.
@atonomus/mcp-servers-search
An MCP server that provides tools for querying and discovering available MCP servers
@hannesrudolph/mcp-ragdocs
An MCP server implementation that provides tools for retrieving and processing documentation through vector search, enabling AI assistants to augment their responses with relevant documentation context.