# prometheus-mcp-server [Health: Active]

**Category:** 📊 Monitoring  
**Repository:** https://github.com/tjhop/prometheus-mcp-server  
**GitHub Stars:** 148  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/prometheus-mcp-server

## Description
An API-complete MCP server to manage Prometheus-compatible backends via comprehensive tools.

## Tools
Capabilities this server exposes over MCP:

- **alertmanagers** — Get overview of Prometheus Alertmanager discovery
- **build_info** — Get Prometheus build information
- **config** — Get Prometheus configuration
- **docs_list** — List of Official Prometheus Documentation Files
- **docs_read** — Read the named markdown file containing official Prometheus documentation from the prometheus/docs repo
- **docs_search** — Search the markdown files containing official Prometheus documentation from the prometheus/docs repo
- **exemplar_query** — Performs a query for exemplars by the given query and time range
- **flags** — Get runtime flags
- **healthy** — Management API endpoint that can be used to check Prometheus health
- **label_names** — Returns the unique label names present in the block in sorted order by given time range and matchers
- **label_values** — Performs a query for the values of the given label, time range and matchers
- **list_alerts** — List all active alerts
- **list_rules** — List alerting and recording rules that are loaded, optionally filtered by type, state, health, name, group or labels
- **list_targets** — Get overview of Prometheus target discovery, optionally filtered by state, health or scrape pool
- **metric_metadata** — Returns metadata about metrics currently scraped by the metric name
- **query** — Execute an instant query against the Prometheus datasource, returning one value per series at a single point in time
- **quit** — Management API endpoint that can be used to trigger a graceful shutdown of Prometheus
- **range_query** — Execute a range query against the Prometheus datasource, returning values over a time window
- **ready** — Management API endpoint that can be used to check Prometheus is ready to serve traffic (i.e. respond to queries
- **reload** — Management API endpoint that can be used to trigger a reload of the Prometheus configuration and rule files
- **runbooks_list** — List the runbooks embedded in this server: guided workflows (Agent Skills) for common Prometheus tasks
- **runbooks_read** — Read the named runbook by skill name (e.g. `check-system-health`)
- **runtime_info** — Get Prometheus runtime information
- **series** — Finds series by label matchers
- **targets_metadata** — Returns metadata about metrics currently scraped by the target
- **tsdb_stats** — Get usage and cardinality statistics from the TSDB
- **wal_replay_status** — Get current WAL replay status
- **clean_tombstones** — Removes the deleted data from disk and cleans up the existing tombstones
- **delete_series** — deletes data for a selection of series in a time range
- **snapshot** — creates a snapshot of all current data into snapshots/<datetime>-<rand> under the TSDB's data directory and returns the directory as response

## Claude Desktop Quick Installation
No generated config for this server: it installs through its own setup steps.

The project's own setup steps (from https://github.com/tjhop/prometheus-mcp-server), copied verbatim. Follow them in order; they are not an mcpServers config.

1. Start the server:

```sh
PROMETHEUS_MCP_PROMETHEUS_URL="https://$yourPrometheus:9090" /path/to/prometheus-mcp
```

2. Start the server:

```sh
docker run --rm -i ghcr.io/tjhop/prometheus-mcp-server:latest --prometheus.url "https://$yourPrometheus:9090"
```

3. Start the server:

```sh
docker run --rm -i -e PROMETHEUS_MCP_SERVER_PROMETHEUS_URL="https://$yourPrometheus:9090" ghcr.io/tjhop/prometheus-mcp-server:latest
```

4. Start the server:

```sh
docker run --rm -p 8080:8080 ghcr.io/tjhop/prometheus-mcp-server:latest --prometheus.url "https://$yourPrometheus:9090" --mcp.transport "http" --web.listen-address ":8080"
```

5. Start the server:

```sh
docker run --rm -p 8080:8080 -e PROMETHEUS_MCP_SERVER_PROMETHEUS_URL="https://$yourPrometheus:9090" -e PROMETHEUS_MCP_SERVER_MCP_TRANSPORT="http" -e PROMETHEUS_MCP_SERVER_WEB_LISTEN_ADDRESS=":8080" ghcr.io/tjhop/prometheus-mcp-server:latest
```

6. Install:

```sh
helm install prometheus-mcp-server oci://ghcr.io/tjhop/charts/prometheus-mcp-server \
  --version <version> \
  --set prometheus.url=http://prometheus:9090
```

## Documentation

## What prometheus-mcp-server does

prometheus-mcp-server gives an MCP client structured access to a running Prometheus instance. Its tools cover PromQL queries, metric metadata, labels, series, exemplars, targets, alerts, rules, runtime details, configuration, feature flags, build information, and health endpoints. Responses from the Prometheus HTTP API are returned as JSON for the language model to process.

The server also includes access to official Prometheus documentation stored from the prometheus/docs repository. Agents can list available files, read a named Markdown file, or search the documentation. Embedded runbooks provide guided workflows for tasks such as health checks, missing-data investigations, error-rate analysis, high-cardinality review, and alerting or recording rule review.

## How it works

The server acts as an MCP interface over the Prometheus API. `query` runs an instant PromQL query, while `range_query` evaluates a query across a time window. Discovery tools inspect label names, label values, series, scraped metric metadata, targets, and Alertmanager discovery. Other tools expose Prometheus management and status endpoints, including readiness, health, configuration reload, runtime information, and graceful shutdown.

All tools are registered by default except the TSDB administration tools, which require explicit opt-in. For clients with smaller context windows, a tool whitelist can be supplied so only selected non-core tools are registered. The core set includes documentation, runbook, query, range-query, metric, label, and series tools.

The server can also format API responses using TOON, a token-oriented representation intended to reduce context usage in some workloads. Response truncation can limit returned lines or entries; truncation is disabled by default, and supported tool calls may override the global limit.

## Setup and configuration

The command-line interface supports selecting additional MCP tools. For example:

```shell
prometheus-mcp --mcp.tools=build_info --mcp.tools=flags --mcp.tools=runtime_info
```

This registers the requested tools alongside the always-loaded core tools. The TSDB administration set must be enabled with `--dangerous.enable-tsdb-admin-tools`. That option exposes `clean_tombstones`, `delete_series`, and `snapshot`.

## Tools and capabilities

- Run instant and range PromQL queries.
- Explore labels, series, exemplars, metric metadata, targets, and target metadata.
- Review active alerts, loaded alerting and recording rules, Alertmanager discovery, and TSDB statistics.
- Inspect build, runtime, configuration, flags, health, readiness, and WAL replay status.
- Search and read official Prometheus documentation and embedded operational runbooks.
- Reload configuration and rule files, or request a graceful Prometheus shutdown.
- Enable TSDB cleanup, series deletion, and data snapshots when the administrative option is explicitly enabled.

## Limitations and notes

TSDB administration can delete data or modify on-disk state, so those tools are disabled unless the dangerous-tools flag is supplied. The snapshot tool writes a snapshot beneath the Prometheus TSDB data directory. Response truncation may omit data when configured, while TOON output may not be more efficient for every response shape.

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

