Prometheus MCP Server
v0.18.0An 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.
| Parameter | Type | Description |
|---|---|---|
matches * | null | array | series selector arguments for series to delete,required |
end_time | string | end 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_time | string | start 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
| Parameter | Type | Description |
|---|---|---|
file * | string | the name of the documentation file to read |
docs_search
Search the markdown files containing official Prometheus documentation from the prometheus/docs repo
| Parameter | Type | Description |
|---|---|---|
query * | string | the query to search for in documentation |
limit | integer | maximum number of search results to return |
exemplar_query
Execute an exemplar query against the Prometheus datasource to find trace exemplars associated with metric samples
| Parameter | Type | Description |
|---|---|---|
query * | string | the PromQL query to execute |
end_time | string | end 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_time | string | start 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_limit | integer | truncation 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
| Parameter | Type | Description |
|---|---|---|
end_time | string | end 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. |
matches | null | array | series selector arguments to filter label names |
start_time | string | start 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_limit | integer | truncation 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
| Parameter | Type | Description |
|---|---|---|
label * | string | the label to query values for,required |
end_time | string | end 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. |
matches | null | array | series selector arguments to filter label values |
start_time | string | start 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_limit | integer | truncation 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.
| Parameter | Type | Description |
|---|---|---|
limit | string | maximum number of metrics to return |
metric | string | metric name to retrieve metadata for, all metrics if empty |
query
Execute an instant query against the Prometheus datasource
| Parameter | Type | Description |
|---|---|---|
query * | string | the PromQL query to execute |
timestamp | string | evaluation 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_limit | integer | truncation 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
| Parameter | Type | Description |
|---|---|---|
query * | string | the PromQL query to execute |
end_time | string | end 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_time | string | start 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. |
step | string | query resolution step width in Go duration format (e.g. '30s', '5m', '1h'), auto-set if unspecified |
truncation_limit | integer | truncation 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
| Parameter | Type | Description |
|---|---|---|
matches * | null | array | series selector arguments that select the series to return,required |
end_time | string | end 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_time | string | start 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_limit | integer | truncation 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.
| Parameter | Type | Description |
|---|---|---|
skip_head | boolean | skip data present in the head block |
targets_metadata
Returns metadata about metrics currently scraped by the target
| Parameter | Type | Description |
|---|---|---|
limit | string | maximum number of targets to match |
match_target | string | label selectors to match targets, all targets if empty |
metric | string | metric 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