prometheus-mcp
v0.1.0Prometheus MCP — query metrics, inspect alerts, and explore scrape targets (read-only).
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
prometheus_list_metrics
List all metric names known to Prometheus, with optional substring filter. Wraps ``GET /api/v1/label/__name__/values``. Prometheus returns all metric names at once — no pagination. Output is capped at 500 metrics after filtering, with a truncation hint when more exist. Use this first to discover valid metric names before writing PromQL expressions for ``prometheus_query`` or ``prometheus_query_range``. Examples: - Use when: "What metrics does Prometheus have about HTTP requests?" → ``pattern='http'``; read the ``metrics`` list. - Use whe…
| Parameter | Type | Description |
|---|---|---|
pattern | Optional substring filter applied case-insensitively to metric names. Example: 'http' returns all metrics containing 'http' in their name. Leave empty to list all metrics (capped at 500). |
prometheus_query
Execute an instant PromQL query against Prometheus. Wraps ``GET /api/v1/query``. Returns the result type (vector, scalar, matrix, string) and a list of samples each carrying labels, timestamp, and value. For ``vector`` results each element is one time series at the evaluation instant. Examples: - Use when: "Is the payment service up right now?" → ``query='up{job="payment-service"}'``. - Use when: "What is the current HTTP request rate?" → ``query='sum(rate(http_requests_total[5m])) by (job)'``. - Use when: "Show me all metri…
| Parameter | Type | Description |
|---|---|---|
query * | string | PromQL expression to evaluate. Examples: 'up', 'rate(http_requests_total[5m])', 'sum(rate(http_requests_total[5m])) by (job)'. |
time | Evaluation timestamp (optional). RFC3339 (e.g. '2024-01-15T10:00:00Z') or Unix timestamp (e.g. '1705312800'). Defaults to now. |
prometheus_query_range
Execute a PromQL range query returning time-series data points. Wraps ``GET /api/v1/query_range``. Returns one series per matching time series, each with labels and a list of ``[timestamp, value]`` pairs. Total points across all series are capped at 5000 with a truncation hint. Prometheus may reject the query with HTTP 422 (bad_data) if the step produces too many data points (> 11,000 per series). Increase the step or narrow the time range if this happens. Note: The Prometheus API does not support filtering by branch or commit in this endpoint — filters are…
| Parameter | Type | Description |
|---|---|---|
end * | string | End of range. RFC3339 (e.g. '2024-01-15T11:00:00Z') or Unix timestamp (e.g. '1705316400'). |
query * | string | PromQL expression to evaluate over a time range. Examples: 'rate(http_requests_total[5m])', 'node_cpu_seconds_total{mode="idle"}'. |
start * | string | Start of range. RFC3339 (e.g. '2024-01-15T10:00:00Z') or Unix timestamp (e.g. '1705312800'). |
step * | string | Query resolution step. Duration string (e.g. '15s', '1m', '5m') or float seconds (e.g. '30'). Prometheus rejects steps that produce more than 11,000 data points per series. |
prometheus_list_alerts
List all active and pending alerts from Prometheus. Wraps ``GET /api/v1/alerts``. Returns every alert that Prometheus currently tracks, with labels (including ``alertname``, ``severity``), state (``firing`` / ``pending``), the time it became active, and its current value. Also returns a summary grouped by state and a count by severity label. Examples: - Use when: "Are there any firing alerts right now?" → check ``firing_count`` and ``alerts`` where ``state='firing'``. - Use when: "Show me all critical alerts" → filter ``alerts`` by…
prometheus_list_targets
List Prometheus scrape targets, summarised by job and health. Wraps ``GET /api/v1/targets``. Returns scrape targets with job name, instance address, health status (``up`` / ``down`` / ``unknown``), last scrape duration in milliseconds, and any last error. Also returns a summary grouped by job and health state. Examples: - Use when: "Which targets are currently down?" → filter ``targets`` where ``health='down'`` and check ``last_error``. - Use when: "How many instances of the 'node-exporter' job are up?" → check ``job_summary`` for t…
| Parameter | Type | Description |
|---|---|---|
state | string | Filter targets by state: 'active' (default, scrape targets Prometheus is scraping), 'dropped' (targets that were dropped by relabelling), or 'any' (all targets regardless of state). |