/ 디렉터리 / 플레이그라운드 / prometheus-mcp-server
● 커뮤니티 pab1it0 ⚡ 바로 사용

prometheus-mcp-server

제작: pab1it0 · pab1it0/prometheus-mcp-server

Query Prometheus in natural language — PromQL instant + range queries, target inspection, metric metadata, for AI-assisted SRE.

prometheus-mcp-server (pab1it0) exposes 6 tools over the Prometheus HTTP API. Supports PromQL queries, range queries, metrics discovery, and target health. Works with basic auth, bearer tokens, mTLS, and custom headers.

왜 쓰나요

핵심 기능

라이브 데모

실제 사용 모습

prometheus.replay ▶ 준비됨
0/0

설치

클라이언트 선택

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "prometheus": {
      "command": "uvx",
      "args": [
        "prometheus-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config 열기. 저장 후 앱 재시작.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "prometheus": {
      "command": "uvx",
      "args": [
        "prometheus-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cursor는 Claude Desktop과 동일한 mcpServers 스키마 사용. 프로젝트 설정이 전역보다 우선.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "prometheus": {
      "command": "uvx",
      "args": [
        "prometheus-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cline 사이드바의 MCP Servers 아이콘 클릭 후 "Edit Configuration" 선택.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "prometheus": {
      "command": "uvx",
      "args": [
        "prometheus-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Claude Desktop과 같은 형식. Windsurf 재시작 후 적용.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "prometheus",
      "command": "uvx",
      "args": [
        "prometheus-mcp-server"
      ]
    }
  ]
}

Continue는 맵이 아닌 서버 오브젝트 배열 사용.

~/.config/zed/settings.json
{
  "context_servers": {
    "prometheus": {
      "command": {
        "path": "uvx",
        "args": [
          "prometheus-mcp-server"
        ]
      }
    }
  }
}

context_servers에 추가. 저장 시 Zed가 핫 리로드.

claude mcp add prometheus -- uvx prometheus-mcp-server

한 줄 명령. claude mcp list로 확인, claude mcp remove로 제거.

사용 사례

실전 활용법: prometheus-mcp-server

How to diagnose a latency spike with Prometheus + Claude

👤 On-call SREs ⏱ ~10 min intermediate

언제 쓸까: A service p99 alert fires — you need context without memorizing PromQL.

사전 조건
  • Prometheus URL reachable — Set PROMETHEUS_URL in the MCP config; add auth if protected
흐름
  1. Scope the spike
    Query http request p99 latency for service X in the last hour, 30-second resolution. Compare to the last 7 days baseline.✓ 복사됨
    → Range query result showing the spike
  2. Find correlated metrics
    For the spike window, what other metrics for service X moved >2 sigma? CPU, memory, GC, queue depth?✓ 복사됨
    → Candidate culprit metrics
  3. Narrow by label
    Break down the spike by pod/host labels. Is it one pod or fleet-wide?✓ 복사됨
    → Per-label decomposition

결과: A hypothesis tied to specific metrics in under 5 minutes.

함정
  • Query returns no data — Check label names with list_metrics — label casing and delimiters vary between exporters
함께 쓰기: kubectl

Generate a weekly SLO compliance report from Prometheus

👤 SRE leads ⏱ ~25 min intermediate

언제 쓸까: Friday SLO review — you want numbers not vibes.

흐름
  1. Define the SLIs
    For service X, compute this week's availability (success/total ratio) and latency (requests under threshold / total) as numbers.✓ 복사됨
    → Two ratios with burn rate
  2. Compare to SLO
    Availability SLO = 99.9%, latency SLO = 95%. Am I above or below? Project error budget exhaustion.✓ 복사됨
    → Verdict + days of budget remaining

결과: Defensible SLO report with numbers not 'mostly fine'.

함께 쓰기: google-sheets

Audit Prometheus scrape target health with Claude

👤 Platform engineers ⏱ ~15 min intermediate

언제 쓸까: You suspect half your targets are down but haven't checked.

흐름
  1. Get targets
    Call get_targets. Group by job; which have any DOWN instances?✓ 복사됨
    → Table of job → up/down counts
  2. Investigate
    For the worst offender, show the lastError for the DOWN instances. Likely cause?✓ 복사됨
    → Actionable cause per target

결과: Rescued scrapes in minutes.

조합

다른 MCP와 조합해 10배 효율

prometheus + kubectl

Pair metric anomalies with pod state

For the service with the latency spike, correlate Prometheus data with kubectl describe on its pods.✓ 복사됨
prometheus + sentry

Metric spike + error spike correlation

Sentry shows errors doubled at 14:00 — what Prometheus metrics moved at the same time?✓ 복사됨

도구

이 MCP가 노출하는 것

도구입력언제 호출비용
health_check Verify connectivity 1 API call
execute_query query: promql, time? Instant snapshot 1 query
execute_range_query query, start, end, step Time-series analysis 1 query (may be expensive)
list_metrics match?: str Discovery when you don't know the metric name 1 API call
get_metric_metadata metric: str Understand units before computing 1 API call
get_targets Scrape health 1 API call

비용 및 제한

운영 비용

API 쿼터
Prometheus scales with your server; expensive queries can stress it
호출당 토큰
Range queries with many series can hit 10k+ tokens
금액
Free
Use step wisely on range queries; 10s resolution over 24h is 8640 samples per series

보안

권한, 시크릿, 파급범위

최소 스코프: read-only access to Prometheus API
자격 증명 저장: Bearer token or basic auth in env; mTLS cert paths if used
데이터 외부 송신: Your Prometheus URL only

문제 해결

자주 발생하는 오류와 해결

Query returns empty with no error

Metric/label name doesn't exist. Use list_metrics with a match prefix to verify

Range query times out

Reduce time range or increase step. Prometheus query engine has per-query resource limits

401 with bearer token

Token lacks read permission on /api/v1; check reverse proxy if Prometheus is behind one

확인: curl -H 'Authorization: Bearer $T' $PROMETHEUS_URL/api/v1/status/config

대안

prometheus-mcp-server 다른 것과 비교

대안언제 쓰나단점/장점
Grafana MCPYou already visualize in Grafana and want dashboard/alert opsHeavier; more features than you may need
Datadog MCPDatadog is your metrics storePaid; different query language

더 보기

리소스

📖 GitHub에서 공식 README 읽기

🐙 열린 이슈 보기

🔍 400+ MCP 서버 및 Skills 전체 보기