Prometheus MCP logo

Prometheus MCP

Read-only Prometheus access over MCP for PromQL queries, alert inspection, metric discovery, and scrape-target checks.

Install Prometheus MCP

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "prometheus-mcp": {
      "command": "uvx",
      "args": [
        "prometheus-mcp"
      ],
      "env": {
        "PROMETHEUS_URL": "YOUR_VALUE_HERE",
        "PROMETHEUS_TOKEN": "YOUR_VALUE_HERE",
        "PROMETHEUS_USERNAME": "YOUR_VALUE_HERE",
        "PROMETHEUS_PASSWORD": "YOUR_VALUE_HERE",
        "PROMETHEUS_SSL_VERIFY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 21 tools correctly (3d ago).

Overview

The prometheus-mcp MCP server gives MCP-compatible agents read-only access to a Prometheus instance through five tools. It sends requests to Prometheus's HTTP API for metric discovery, instant and range PromQL queries, alert inspection, and scrape-target status. Configuration uses environment variables, with Bearer token, Basic auth, or unauthenticated connections supported. Reach for it when an agent needs to investigate metrics or monitoring state without changing Prometheus data.

Use cases

  • Discover metrics for a service
  • Run instant PromQL checks
  • Review firing and pending alerts
  • Find unhealthy scrape targets
  • Inspect historical metric trends

Key features

  • Read-only Prometheus access
  • Instant and range PromQL queries
  • Metric-name filtering
  • Alert state inspection
  • Scrape-target health details
  • Bearer and Basic authentication

Tools21

What Prometheus MCP lets your agent do. Expand a tool for its parameters.

Verified live~7.6k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 3d ago

Recent health check succeeded.

6/6 checks healthy over the last 41d

What it can do

From the 21 tools this server returned when we ran it; 21 declare their own safety hints.

Runs commands · 2Makes network requests · 20Read-only tools · 19
Network at startup2 connections
Files written at startup30

Observed 2026-10-20 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 13d ago via OSV.dev · prometheus-mcp (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit2mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed21Callable tools this server registers over MCP.
Directory activity5 viewsConfig copies, upvotes, and views on AllMCPs.

How Prometheus MCP works

What prometheus-mcp does

The prometheus-mcp MCP server exposes selected Prometheus read operations to an MCP client. Agents can discover available metric names, run PromQL expressions, review alerts, and inspect scrape targets without using Prometheus's web interface or manually constructing API requests.

The server is read-only. Its five tools map to Prometheus HTTP API endpoints and do not modify metrics, rules, alerts, or target configuration. Results include structured data for programmatic handling and Markdown output for conversational display.

How it works

The server communicates with Prometheus over HTTP using one persistent Python requests.Session, which enables connection pooling. Requests have a 30-second timeout, and the session does not use environment proxy settings. Prometheus responses are converted into MCP tool results.

prometheus_list_metrics retrieves metric names and can apply a case-insensitive substring filter. Results are limited to 500 names. prometheus_query runs an instant PromQL expression, optionally at a supplied RFC3339 or Unix timestamp. prometheus_query_range evaluates PromQL over a start and end time with a required step and returns timestamped series data.

The alert tool reports active and pending alerts, including labels, state, activation time, and current value. The target tool reports scrape jobs and instance addresses with health, scrape duration, and error details. Targets can be filtered to active, dropped, or any state.

Setup and configuration

Install the prometheus-mcp MCP server from PyPI with pip install prometheus-mcp, or run it without installation using uvx prometheus-mcp. A Docker image can also be started with PROMETHEUS_URL supplied as an environment variable.

PROMETHEUS_URL is required and should identify the Prometheus server without a trailing slash. Authentication is optional: set PROMETHEUS_TOKEN for Bearer authentication, or provide PROMETHEUS_USERNAME and PROMETHEUS_PASSWORD for HTTP Basic authentication. A token takes precedence when both authentication methods are configured. Set PROMETHEUS_SSL_VERIFY=false when connecting to a server that uses a self-signed certificate.

For Claude Desktop or Claude Code, add a stdio entry that runs either the installed prometheus-mcp command or uvx with prometheus-mcp as its argument, then place the environment variables in that MCP configuration.

Tools and capabilities

The prometheus-mcp MCP server provides:

  • Metric-name discovery with an optional substring filter.
  • Instant PromQL evaluation with current or specified-time results.
  • Range PromQL evaluation with configurable resolution.
  • Active and pending alert inspection with state counts.
  • Scrape-target inspection with health, job, duration, and error information.

Range-query output is capped at 5,000 data points across all returned series. Prometheus may reject a query that would exceed 11,000 points per series; increasing the step or narrowing the time window addresses that condition.

Limitations and notes

The tools do not support writes, so they cannot alter Prometheus data or configuration. Range queries use PromQL label matchers for filtering; the range API does not provide branch or commit filters. Metric discovery is capped at 500 results after filtering, and long time windows may require a larger step. The server expects Prometheus to be reachable at the configured URL and does not route requests through environment proxies.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Prometheus MCP

prometheus-mcp is an MCP server that connects AI agents to a Prometheus instance through read-only tools for listing metrics, running instant and range PromQL queries, inspecting active and pending alerts, and examining scrape targets. It communicates over stdio and supports Bearer token, HTTP Basic, or no authentication.

Install it with `pip install prometheus-mcp`, or run it without installation using `uvx prometheus-mcp`. Docker is also supported by starting the image with `PROMETHEUS_URL` set.

Set `PROMETHEUS_TOKEN` for Bearer authentication, or set `PROMETHEUS_USERNAME` and `PROMETHEUS_PASSWORD` for HTTP Basic authentication. `PROMETHEUS_URL` is required, and the token takes precedence when both methods are configured.

Yes, prometheus-mcp works with Cursor through the standard MCP stdio transport. Configure Cursor to launch the installed `prometheus-mcp` command or `uvx prometheus-mcp`, and provide `PROMETHEUS_URL` plus any authentication variables.

No, prometheus-mcp is read-only. Its five tools query metrics, inspect alerts, and examine scrape targets, with no documented operations for changing Prometheus data or configuration.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPrometheus MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/prometheus-mcp?style=directory)](https://allmcps.com/mcp/prometheus-mcp)
HTML Embed
<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>