Prometheus MCP β query metrics, inspect alerts, and explore scrape targets (read-only).
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
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.
The existing Prometheus integrations require custom scripts or direct API knowledge. This server:
readOnlyHint: true β zero risk of modifying Prometheus data.structuredContent) for programmatic use + Markdown (content) for human-readable display.| Tool | Endpoint | Description |
|---|---|---|
prometheus_list_metrics | GET /api/v1/label/__name__/values | List all metric names with optional substring filter (cap 500) |
prometheus_query | GET /api/v1/query | Execute an instant PromQL query |
prometheus_query_range | GET /api/v1/query_range | Execute a PromQL range query returning time-series |
prometheus_list_alerts | GET /api/v1/alerts | List active and pending alerts |
prometheus_list_targets | GET /api/v1/targets | List scrape targets by health and job |
Version 4.0 introduces powerful new capabilities for AI agents to autonomously investigate production errors:
federation_analyze_alerts tool combining all v4.0 featuresOr run directly without installing:
All configuration is via environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
PROMETHEUS_URL | Yes | β | Prometheus server URL, e.g. https://prometheus.example.com (no trailing slash) |
PROMETHEUS_TOKEN | No | β | Bearer token (takes precedence over Basic auth) |
PROMETHEUS_USERNAME | No | β | HTTP Basic auth username |
PROMETHEUS_PASSWORD | No | β | HTTP Basic auth password |
PROMETHEUS_SSL_VERIFY | No | true | Set false for self-signed certificates |
Copy .env.example to .env and fill in your values.
Add to your MCP config (claude_desktop_config.json or .claude/mcp.json):
Or with uvx (no install required):
Once configured, ask Claude:
prometheus_list_metricsReturns 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_queryExecute 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 nowprometheus_query_rangeExecute 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 like 15s, 1m, 5mPrometheus 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_alertsReturns 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_targetsReturns 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.
requests.Session with connection pooling.trust_env = False to bypass environment proxies (Prometheus is typically an internal service).prometheus_query_range caps output at 5000 total points across all series β use a larger step for long windows.prometheus_list_metrics returns up to 500 metrics after filtering.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:
This repository includes automated scripts and GitHub Actions workflows to streamline the release process:
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 taggingpost-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:
MIT β see LICENSE.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/prometheus-mcp)<a href="https://allmcps.com/mcp/prometheus-mcp"><img src="https://allmcps.com/api/badge/prometheus-mcp?style=directory" alt="Prometheus MCP on AllMCPs" /></a>