# mcp-prometheus [Health: Active]

**Category:** 📊 Monitoring  
**Repository:** https://github.com/jeanlopezxyz/mcp-prometheus  
**GitHub Stars:** 0  
**npm Downloads (last month):** 413  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-prometheus

## Description
A Model Context Protocol (MCP) server for Prometheus monitoring

## Tools
Capabilities this server exposes over MCP:

- **compareTimeRanges** — Compare metric values between two time periods. Useful for before/after analysis (e.g., after deployment).
- **diagnoseNamespace** — Diagnose a namespace's health: pod status, resource consumption, restarts, storage, network.
- **diagnoseNode** — Diagnose a specific node's health: CPU, memory, disk, network, pods running, conditions.
- **getClusterHealthOverview** — Get comprehensive cluster health overview. Combines node status, pod health, resource usage, and active alerts. Use as first step for troubleshooting.
- **getPrometheusStatus** — Get Prometheus server status: version, build info, and runtime information.
- **getRules** — Get Prometheus alerting and recording rules.
- **getTargets** — Get Prometheus scrape targets status. Shows health, errors, last scrape time.
- **getTopResourceConsumers** — Get top resource consumers in the cluster. Identifies pods using most CPU, memory, or network.
- **investigatePod** — Deep investigation of a specific pod: status, resources, restarts, OOM events, container details.
- **query** — Execute a PromQL instant query against Prometheus. Returns current metric values.
- **queryRange** — Execute a PromQL range query. Returns metric values over a time period.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "mcp-prometheus": {
    "command": "npx",
    "args": ["-y","mcp-prometheus@latest"],
    "env": {
      "PROMETHEUS_URL": ""
    }
  }
}
```

**Requires environment variables:** `PROMETHEUS_URL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What mcp-prometheus MCP server does

The mcp-prometheus MCP server exposes Prometheus monitoring functions to MCP clients. It supports both direct PromQL access and higher-level investigation workflows for Kubernetes and OpenShift environments. Developers can use it to ask for current or historical metrics, inspect monitoring configuration, and investigate infrastructure or workload health through an AI client.

The server includes tools for instant and range queries, scrape target status, alerting and recording rules, and Prometheus version and runtime information. Its diagnostic tools cover cluster overviews, individual nodes, namespaces, pods, top CPU or memory consumers, network consumers, and comparisons between two time periods.

## How it works

The mcp-prometheus MCP server chooses its connection method from the available configuration. A direct URL supplied through the `--url` flag or `PROMETHEUS_URL` takes precedence. If neither is present, it attempts Kubernetes API proxy access using an automatically detected kubeconfig or in-cluster configuration.

For Kubernetes auto-connect, the default target is the `prometheus-operated` service in the `openshift-monitoring` namespace on port `9090`. The service scheme defaults to HTTPS. This approach uses Kubernetes client-go connectivity and does not require `kubectl` or port-forwarding.

The server can be run through `npx`, as a downloaded or locally built Go binary, or as a container. It also includes a Helm chart for Kubernetes or OpenShift deployment. MCP client configuration examples are provided for VS Code, Cursor, and Windsurf.

## Setup and configuration

The simplest direct configuration runs the package with `npx` and sets the Prometheus endpoint:

```json
{
  "command": "npx",
  "args": ["-y", "mcp-prometheus@latest"],
  "env": {
    "PROMETHEUS_URL": "http://localhost:9090"
  }
}
```

The `PROMETHEUS_URL` environment variable overrides Kubernetes auto-connect. Equivalent command-line options include `--url`, `--namespace`, `--service`, `--service-port`, `--service-scheme`, and `--kubeconfig`. The default namespace is `openshift-monitoring`, the default service is `prometheus-operated`, and the default service port is `9090`.

For deployment, the repository provides a container image at `ghcr.io/jeanlopezxyz/mcp-prometheus:latest` and a Helm chart. Helm values can select an image, enable OpenShift Routes, change the service port, set Prometheus service details, and configure the cluster-reader role.

## Tools and capabilities

The mcp-prometheus MCP server provides 11 tools:

- Run instant or time-range PromQL queries.
- Review scrape target health and Prometheus rules.
- Read Prometheus version and runtime status.
- Generate cluster, node, and namespace health diagnostics.
- Find leading CPU, memory, and network consumers.
- Investigate a specific pod.
- Compare metric values across two time ranges.

These tools support requests such as checking node CPU, finding memory-heavy pods, reviewing alerting rules, diagnosing a namespace, or comparing current usage with usage from 24 hours earlier.

## Limitations and notes

The material documents Prometheus and Kubernetes connectivity but does not specify authentication options for a direct Prometheus URL. Kubernetes auto-connect depends on access to a suitable kubeconfig or in-cluster configuration and the relevant Kubernetes service. The default connection settings target an OpenShift monitoring service, so other installations may require the URL or service-related flags to be changed.

_Full upstream README: https://allmcps.com/mcp/mcp-prometheus/readme_

