talkops-prometheus-mcp-server

v0.2.1
talkops-prometheus-mcp-server Checked 16 hours ago Published 13 days ago

A 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": [...], ...}

ParameterTypeDescription
backend_idstringPrometheus backend ID (see prom://system/backends)
detailstringResponse detail level ('summary' returns condensed 5-field items)
includeDiagnostic sections: overview, targets, tsdb, flags, or all (accepts string or list)
scrape_poolOptional 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": [...]}

ParameterTypeDescription
backend_idstringPrometheus backend ID
check_unused_rulesbooleanCheck whether top high-cardinality metrics are referenced in any recording/alerting rule
focus_labelOptional label name to inspect for high fan-out (e.g. 'user_id', 'pod')
metric_prefixOptional metric name prefix filter (e.g. 'http_', 'container_')
top_nintegerNumber 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}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
cursorPagination cursor offset from a previous call
jobOptional scrape job name to discover metrics emitted specifically by that job via /api/v1/targets/metadata
label_nameMetric name or label name to inspect label values for
limitintegerMaximum items to return per page (1-200)
match_selectorPromQL series selector for /api/v1/series (e.g. 'up{job="prometheus"}')
metric_patternSubstring 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}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
query *stringPromQL expression (counters must use rate/irate/increase)
detailstring'summary' returns condensed 5-field items; 'full' returns raw samples
limitintegerMaximum series to return (1-500)
timeEvaluation time (RFC3339, Unix seconds, or relative e.g. '-5m'; defaults to now)
timeoutstringEvaluation timeout (e.g. '15s', '30s')
validate_onlybooleanWhen 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": {...}}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
query *stringPromQL expression (counters must use rate/irate/increase)
detailstring'summary' returns pre-computed stats (min/max/avg/p95/latest); 'full' includes raw points
endstringRange end (RFC3339, Unix epoch, or 'now')
include_chartbooleanInclude an A2UI time-series chart specification in the response
limitintegerMaximum series to return (1-200)
startstringRange start (RFC3339, Unix epoch, or relative offset like '-1h')
stepStep 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, ...}]}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
query *stringPromQL selector or histogram expression to extract exemplars from
endstringEnd time (RFC3339, Unix epoch, or 'now')
limitintegerMaximum exemplars to return, sorted by highest value first (1-100)
startstringStart 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": [...]}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
query *stringPromQL expression to compare between current and baseline windows
baseline_offsetstringHow far back to shift the baseline window (e.g. '1h', '1d', '1w')
current_endstringCurrent window end (e.g. 'now' or RFC3339)
current_startstringCurrent window start (e.g. '-15m' or RFC3339)
stepOptional 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": [...]}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
service_selector *stringService/job label selector (e.g. 'job="api-server"' or 'service="checkout"')
include_exemplarsbooleanFetch trace exemplars for latency/error spikes if available
lookbackstringLookback window for RED evaluation (e.g. '5m', '15m', '1h')
metric_conventionstringMetric 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": [...]}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
error_query *stringPromQL rate expression for bad/error events (e.g. 'sum(rate(http_requests_total{job="api",status=~"5.."}[5m]))')
total_query *stringPromQL rate expression for total valid events (e.g. 'sum(rate(http_requests_total{job="api"}[5m]))')
slo_targetnumberTarget SLO objective between 0.5 and 1.0 (e.g. 0.999 for 99.9%)
window_daysintegerSLO 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": [...]}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
alert_nameOptional alertname filter (exact match)
include_history_lookbackLookback window for ALERTS_FOR_STATE flapping stats (e.g. '24h', '7d'; None to skip)
label_filtersOptional label key-value matchers (e.g. {'severity': 'critical'})
limitintegerMaximum alert instances to return (1-200)
statestringFilter 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": {...}}

ParameterTypeDescription
rule_group *objectPrometheus rule group dictionary ({'name': str, 'interval': str, 'rules': [...]})
check_hygienebooleanCheck recording rule naming (level:metric:op) and alert severity/summary hygiene
unit_testsOptional 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}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
rule *objectAlert rule dictionary ({'alert': str, 'expr': str, 'for': '5m', 'labels': {...}})
endstringHistorical simulation end time (e.g. 'now' or RFC3339)
modestringSimulation mode: 'historical' (against live TSDB range) or 'synthetic' (input_series)
startstringHistorical simulation start time (e.g. '-6h', '-24h', or RFC3339)
stepstringEvaluation step interval (e.g. '1m', '30s')
synthetic_seriesFor 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, ...}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
group *objectRule group object ({'name': str, 'interval': '1m', 'rules': [...]})
confirmbooleanSet True to confirm live write when dry_run=False
crd_nameOptional PrometheusRule CRD name or local YAML rule file path (when storage_mode='local_file')
dry_runbooleanWhen True (default), validates and previews the manifest without mutating state
labelsOptional metadata labels to merge onto the PrometheusRule CRD
namespacestringKubernetes namespace for PrometheusRule CRD or Ruler API namespace
storage_modestringStorage 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, ...}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
group_name *stringName of the rule group to remove
confirmbooleanSet True to confirm deletion when dry_run=False
crd_nameOptional PrometheusRule CRD name or local YAML rule file path (when storage_mode='local_file')
dry_runbooleanWhen True (default), previews removal without mutating state
namespacestringKubernetes namespace of the PrometheusRule CRD or Ruler API namespace
storage_modestringStorage 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": [...]}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
endpoint_urlOptional direct HTTP /metrics URL to probe (e.g. 'http://my-svc:8080/metrics')
expected_metricsOptional list of metric names expected to be present
job_labelOptional Prometheus job label to verify `up{job=...} == 1` scrape health
verify_timeoutintegerSeconds 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": {...}}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
kind *stringScrape resource kind: ServiceMonitor, PodMonitor, Probe, ScrapeConfig, or file_sd
name *stringResource metadata name (or target group name for file_sd)
spec *objectCRD spec dictionary (or {'file_path': str, 'targets': [...], 'labels': {...}} for file_sd)
confirmbooleanSet True to confirm live write when dry_run=False
dry_runbooleanWhen True (default), previews the manifest without mutating the cluster or filesystem
namespacestringKubernetes 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}

ParameterTypeDescription
backend_id *stringPrometheus backend ID (e.g. 'default')
kind *stringScrape resource kind: ServiceMonitor, PodMonitor, Probe, ScrapeConfig, or file_sd
name *stringResource metadata name (or file path for file_sd)
confirmbooleanSet True to confirm deletion when dry_run=False
dry_runbooleanWhen True (default), previews deletion without mutating the cluster
namespacestringKubernetes 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": [...]}

ParameterTypeDescription
exporter_type *stringExporter type (e.g. 'postgres_exporter', 'redis_exporter', 'node_exporter')
confirmbooleanSet True to confirm live deployment when dry_run=False
create_servicemonitorbooleanAutomatically create a matching ServiceMonitor CRD
dry_runbooleanWhen True (default), renders and redacts manifests without applying to Kubernetes
exporter_configExporter environment/secret/flag config (e.g. {'REDIS_ADDR': 'redis://redis:6379'} or {'secret_env': {'DATA_SOURCE_NAME': {'name': 'pg-dsn', 'key': 'dsn'}}})
namespacestringKubernetes namespace to deploy the exporter into
release_nameOptional 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": [...]}

ParameterTypeDescription
exporter_type *stringExporter type to uninstall (e.g. 'postgres_exporter', 'redis_exporter')
confirmbooleanSet True to confirm deletion when dry_run=False
dry_runbooleanWhen True (default), previews resources to remove without mutating the cluster
namespacestringKubernetes namespace of the deployed exporter
release_nameOptional K8s resource name override (defaults to exporter_type with hyphens)