talkops-prometheus-mcp-server
v0.2.1A Model Context Protocol (MCP) server for Prometheus monitoring and observability.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
prom_get_diagnostics Get Prometheus & TSDB Diagnostics
Collect unified backend health, runtime info, WAL replay, TSDB stats, and target health. Use when starting an incident investigation or checking Prometheus health. Read-only. Returns: - {"backend_id": str, "health": str, "version": str, "observations": [...], ...}
| Parameter | Type | Description |
|---|---|---|
backend_id | string | Prometheus backend ID (see prom://system/backends) |
detail | string | Response detail level ('summary' returns condensed 5-field items) |
include | Diagnostic sections: overview, targets, tsdb, flags, or all (accepts string or list) | |
scrape_pool | Optional job / scrapePool filter for target diagnostics |
prom_analyze_cardinality Analyze TSDB Cardinality & Series Fan-Out
Analyze TSDB series cardinality, label value fan-out, and rule usage shares. Use when investigating TSDB memory pressure, high series churn, or FinOps cost drivers. Read-only. Returns: - {"backend_id": str, "overview": {...}, "top_metrics": [...], "top_labels": [...], "observations": [...]}
| Parameter | Type | Description |
|---|---|---|
backend_id | string | Prometheus backend ID |
check_unused_rules | boolean | Check whether top high-cardinality metrics are referenced in any recording/alerting rule |
focus_label | Optional label name to inspect for high fan-out (e.g. 'user_id', 'pod') | |
metric_prefix | Optional metric name prefix filter (e.g. 'http_', 'container_') | |
top_n | integer | Number of top high-cardinality metrics/labels to return (1-50) |
prom_explore_metrics Explore Prometheus Metrics, Series, and Labels
Discover metric names, types, HELP text, per-job target metrics, label values, or matching series selectors. Use before writing PromQL to avoid hallucinating metric or label names. Read-only. Returns: - {"backend_id": str, "metrics": [...], "series": [...], "label_topology": {...}, "next_cursor": str|None}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
cursor | Pagination cursor offset from a previous call | |
job | Optional scrape job name to discover metrics emitted specifically by that job via /api/v1/targets/metadata | |
label_name | Metric name or label name to inspect label values for | |
limit | integer | Maximum items to return per page (1-200) |
match_selector | PromQL series selector for /api/v1/series (e.g. 'up{job="prometheus"}') | |
metric_pattern | Substring or regex pattern to filter metric names (e.g. 'http_request') |
prom_query_instant Execute PromQL Instant Query
Execute a point-in-time PromQL instant query (or `validate_only=True` preflight check) with semantic counter guardrails. Use for current metric values, status checks, topk() rankings, or preflight query linting. Read-only. Returns: - {"resultType": str, "series_count": int, "series": [...], "eval_time_seconds": float}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
query * | string | PromQL expression (counters must use rate/irate/increase) |
detail | string | 'summary' returns condensed 5-field items; 'full' returns raw samples |
limit | integer | Maximum series to return (1-500) |
time | Evaluation time (RFC3339, Unix seconds, or relative e.g. '-5m'; defaults to now) | |
timeout | string | Evaluation timeout (e.g. '15s', '30s') |
validate_only | boolean | When True, validates PromQL syntax and counter-rate safety without executing TSDB query |
prom_query_range Execute PromQL Range Query
Execute a PromQL range query with auto-step sizing, per-series stats, and optional A2UI chart. Use for trend analysis, spike detection, and charting over a time window. Read-only. Returns: - {"series_count": int, "step": str, "series": [{"labels": {...}, "stats": {...}}], "chart": {...}}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
query * | string | PromQL expression (counters must use rate/irate/increase) |
detail | string | 'summary' returns pre-computed stats (min/max/avg/p95/latest); 'full' includes raw points |
end | string | Range end (RFC3339, Unix epoch, or 'now') |
include_chart | boolean | Include an A2UI time-series chart specification in the response |
limit | integer | Maximum series to return (1-200) |
start | string | Range start (RFC3339, Unix epoch, or relative offset like '-1h') |
step | Step duration (e.g. '30s', '5m'; auto-computed if omitted) |
prom_query_exemplars Query Prometheus Trace Exemplars
Fetch OpenTelemetry/Tempo trace exemplars (`trace_id`, `span_id`) attached to metric samples. Use to pivot from high-latency histograms or error counters to distributed traces in Tempo. Read-only. Returns: - {"backend_id": str, "exemplar_count": int, "exemplars": [{"trace_id": str, "span_id": str, "value": float, ...}]}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
query * | string | PromQL selector or histogram expression to extract exemplars from |
end | string | End time (RFC3339, Unix epoch, or 'now') |
limit | integer | Maximum exemplars to return, sorted by highest value first (1-100) |
start | string | Start time (RFC3339, Unix epoch, or relative offset e.g. '-15m') |
prom_compare_periods Compare PromQL Metric Across Two Time Periods
Compare a PromQL expression between a current window and a time-shifted baseline window. Use during deployment regression or anomaly triage to compute deltas and z-scores server-side. Read-only. Returns: - {"comparisons": [{"series": str, "current_avg": float, "baseline_avg": float, "pct_change": float, "z_score": float|None, ...}], "observations": [...]}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
query * | string | PromQL expression to compare between current and baseline windows |
baseline_offset | string | How far back to shift the baseline window (e.g. '1h', '1d', '1w') |
current_end | string | Current window end (e.g. 'now' or RFC3339) |
current_start | string | Current window start (e.g. '-15m' or RFC3339) |
step | Optional step duration (auto-computed if omitted) |
prom_analyze_service_red Analyze Service RED Golden Signals
Compute RED golden signals (Request Rate, Error Ratio, p50/p95/p99 Duration) supporting classic and Prometheus 3.0 Native Histograms plus trace exemplars. Use as the primary service triage tool to avoid running multiple separate PromQL queries. Read-only. Returns: - {"service_selector": str, "request_rate_rps": float, "error_ratio_pct": float, "latency_seconds": {"p50": ..., "p95": ..., "p99": ...}, "exemplars": [...], "observations": [...]}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
service_selector * | string | Service/job label selector (e.g. 'job="api-server"' or 'service="checkout"') |
include_exemplars | boolean | Fetch trace exemplars for latency/error spikes if available |
lookback | string | Lookback window for RED evaluation (e.g. '5m', '15m', '1h') |
metric_convention | string | Metric naming convention: auto, prometheus_http, prometheus_native (Prometheus 3.0 Native Histograms), otel, otel_utf8 (Prometheus 3.0 UTF-8 OTel), otel_rpc, spanmetrics, istio, or grpc |
prom_evaluate_slo_burn Evaluate Multi-Window SLO Error Budget Burn
Evaluate Google SRE multi-window multi-burn-rate error budget consumption (1h/5m, 6h/30m, 24h/2h, 72h/6h) in one call. Computes error ratio, burn rate multiplier, and remaining budget across short/long burn windows. Read-only. Returns: - {"slo_target": float, "error_budget_fraction": float, "burn_rate_multiplier": float, "multi_window_tiers": [...], "estimated_exhaustion_hours": float|None, "observations": [...]}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
error_query * | string | PromQL rate expression for bad/error events (e.g. 'sum(rate(http_requests_total{job="api",status=~"5.."}[5m]))') |
total_query * | string | PromQL rate expression for total valid events (e.g. 'sum(rate(http_requests_total{job="api"}[5m]))') |
slo_target | number | Target SLO objective between 0.5 and 1.0 (e.g. 0.999 for 99.9%) |
window_days | integer | SLO compliance period in days (default: 30) |
prom_get_firing_alerts Get Prometheus Firing & Pending Alert Evaluations
Inspect Prometheus's native rule evaluation state (`/api/v1/alerts`) and `ALERTS_FOR_STATE` flapping history. Scoped strictly to Prometheus signal generation. For Alertmanager silences, routing trees, or inhibitions, use `alertmanager-mcp-server` (`am_*`). Read-only. Returns: - {"active_count": int, "alerts": [...], "history_stats": {...}, "observations": [...]}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
alert_name | Optional alertname filter (exact match) | |
include_history_lookback | Lookback window for ALERTS_FOR_STATE flapping stats (e.g. '24h', '7d'; None to skip) | |
label_filters | Optional label key-value matchers (e.g. {'severity': 'critical'}) | |
limit | integer | Maximum alert instances to return (1-200) |
state | string | Filter by Prometheus rule evaluation state: all, firing, or pending |
prom_validate_rules Validate Prometheus Rule Group & Unit Tests
Validate a rule group via `promtool check rules`, structural hygiene checks, and optional `promtool test rules`. Always run before calling `prom_upsert_rule_group`. Read-only. Returns: - {"valid": bool, "errors": [...], "hygiene_observations": [...], "unit_test_results": {...}}
| Parameter | Type | Description |
|---|---|---|
rule_group * | object | Prometheus rule group dictionary ({'name': str, 'interval': str, 'rules': [...]}) |
check_hygiene | boolean | Check recording rule naming (level:metric:op) and alert severity/summary hygiene |
unit_tests | Optional promtool unit test cases ([{'interval': '1m', 'input_series': [...], 'alert_rule_test': [...]}]) |
prom_simulate_rule_firing Simulate Alert Rule Firing (Historical or Synthetic)
Simulate whether an alerting rule would fire (`pending` -> `firing` over `for`) on historical or synthetic data. Use before deploying a new or tuned alert rule to verify firing frequency and blast radius. Read-only. Returns: - {"would_fire": bool, "firing_episodes": [...], "total_firing_series": int}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
rule * | object | Alert rule dictionary ({'alert': str, 'expr': str, 'for': '5m', 'labels': {...}}) |
end | string | Historical simulation end time (e.g. 'now' or RFC3339) |
mode | string | Simulation mode: 'historical' (against live TSDB range) or 'synthetic' (input_series) |
start | string | Historical simulation start time (e.g. '-6h', '-24h', or RFC3339) |
step | string | Evaluation step interval (e.g. '1m', '30s') |
synthetic_series | For mode='synthetic': list of {'series': 'metric{lbl="v"}', 'values': '10+0x15'} |
prom_upsert_rule_group Upsert Prometheus Rule Group
Create or update a Prometheus rule group via `k8s_crd`, `http_ruler`, `local_file`, or `yaml_only` with non-destructive multi-group merge. **MUTATES STATE when `dry_run=False`.** Preserves sibling rule groups in the same `PrometheusRule` CRD or local YAML file. Returns: - {"status": str, "storage_mode": str, "dry_run": bool, "action": str, ...}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
group * | object | Rule group object ({'name': str, 'interval': '1m', 'rules': [...]}) |
confirm | boolean | Set True to confirm live write when dry_run=False |
crd_name | Optional PrometheusRule CRD name or local YAML rule file path (when storage_mode='local_file') | |
dry_run | boolean | When True (default), validates and previews the manifest without mutating state |
labels | Optional metadata labels to merge onto the PrometheusRule CRD | |
namespace | string | Kubernetes namespace for PrometheusRule CRD or Ruler API namespace |
storage_mode | string | Storage target: 'auto' (default k8s_crd), 'k8s_crd', 'http_ruler' (Mimir/Cortex/Thanos Ruler API), 'local_file' (on-disk rule YAML with non-destructive group merge), or 'yaml_only' (GitOps manifest re… |
prom_delete_rule_group Delete Prometheus Rule Group
Delete a rule group from its owning `PrometheusRule` CRD, local YAML file, or HTTP Ruler namespace without clobbering sibling rule groups. **DESTRUCTIVE when `dry_run=False`.** Always preview with `dry_run=True` first. Returns: - {"status": str, "storage_mode": str, "dry_run": bool, "action": str, ...}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
group_name * | string | Name of the rule group to remove |
confirm | boolean | Set True to confirm deletion when dry_run=False |
crd_name | Optional PrometheusRule CRD name or local YAML rule file path (when storage_mode='local_file') | |
dry_run | boolean | When True (default), previews removal without mutating state |
namespace | string | Kubernetes namespace of the PrometheusRule CRD or Ruler API namespace |
storage_mode | string | Storage target: 'auto' (default k8s_crd), 'k8s_crd', 'http_ruler', or 'local_file' |
prom_verify_metrics_endpoint Verify Metrics Endpoint & Prometheus Scrape Health
Verify a `/metrics` HTTP endpoint and/or poll Prometheus until `up{job=...} == 1.0`. Fixes the false-positive bug where `up == 0` was treated as healthy. Read-only. Returns: - {"healthy": bool, "endpoint_check": {...}, "scrape_up": bool, "up_instances": [...], "missing_metrics": [...]}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
endpoint_url | Optional direct HTTP /metrics URL to probe (e.g. 'http://my-svc:8080/metrics') | |
expected_metrics | Optional list of metric names expected to be present | |
job_label | Optional Prometheus job label to verify `up{job=...} == 1` scrape health | |
verify_timeout | integer | Seconds to poll Prometheus for `up == 1` target health (1-120) |
prom_apply_scrape_config Apply Prometheus Scrape Configuration (CRD or File SD)
Create or update a `ServiceMonitor`, `PodMonitor`, `Probe`, `ScrapeConfig` CRD, or `file_sd` target group. **MUTATES STATE when `dry_run=False`.** Automatically injects required Prometheus Operator selector labels. Returns: - {"status": str, "dry_run": bool, "kind": str, "name": str, "manifest": {...}}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
kind * | string | Scrape resource kind: ServiceMonitor, PodMonitor, Probe, ScrapeConfig, or file_sd |
name * | string | Resource metadata name (or target group name for file_sd) |
spec * | object | CRD spec dictionary (or {'file_path': str, 'targets': [...], 'labels': {...}} for file_sd) |
confirm | boolean | Set True to confirm live write when dry_run=False |
dry_run | boolean | When True (default), previews the manifest without mutating the cluster or filesystem |
namespace | string | Kubernetes namespace for the scrape CRD |
prom_delete_scrape_config Delete Prometheus Scrape Configuration
Delete a Kubernetes scrape CRD (`ServiceMonitor`, `PodMonitor`, `Probe`, `ScrapeConfig`) or `file_sd` file. **DESTRUCTIVE when `dry_run=False`.** Always preview with `dry_run=True` first. Returns: - {"status": str, "dry_run": bool, "kind": str, "name": str, "namespace": str}
| Parameter | Type | Description |
|---|---|---|
backend_id * | string | Prometheus backend ID (e.g. 'default') |
kind * | string | Scrape resource kind: ServiceMonitor, PodMonitor, Probe, ScrapeConfig, or file_sd |
name * | string | Resource metadata name (or file path for file_sd) |
confirm | boolean | Set True to confirm deletion when dry_run=False |
dry_run | boolean | When True (default), previews deletion without mutating the cluster |
namespace | string | Kubernetes namespace of the scrape CRD |
prom_install_exporter Install Prometheus Exporter to Kubernetes
Deploy a Prometheus exporter (`Deployment`/`DaemonSet`, `Service`, and `ServiceMonitor`) to Kubernetes. **MUTATES CLUSTER STATE when `dry_run=False`.** Redacts sensitive credentials in returned manifests. Returns: - {"status": str, "dry_run": bool, "exporter_type": str, "applied_resources": [...], "manifests": [...]}
| Parameter | Type | Description |
|---|---|---|
exporter_type * | string | Exporter type (e.g. 'postgres_exporter', 'redis_exporter', 'node_exporter') |
confirm | boolean | Set True to confirm live deployment when dry_run=False |
create_servicemonitor | boolean | Automatically create a matching ServiceMonitor CRD |
dry_run | boolean | When True (default), renders and redacts manifests without applying to Kubernetes |
exporter_config | Exporter environment/secret/flag config (e.g. {'REDIS_ADDR': 'redis://redis:6379'} or {'secret_env': {'DATA_SOURCE_NAME': {'name': 'pg-dsn', 'key': 'dsn'}}}) | |
namespace | string | Kubernetes namespace to deploy the exporter into |
release_name | Optional K8s resource name override (defaults to exporter_type with hyphens) |
prom_uninstall_exporter Uninstall Prometheus Exporter from Kubernetes
Remove a deployed Prometheus exporter (`Deployment`/`DaemonSet`, `Service`, and `ServiceMonitor`) from Kubernetes. **DESTRUCTIVE when `dry_run=False`.** Always preview with `dry_run=True` first. Returns: - {"status": str, "dry_run": bool, "exporter_type": str, "removed_resources": [...]}
| Parameter | Type | Description |
|---|---|---|
exporter_type * | string | Exporter type to uninstall (e.g. 'postgres_exporter', 'redis_exporter') |
confirm | boolean | Set True to confirm deletion when dry_run=False |
dry_run | boolean | When True (default), previews resources to remove without mutating the cluster |
namespace | string | Kubernetes namespace of the deployed exporter |
release_name | Optional K8s resource name override (defaults to exporter_type with hyphens) |