
Prometheus Mcp
io.github.mshegolev由 GitHub 帳號 mshegolev 發布v0.1.0更新於 Oct 24, 2026
Prometheus MCP — query metrics, inspect alerts, and explore scrape targets (read-only).
發布方自己的服務:Prometheus MCP
概覽
唯讀 MCP 伺服器,讓助理以 PromQL 查詢 Prometheus 指標、列出指標名稱、檢視作用中告警與抓取目標。
- 可以做什麼
- 依子字串篩選列出指標名稱,方便在查詢前了解可用指標(上限 500 筆)。執行即時 PromQL 查詢,回傳目前數值、標籤與結果類型。依時間範圍與步長執行 PromQL 範圍查詢,回傳帶時間戳的序列(上限 5000 個資料點)。列出作用中與待處理告警,含嚴重程度、狀態及 firing/pending 彙總。依工作、健康狀態與最近抓取資訊列出抓取目標,可依 active、dropped 或 any 篩選。
- 適用情境
- 適合在對話中讓助理排查既有 Prometheus 部署的指標、告警或抓取健康狀況,例如查看請求速率、CPU 趨勢、正在觸發的告警或哪些目標無法連線,而不必自行撰寫 API 呼叫。
- 執行需求
- 以 PyPI 套件形式透過 stdio 在本機執行(pip install prometheus-mcp 或 uvx prometheus-mcp)。需設定環境變數 PROMETHEUS_URL 指向伺服器位址,結尾不加斜線。可選驗證:PROMETHEUS_TOKEN(Bearer),或 PROMETHEUS_USERNAME 與 PROMETHEUS_PASSWORD(Basic)。自簽憑證可將 PROMETHEUS_SSL_VERIFY 設為 false。需要能連線至 Prometheus 伺服器的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Prometheus Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
prometheus-mcp
[PyPI version] [Python versions] [License: MIT] [Tests]
MCP server for Prometheus metrics and observability. Give Claude (or any MCP-capable agent) read access to your Prometheus instance — query metrics with PromQL, inspect active alerts, and explore scrape targets — without leaving the conversation.
Why another Prometheus MCP?
The existing Prometheus integrations require custom scripts or direct API knowledge. This server:
- Speaks the standard Model Context Protocol over stdio — works with Claude Desktop, Claude Code, Cursor, and any MCP client.
- Is read-only: all 5 tools carry
readOnlyHint: true— zero risk of modifying Prometheus data. - Returns dual-channel output: structured JSON (
structuredContent) for programmatic use + Markdown (content) for human-readable display. - Has actionable error messages that name the exact env var to fix and suggest a next step.
- Supports Bearer token, HTTP Basic auth, or no auth (common for internal deployments).
Tools
v4.0 Advanced Alert Correlation Features
Version 4.0 introduces powerful new capabilities for AI agents to autonomously investigate production errors:
Cross-Instance Alert Correlation
- Automatically identify related alerts across multiple Prometheus instances
- Group alerts by service identifiers to understand incident scope
- Detect cascading alert patterns with directional dependency inference
Root Cause Analysis
- Anomaly detection in metrics with automatic seasonality adjustment
- Dependency chain traversal from symptoms to potential root causes
- Change point detection correlating alerts with recent deployments or config changes
- Ranked root cause candidates based on evidence strength and impact analysis
Dependency Mapping & Health
- Dynamic service dependency maps built from traffic correlation analysis
- Cross-cluster dependency visualization showing service interoperation
- Synthetic health probing to assess dependency resilience
- Load shedding recommendations based on dependency fragility
Trend Analysis & Benchmarking
- Historical pattern recognition for recurring alert schedules
- Capacity forecasting to predict resource exhaustion
- MTTR benchmarking comparing resolution times against historical data
- Deviation detection triggering higher-priority notifications for pattern breaks
Integrated Analysis Tool
- New
federation_analyze_alertstool combining all v4.0 features - Unified output format optimized for AI agent consumption
- Comprehensive incident context in a single tool call
Installation
Or run directly without installing:
Configuration
All configuration is via environment variables:
Copy .env.example to .env and fill in your values.
Claude Desktop / Claude Code setup
Add to your MCP config (claude_desktop_config.json or .claude/mcp.json):
Or with uvx (no install required):
Docker
Example queries
Once configured, ask Claude:
- "What metrics does Prometheus have about HTTP requests?"
- "What is the current request rate for the payment service?"
- "Show me CPU usage over the last hour with 5-minute resolution"
- "Are there any firing alerts? What's their severity?"
- "Which scrape targets are currently down and why?"
- "How many node-exporter instances are up?"
Tool usage guide
prometheus_list_metrics
Returns all metric names Prometheus knows about. Use pattern to filter by substring (case-insensitive). Start here when you don't know which metrics are available. Output is capped at 500 metrics with a truncation hint.
prometheus_query
Execute an instant PromQL expression and get current values. Returns result type (vector/scalar/matrix/string), sample count, and per-sample labels and values.
Parameters:
query(required) — PromQL expression, e.g.up,rate(http_requests_total[5m])time(optional) — RFC3339 or Unix timestamp; defaults to now
prometheus_query_range
Execute a PromQL expression over a time window. Returns one series per matching time series with timestamped values. Total data points across all series are capped at 5000.
Parameters:
query(required) — PromQL expressionstart/end(required) — RFC3339 or Unix timestampsstep(required) — resolution like15s,1m,5m
Prometheus rejects steps that would produce > 11,000 points per series (HTTP 422). Increase step or narrow the range if this happens.
Note: The Prometheus range API does not support filtering by branch or commit — filters are expressed purely in PromQL label matchers.
prometheus_list_alerts
Returns all active/pending alerts with labels (including alertname, severity), state, activation time, and current value. Includes a state summary (firing vs pending counts).
prometheus_list_targets
Returns scrape targets with job name, instance address, health (up/down/unknown), last scrape duration in milliseconds, and any error message. Includes a per-job summary. Filter by state: active (default), dropped, or any.
Performance characteristics
- All tools use a single persistent
requests.Sessionwith connection pooling. - The session has
trust_env = Falseto bypass environment proxies (Prometheus is typically an internal service). - Requests time out after 30 seconds.
prometheus_query_rangecaps output at 5000 total points across all series — use a larger step for long windows.prometheus_list_metricsreturns up to 500 metrics after filtering.
Development
API Specification
This project includes an OpenAPI 3.0 specification in the specs/ directory that documents all MCP tools exposed by the server.
To validate the specification:
Automation
This repository includes automated scripts and GitHub Actions workflows to streamline the release process:
Scripts
scripts/auto-commit-push.sh- Automatically commit and push changes with optional release triggerscripts/release.sh- Full release automation including pipeline checking, version bumping, and tagging
GitHub Actions Workflows
post-push-check.yml- Monitors test pipeline status after each push and comments on the commitauto-release.yml- Manual workflow to create releases with version bumping (patch, minor, or major)
To trigger an automated release:
- Go to the Actions tab in GitHub
- Select "Auto Release" workflow
- Run the workflow with your preferred version bump type
License
MIT — see LICENSE.
來源:README.md,提交 8dd31b5
工具
0版本歷史
1- v0.1.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Prometheus 整合
Prometheus MCP
sv.prometheus官方發布者
Prometheus 提供的遠端 MCP 端點,讓 AI 助理在面向代理與創作者的知识網路中搜尋、評分和評論程式設計指南。

Prometheus MCP Server
由 GitHub 帳號 prometheus 發布
一個API完整的MCP伺服器,用於管理相容Prometheus的後端。AI 翻譯

Prometheus MCP Server
由 GitHub 帳號 tjhop 發布
讓助理查詢與檢視 Prometheus 相容後端的 MCP 伺服器:PromQL 查詢、標籤、序列、規則、告警、目標與文件。

Prometheus MCP Server
由 GitHub 帳號 pab1it0 發布
把 AI 助理連接到 Prometheus 伺服器,讓它能執行 PromQL 即時與範圍查詢,並瀏覽指標與抓取目標。

Mcp Prometheus
由 GitHub 帳號 jeanlopezxyz 發布
一個本機 MCP 伺服器,將助理連接到 Prometheus,使其能執行 PromQL 查詢並診斷 Kubernetes/OpenShift 叢集健康狀態。