Prometheus

Let the agent run PromQL against your Prometheus, list metrics and check scrape targets.

The Prometheus MCP server runs instant and range PromQL queries, lists and describes metrics, and shows scrape targets. Prometheus' query API can't write, so the server is read-only by design.

Already running Grafana?

The Grafana server queries your Prometheus datasources too, with dashboards and Loki on top. Use this server when you want Prometheus directly, without Grafana.

SettingValue
RunsIn your network, next to Prometheus
Endpoint URLhttps://<your hostname>/mcp
TransportStreamable HTTP
AuthenticationBearer token, through Supergateway (the server has no key of its own)

Run it in HTTP mode

docker run -d --name mcp-prometheus -p 8080:8080 \
  -e PROMETHEUS_URL=http://prometheus.monitoring.svc:9090 \
  -e PROMETHEUS_MCP_SERVER_TRANSPORT=http \
  -e PROMETHEUS_MCP_BIND_HOST=0.0.0.0 \
  -e PROMETHEUS_MCP_BIND_PORT=8080 \
  ghcr.io/pab1it0/prometheus-mcp-server:latest

If Prometheus itself needs credentials, add PROMETHEUS_TOKEN, or PROMETHEUS_USERNAME and PROMETHEUS_PASSWORD. The server prints its MCP endpoint (usually /mcp) when it starts. A Helm chart is also available.

Put a key and https in front

supergateway --streamableHttp "http://mcp-prometheus:8080/mcp" \
  --outputTransport streamableHttp --stateful --port 8000 --apiKey "$MCP_API_KEY"

Expose Supergateway over https. See Expose a self-hosted server. A self-hosted sremcp in the same network can use the server's address directly.

Onboard in sremcp

FieldValue
Display name / SlugPrometheus (prod) / prometheus-prod
Endpoint URLhttps://mcp-prometheus.example.com/mcp
TransportStreamable HTTP
AuthenticationBearer token, Secret = MCP_API_KEY

Approve tools

All of them are reads: execute_query, execute_range_query, list_metrics, get_metric_metadata, get_targets and health_check.

Try it

  • What's the p99 latency of http_server_requests for checkout over the last 6 hours, and when did it change?
  • Which scrape targets are down?
  • Compare CPU usage of the payments pods with this time yesterday.

On this page