MCP Directory

Prometheus MCP Server

Run PromQL queries and analyze Prometheus metrics from any MCP client.

Verified
stdio (local)
No auth
Python

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
uvx prometheus-mcp-server

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "prometheus-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "PROMETHEUS_URL",
        "ghcr.io/pab1it0/prometheus-mcp-server:latest"
      ],
      "env": {
        "PROMETHEUS_URL": "<your-prometheus-url>"
      }
    }
  }
}

Requires Docker to be installed and running.

Before you start

  • A reachable Prometheus server URL, set via the PROMETHEUS_URL environment variable
  • Docker (recommended) — or Python 3.10+ with the uv package manager for a local install
  • An MCP-compatible client (Claude Desktop, VS Code, Cursor, Windsurf, etc.)
  • Optional credentials only if your Prometheus is secured: basic auth (PROMETHEUS_USERNAME/PASSWORD), bearer token (PROMETHEUS_TOKEN), mTLS client cert/key, or custom headers

About Prometheus MCP Server

Prometheus MCP Server is a community-built MCP server that lets AI assistants run PromQL against a Prometheus instance and explore its metrics. It exposes instant and range queries, metric and target discovery, and metadata lookups so an agent can investigate metrics conversationally instead of you hand-writing PromQL.

It runs locally over stdio by default and can also serve HTTP or SSE (default 127.0.0.1:8080), including a stateless HTTP mode for multi-replica deployments. You point it at your Prometheus server with the PROMETHEUS_URL environment variable. It supports basic auth, bearer token, mutual TLS, and custom headers, so it works with secured or proxied Prometheus endpoints.

It ships as a Docker image and a Python package (managed with uv), with documented setups for Claude Desktop, VS Code, Cursor, Windsurf, and a Kubernetes Helm chart. A TOOL_PREFIX option namespaces the tools so you can connect to several Prometheus environments at once. Licensed MIT.

Tools & capabilities (6)

execute_query

Run an instant PromQL query at a single point in time

execute_range_query

Run a PromQL range query over a start/end time with a step

list_metrics

List the metric names available in Prometheus

get_metric_metadata

Fetch metadata (type, help, unit) for a metric

get_targets

List scrape targets and their health/status

health_check

Check connectivity and health of the configured Prometheus server

When to use it

  • Use it when you want to ask for a metric in plain English and have the agent write and run the PromQL
  • Use it when investigating an alert and you need a range query plotted over the last hour
  • Use it when exploring an unfamiliar Prometheus — list metrics and inspect metadata to discover what's available
  • Use it when checking whether scrape targets are up before debugging missing data
  • Use it when you run multiple Prometheus environments and want them namespaced via TOOL_PREFIX in one client

Quick setup

  1. 1Pull the Docker image (or install the Python package with uv)
  2. 2Set PROMETHEUS_URL to your Prometheus endpoint, plus any auth env vars if it's secured
  3. 3Add the server to your MCP client config (stdio by default, or HTTP/SSE if running it as a service)
  4. 4Restart the client so it loads the server and discovers the tools
  5. 5Run health_check or list_metrics to confirm connectivity

Security notes

Read access to Prometheus exposes all scraped infrastructure and application metrics; restrict network reachability to the Prometheus endpoint and set basic-auth credentials if the server is exposed. PromQL queries can be expensive, so consider rate limits on the upstream.

Prometheus MCP Server FAQ

Does it require authentication to Prometheus?

Only if your Prometheus is secured. It works with no auth by default, and supports basic auth, bearer token, mutual TLS, and custom headers via environment variables.

Can it run remotely instead of as a local stdio process?

Yes. Besides the default stdio transport it can serve HTTP or SSE (default 127.0.0.1:8080), including a stateless HTTP mode suited to multi-replica/Kubernetes deployments.

How do I connect to more than one Prometheus?

Run multiple instances and set the TOOL_PREFIX environment variable on each so their tool names don't collide in the client.

Do I need Python installed?

Not if you use the Docker image. For a local install you need Python 3.10+ and the uv package manager.

Is this an official Prometheus project?

No. It is an independent open-source project (by pab1it0), MIT-licensed, not maintained by the Prometheus team.

Alternatives to Prometheus MCP Server

Official Elastic server: list indices, read mappings, and search with Query DSL.

Verified
stdio (local)
API key
TypeScript
5 tools
Updated 4 months agoRepo

Official PostHog server: product analytics, feature flags, experiments, error tracking and SQL.

Verified
stdio (local)
API key
TypeScript
12 tools
Updated 4 months agoRepo

Datadog's managed remote server: query logs, metrics, traces, monitors and incidents.

Verified
HTTP (remote)
OAuth
TypeScript
11 tools
Updated 1 month agoRepo