execute_query
Execute a PromQL instant query against Prometheus
Run PromQL against your Prometheus from the client — instant or over a range — and find the metric you need by name, help text or unit before writing the query.
LABSCO SUMMARY
Most PromQL written from memory fails on the name or the unit rather than the logic, and the catalogue and metadata calls put both in front of you before the query runs. The targets call is the other half: when a series is missing, it distinguishes a metric that was never exported from a target that stopped being scraped.
A read path onto a Prometheus server: instant and range queries, the metric catalogue, metric metadata and scrape targets. Nothing here writes rules, silences or configuration.
A reachable Prometheus server and its address in PROMETHEUS_URL. Run it from the published container image, a Helm chart on Kubernetes, or locally with uv. Authentication covers what Prometheus deployments actually use: basic auth through PROMETHEUS_USERNAME and PROMETHEUS_PASSWORD, a bearer token in PROMETHEUS_TOKEN, or mutual TLS with a client certificate and key. ORG_ID handles a multi-tenant setup, and PROMETHEUS_CUSTOM_HEADERS covers a proxy that wants its own headers. stdio by default, with HTTP or SSE and a stateless mode for running several replicas. MIT.
One command — claude mcp add prometheus --env PROMETHEUS_URL=http://<YOUR_PROMETHEUS>:9090 -- docker run -i --rm -e PROMETHEUS_URL ghcr.io/pab1it0/prometheus-mcp-server:latest
USE CASES
Find the metric, read its type and unit, then run the range query over the window in question.
One instant query returns the current value, without opening the Prometheus UI.
Look at the scrape targets by state and pool — the answer is usually a target that stopped being scraped rather than a metric that stopped existing.
Search the metadata by pattern across names and help text, so the query names a real series with the units you expect.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
execute_queryExecute a PromQL instant query against Prometheus
execute_range_queryExecute a PromQL range query with start time, end time, and step interval
get_metric_metadataGet metadata (type, help, unit) for metrics. Returns all metric metadata when no metric name is provided. Use filter_pattern to search metric names and descriptions.
get_targetsGet scrape targets, with state/pool filtering and optional pagination
health_checkHealth check endpoint for container monitoring and status verification
list_metricsList all available metrics in Prometheus with optional pagination support
BEFORE YOU INSTALL
6 tools when we connected. The tool list is configurable, so an install can expose fewer, and TOOL_PREFIX renames every tool (staging gives staging_execute_query) so two instances can run side by side. All six are read-only queries.
docker on PATH
CONTEXT COST
Rated by the size of the 6 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
claude mcp add prometheus --env PROMETHEUS_URL=http://<YOUR_PROMETHEUS>:9090 -- docker run -i --rm -e PROMETHEUS_URL ghcr.io/pab1it0/prometheus-mcp-server:latest{
"mcpServers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PROMETHEUS_URL",
"ghcr.io/pab1it0/prometheus-mcp-server:latest"
],
"env": {
"PROMETHEUS_URL": "<YOUR_PROMETHEUS_URL>"
}
}
}
}{
"servers": {
"prometheus": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"PROMETHEUS_URL",
"ghcr.io/pab1it0/prometheus-mcp-server:latest"
],
"env": {
"PROMETHEUS_URL": "<YOUR_PROMETHEUS_URL>"
}
}
}
}helm install prometheus-mcp-server oci://ghcr.io/pab1it0/charts/prometheus-mcp-server --version 1.1.1 --set prometheus.url="http://prometheus:9090"