LabStore
← All labs

VictoriaMetrics

by docker ✓ verified ✓ Packaged by Docker

Provides access to your VictoriaMetrics instance and seamless integration with VictoriaMetrics APIs and documentation. It can give you a comprehensive interface for monitoring, observability, and debugging tasks related to your VictoriaMetrics instances, enable advanced automation and interaction capabilities for engineers and tools.

MCP server installable needs setup network: on runtime: sysbox

Monitoring & Uptime MCP Servers

VictoriaMetrics MCP Server

Provides access to your VictoriaMetrics instance and seamless integration with VictoriaMetrics APIs and documentation. It can give you a comprehensive interface for monitoring, observability, and debugging tasks related to your VictoriaMetrics instances, enable advanced automation and interaction capabilities for engineers and tools.

What is an MCP Server?

MCP Info

Attribute Details
Docker Image ghcr.io/victoriametrics-community/mcp-victoriametrics
Author VictoriaMetrics-Community
Repository https://github.com/VictoriaMetrics-Community/mcp-victoriametrics

Image Building Info

Attribute Details
Dockerfile https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/blob/4db876ab9d9c09bb24035bc709988cb691ad8626/Dockerfile
Commit 4db876ab9d9c09bb24035bc709988cb691ad8626
Docker Image built by VictoriaMetrics-Community
Docker Scout Health Score Not available
Verify Signature Not available
Licence Apache License 2.0

Available Tools (20)

Tools provided by this Server Short Description
active_queries Active queries
alerts List of alerts
documentation Search documentation resources
downsampling_filters_debug Downsampling filters debugger
explain_query Explain Query
flags List of non-default flags (parameters)
label_values List of label values
labels List of label names
metric_relabel_debug Metric relabel debugger
metrics List of metric names
metrics_metadata List of metrics metadata (name, type, help and unit)
prettify_query Prettify Query
query Instant Query
query_range Range Query
retention_filters_debug Retention filters debugger
rules List of alerting and recording rules
series List of time series
tenants List of tenants
top_queries Top queries
tsdb_status TSDB Stats (information about cardinality of the data)

Tools Details

Tool: active_queries

Active queries. This tool can determine currently active queries in the VictoriaMetrics instance. This information is obtained from the "/api/v1/status/active_queries" HTTP endpoint of VictoriaMetrics API.

Parameters Type Description
tenant string optional Name of the tenant for which the active queries will be displayed

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: alerts

List of firing and pending alerts of the VictoriaMetrics instance. This tool uses /api/v1/alerts endpoint of vmalert API, proxied by VictoriaMetrics API.

Parameters Type Description
group string optional Filter alerts by their group name. If not specified, all groups are included.
limit number optional Maximum number of alerts to return. If not specified, all alerts are returned.
offset number optional Number of alerts to skip before starting to collect the result set. Default is 0.
state string optional Filter alerts by their state. Possible values: 'firing', 'pending', 'all'. Default is 'all'.
tenant string optional Name of the tenant for which the list of alerts will be displayed

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: documentation

Search documentation resources for the given search query, returning the URIs of the resources that match the search criteria sorted by relevance. This tool can help to get context for any VictoriaMetrics related question.

Parameters Type Description
query string Query for search (for example, list of keywords)
limit number optional Maximum number of results to return

This tool is read-only. It does not modify its environment.


Tool: downsampling_filters_debug

Downsampling filters debug tool is used to debug flag "downsampling.period" with some series and see what downsampling strategy will be applied for which series in Enterprise version of VictoriaMetrics. This tool use "/downsampling-filters-debug" API endpoint of VictoriaMetrics API.

Parameters Type Description
flags string Commandline flags values for downsampling.period. For example: -downsampling.period={env="dev"}:7d:5m,{env="dev"}:30d:30m -downsampling.period=30d:1m -downsampling.period=60d:5m
metrics string Set of metrics to be debugged. The metrics should be in the format of <metric_name>{<label_name>="<label_value>",...}.

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: explain_query

Explain how MetricsQL query works

Parameters Type Description
query string MetricsQL or PromQL expression for explanation

This tool is read-only. It does not modify its environment.


Tool: flags

List of non-default flags (parameters) of the VictoriaMetrics instance. This tools uses /flags endpoint of VictoriaMetrics API.

Tool: label_values

List of label values from VictoriaMetrics instance for a provided label name. This tool uses /api/v1/label/{labelName}/values endpoint of VictoriaMetrics API.

Parameters Type Description
label_name string Name of the label to query its values
end string optional End timestamp for selection labels values
limit number optional Maximum number of label values to return
match string optional Time series selector argument that selects the series from which to read the label values
start string optional Start timestamp for selection labels values
tenant string optional Name of the tenant for which the list of label values will be displayed

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: labels

List of label names of the VictoriaMetrics instance. This tools uses /api/v1/labels endpoint of VictoriaMetrics API.

Parameters Type Description
end string optional End timestamp for selection labels names
limit number optional Maximum number of label names to return
match string optional Time series selector argument that selects the series from which to read the label names
start string optional Start timestamp for selection labels names
tenant string optional Name of the tenant for which the list of labels will be displayed

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: metric_relabel_debug

Metric relabel debug tool can help with step-by-step debugging of Prometheus-compatible relabeling rules. It can be used to check how the relabeling rules are applied to the given metric. The tool use "/metric-relabel-debug" endpoint of the VictoriaMetrics API.

Parameters Type Description
metric string Set of metrics to be relabeled. The metrics should be in the format of {<label_name>="<label_value>",...}.
relabel_configs string Prometheus-compatible relabeling rules

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: metrics

List of available metrics of the VictoriaMetrics instance. This tool uses /api/v1/label/__name__/values endpoint of VictoriaMetrics API.

Parameters Type Description
end string optional End timestamp for selection metric names
limit number optional Maximum number of metric names to return
match string optional Time series selector argument that selects the series from which to read the metrics
start string optional Start timestamp for selection metric names
tenant string optional Name of the tenant for which the list of metrics will be displayed

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: metrics_metadata

Returns stored metrics details (metadata) such as name, type, help (description), and unit, and can be used to generate natural language queries. This tool uses /api/v1/metadata endpoint of VictoriaMetrics API.

Parameters Type Description
limit number optional Maximum number of metrics to return
metric string optional A metric name to filter metadata for. All metric metadata is retrieved if left empty
search string optional A keyword for search in description and metric name
tenant string optional Name of the tenant for which the list of metrics will be displayed
type string optional The metric type by which the list of metrics will be filtered
unit string optional The unit by which the list of metrics will be filtered

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: prettify_query

Prettify (format) MetricsQL query. This tool uses /prettify-query endpoint of VictoriaMetrics API.

Parameters Type Description
query string MetricsQL or PromQL expression for prettification. This is the query that will be formatted.
tenant string optional Name of the tenant for which the data will be displayed

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: query

Instant query executes PromQL or MetricsQL query expression at the given time. The result of Instant query is a list of time series matching the filter in query expression. Each returned series contains exactly one (timestamp, value) entry, where timestamp equals to the time query arg, while the value contains query result at the requested time. This tool uses /api/v1/query endpoint of VictoriaMetrics API.

Parameters Type Description
query string MetricsQL or PromQL expression for the query of the data
nocache boolean optional If true, the query will not use the rollup cache on execution.
step string optional Optional interval for searching for raw samples in the past when executing the query (used when a sample is missing at the specified time). For example, the request /api/v1/query?query=up&step=1m looks for the last written raw sample for the metric up in the (now()-1m, now()] interval (the first millisecond is not included). If omitted, step is set to 5m (5 minutes) by default.
tenant string optional Name of the tenant for which the data will be displayed
time string optional Timestamp in millisecond precision to evaluate the query at. If omitted, time is set to now() (current timestamp). The time param can be specified in multiple allowed formats.
timeout string optional Optional query timeout. For example, timeout=5s. Query is canceled when the timeout is reached. By default the timeout is set to the value of -search.maxQueryDuration command-line flag passed to single-node VictoriaMetrics or to vmselect component of VictoriaMetrics cluster.
trace boolean optional If true, the query will be traced and the trace will be returned in the response. This is useful for debugging and performance analysis.

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: query_range

Range query executes the query expression at the given [start…end] time range with the given step. The result of Range query is a list of time series matching the filter in query expression. Each returned series contains (timestamp, value) results for the query executed at start, start+step, start+2step, …, start+Nstep timestamps. In other words, Range query is an Instant query executed independently at start, start+step, …, start+N*step timestamps with the only difference that an instant query does not return ephemeral samples (see below). Instead, if the database does not contain any samples for the requested time and step, it simply returns an empty result. This tool uses /api/v1/query_range endpoint of VictoriaMetrics API.

Parameters Type Description
query string MetricsQL or PromQL expression for the query of the data
start string The starting timestamp of the time range for query evaluation
end string optional The ending timestamp of the time range for query evaluation. If the end isn’t set, then the end is automatically set to the current time.
nocache boolean optional If true, the query will not use the rollup cache on execution.
step string optional the interval between data points, which must be returned from the range query. The query is executed at start, start+step, start+2step, …, start+Nstep timestamps, where N is the whole number of steps that fit between start and end. end is included only when it equals to start+N*step. If the step isn’t set, then it default to 5m (5 minutes).
tenant string optional Name of the tenant for which the data will be displayed
timeout string optional optional query timeout. For example, timeout=5s. Query is canceled when the timeout is reached. By default the timeout is set to the value of -search.maxQueryDuration command-line flag passed to single-node VictoriaMetrics or to vmselect component in VictoriaMetrics cluster.
trace boolean optional If true, the query will be traced and the trace will be returned in the response. This is useful for debugging and performance analysis.

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: retention_filters_debug

Retention filters debug tool is used to debug flag "retentionFilter" and "retentionPeriod" with some series and see what retention policy will be applied for which series in Enterprise version of VictoriaMetrics. This tool use "/retention-filters-debug" API endpoint of VictoriaMetrics API.

Parameters Type Description
flags string Commandline flags values for retentionPeriod and retentionFilter. For example: -retentionPeriod=1y -retentionFilters={env!="prod"}:2w
metrics string Set of metrics to be debugged. The metrics should be in the format of <metric_name>{<label_name>="<label_value>",...}.

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: rules

List of alerting and recording rules of VictoriaMetrics instance. This tool uses /api/v1/rules endpoint of vmalert API proxied by VictoriaMetrics API.

Parameters Type Description
exclude_alerts boolean optional Exclude alerts from the list
filter string optional Extra filter for rules with possible problems: unhealthy (rules that get some errors during evaluation) or noMatch (rules that don't match any time series)
rule_files array optional Filter rules by file names
rule_groups array optional Filter rules by group names
rule_names array optional Filter rules by name
tenant string optional Name of the tenant for which the list of rules will be displayed
type string optional Rules type to be displayed: alert or record

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: series

List of available time series of the VictoriaMetrics instance. This tool uses /api/v1/series endpoint of VictoriaMetrics API.

Parameters Type Description
end string optional End timestamp for selection time series
limit number optional Maximum number of time series to return
match string optional Time series selector argument that selects the series
start string optional Start timestamp for selection time series
tenant string optional Name of the tenant for which the list of time series will be displayed

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: tenants

List of tenants of the VictoriaMetrics instance. This tool uses /admin/tenants endpoint of VictoriaMetrics API.

Tool: top_queries

Top queries. This tool can determine top queries of the following query types:

  • the most frequently executed queries;
  • queries with the biggest average execution duration;
  • queries that took the most summary time for execution. This information is obtained from the "/api/v1/status/top_queries" HTTP endpoint of VictoriaMetrics API.
Parameters Type Description
topN number The number of top entries to return in the response. By default is 20.
maxLifetime string optional Max lifetime of the queries to be taken into account during stats calculation. By default is 10m.
tenant string optional Name of the tenant for which the top queries will be displayed

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Tool: tsdb_status

The following tool returns various cardinality statistics about the VictoriaMetrics TSDB:

  • Metric names with the highest number of series.
  • Labels with the highest number of series.
  • Values with the highest number of series for the selected label (aka focusLabel).
  • label=name pairs with the highest number of series.
  • Labels with the highest number of unique values.

This tool returns TSDB stats from "/api/v1/status/tsdb" endpoint of VictoriaMetrics API (in the way similar to Prometheus).

Parameters Type Description
date string optional The date for collecting the stats. By default, the stats is collected for the current day. Pass date=1970-01-01 in order to collect global stats across all the days.
extraLabel string optional Optional extra_label=<label_name>=<label_value> query arg, which can be used for enforcing additional label filters for queries. For example, /api/v1/query_range?extra_label=user_id=123&extra_label=group_id=456&query=<query> would automatically add {user_id="123",group_id="456"} label filters to the given <query>. This functionality can be used for limiting the scope of time series visible to the given tenant.
focusLabel string optional Returns label values with the highest number of time series for the given label name in the seriesCountByFocusLabelValue list.
match string optional Arbitrary time series selector for series to take into account during stats calculation. By default all the series are taken into account.
tenant string optional Name of the tenant for which the TSDB stats will be displayed
topN number optional is the number of top entries to return in the response

This tool is read-only. It does not modify its environment.

This tool interacts with external entities.


Use this MCP Server

{
  "mcpServers": {
    "victoriametrics": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "VM_INSTANCE_ENTRYPOINT",
        "-e",
        "VM_INSTANCE_TYPE",
        "-e",
        "VM_INSTANCE_HEADERS",
        "-e",
        "MCP_SERVER_MODE",
        "-e",
        "MCP_LISTEN_ADDR",
        "-e",
        "MCP_DISABLED_TOOLS",
        "-e",
        "MCP_DISABLE_RESOURCES",
        "-e",
        "MCP_HEARTBEAT_INTERVAL",
        "-e",
        "VM_INSTANCE_BEARER_TOKEN",
        "ghcr.io/victoriametrics-community/mcp-victoriametrics"
      ],
      "env": {
        "VM_INSTANCE_ENTRYPOINT": "https://play.victoriametrics.com",
        "VM_INSTANCE_TYPE": "cluster",
        "VM_INSTANCE_HEADERS": "HEADER2=HEADER_VALUE,HEADER2=HEADER_VALUE_2",
        "MCP_SERVER_MODE": "stdio",
        "MCP_LISTEN_ADDR": ":8080",
        "MCP_DISABLED_TOOLS": "export,metric_statistics,test_rules",
        "MCP_DISABLE_RESOURCES": "false",
        "MCP_HEARTBEAT_INTERVAL": "30s",
        "VM_INSTANCE_BEARER_TOKEN": "<instance_bearer_token_for_authentication>"
      }
    }
  }
}

Why is it safer to run MCP Servers with Docker?