Prometheus MCP Server

v0.18.0
io.github.tjhop/prometheus-mcp-server Checked 2 hours ago Published 7 months ago

An API-complete MCP server to manage Prometheus-compatible backends.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

alertmanagers

Get overview of Prometheus Alertmanager discovery

build_info

Get Prometheus build information

clean_tombstones

Removes the deleted data from disk and cleans up the existing tombstones

config

Get Prometheus configuration

delete_series

Deletes data for a selection of series in a time range. Both start_time and end_time are required to prevent accidental deletion of all data. Deletion creates tombstones; run clean_tombstones or wait for compaction to reclaim disk space.

ParameterTypeDescription
matches *null | arrayseries selector arguments for series to delete,required
end_timestringend timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to current time.
start_timestringstart timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to 5m ago.

docs_list

List of Official Prometheus Documentation Files.

docs_read

Read the named markdown file containing official Prometheus documentation from the prometheus/docs repo

ParameterTypeDescription
file *stringthe name of the documentation file to read

exemplar_query

Execute an exemplar query against the Prometheus datasource to find trace exemplars associated with metric samples

ParameterTypeDescription
query *stringthe PromQL query to execute
end_timestringend timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to current time.
start_timestringstart timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to 5m ago.
truncation_limitintegertruncation limit for query response in number of lines/entries, set to -1 to disable truncation

flags

Get runtime flags

healthy

Management API endpoint that can be used to check Prometheus health.

label_names

Returns the unique label names present in the block in sorted order by given time range and matches

ParameterTypeDescription
end_timestringend timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to current time.
matchesnull | arrayseries selector arguments to filter label names
start_timestringstart timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to 5m ago.
truncation_limitintegertruncation limit for query response in number of lines/entries, set to -1 to disable truncation

label_values

Performs a query for the values of the given label, time range and matches

ParameterTypeDescription
label *stringthe label to query values for,required
end_timestringend timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to current time.
matchesnull | arrayseries selector arguments to filter label values
start_timestringstart timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to 5m ago.
truncation_limitintegertruncation limit for query response in number of lines/entries, set to -1 to disable truncation

list_alerts

List all active alerts

list_rules

List all alerting and recording rules that are loaded

list_targets

Get overview of Prometheus target discovery

metric_metadata

Returns metadata about metrics currently scraped by the metric name.

ParameterTypeDescription
limitstringmaximum number of metrics to return
metricstringmetric name to retrieve metadata for, all metrics if empty

query

Execute an instant query against the Prometheus datasource

ParameterTypeDescription
query *stringthe PromQL query to execute
timestampstringevaluation timestamp for the instant query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now e.g. 5m, 1h30m, etc. Defaults to current time.
truncation_limitintegertruncation limit for query response in number of lines/entries, set to -1 to disable truncation

quit

Management API endpoint that can be used to trigger a graceful shutdown of Prometheus.

range_query

Execute a range query against the Prometheus datasource

ParameterTypeDescription
query *stringthe PromQL query to execute
end_timestringend timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to current time.
start_timestringstart timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to 5m ago.
stepstringquery resolution step width in Go duration format (e.g. '30s', '5m', '1h'), auto-set if unspecified
truncation_limitintegertruncation limit for query response in number of lines/entries, set to -1 to disable truncation

ready

Management API endpoint that can be used to check Prometheus is ready to serve traffic (i.e. respond to queries.)

reload

Management API endpoint that can be used to trigger a reload of the Prometheus configuration and rule files.

runtime_info

Get Prometheus runtime information

series

Finds series by label matches

ParameterTypeDescription
matches *null | arrayseries selector arguments that select the series to return,required
end_timestringend timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to current time.
start_timestringstart timestamp for the query. Accepts: Unix epoch seconds, RFC3339, or a duration string relative to now (e.g. 5m, 1h30m, etc). Defaults to 5m ago.
truncation_limitintegertruncation limit for query response in number of lines/entries, set to -1 to disable truncation

snapshot

creates a snapshot of all current data into snapshots/<datetime>-<rand> under the TSDB's data directory and returns the directory as response.

ParameterTypeDescription
skip_headbooleanskip data present in the head block

targets_metadata

Returns metadata about metrics currently scraped by the target

ParameterTypeDescription
limitstringmaximum number of targets to match
match_targetstringlabel selectors to match targets, all targets if empty
metricstringmetric name to retrieve metadata for, all metrics if empty

tsdb_stats

Get usage and cardinality statistics from the TSDB

wal_replay_status

Get current WAL replay status