VictoriaMetrics

VictoriaMetrics

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.

20 Tools

Requires Configuration
Requires Secrets
Add to Docker Desktop

Version 4.43 or later needs to be installed to add the server automatically

Use cases

About

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

Image Building Info

AttributeDetails
Dockerfilehttps://github.com/VictoriaMetrics-Community/mcp-victoriametrics/blob/4db876ab9d9c09bb24035bc709988cb691ad8626/Dockerfile
Commit4db876ab9d9c09bb24035bc709988cb691ad8626
Docker Image built byVictoriaMetrics-Community
Docker Scout Health ScoreNot available
Verify SignatureNot available
LicenceApache License 2.0

Available Tools (20)

Tools provided by this ServerShort Description
active_queriesActive queries
alertsList of alerts
documentationSearch documentation resources
downsampling_filters_debugDownsampling filters debugger
explain_queryExplain Query
flagsList of non-default flags (parameters)
label_valuesList of label values
labelsList of label names
metric_relabel_debugMetric relabel debugger
metricsList of metric names
metrics_metadataList of metrics metadata (name, type, help and unit)
prettify_queryPrettify Query
queryInstant Query
query_rangeRange Query
retention_filters_debugRetention filters debugger
rulesList of alerting and recording rules
seriesList of time series
tenantsList of tenants
top_queriesTop queries
tsdb_statusTSDB 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.

ParametersTypeDescription
tenantstringoptionalName 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.

ParametersTypeDescription
groupstringoptionalFilter alerts by their group name. If not specified, all groups are included.
limitnumberoptionalMaximum number of alerts to return. If not specified, all alerts are returned.
offsetnumberoptionalNumber of alerts to skip before starting to collect the result set. Default is 0.
statestringoptionalFilter alerts by their state. Possible values: 'firing', 'pending', 'all'. Default is 'all'.
tenantstringoptionalName 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.

ParametersTypeDescription
querystringQuery for search (for example, list of keywords)
limitnumberoptionalMaximum 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.

ParametersTypeDescription
flagsstringCommandline 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
metricsstringSet 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

ParametersTypeDescription
querystringMetricsQL 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.

ParametersTypeDescription
label_namestringName of the label to query its values
endstringoptionalEnd timestamp for selection labels values
limitnumberoptionalMaximum number of label values to return
matchstringoptionalTime series selector argument that selects the series from which to read the label values
startstringoptionalStart timestamp for selection labels values
tenantstringoptionalName 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.

ParametersTypeDescription
endstringoptionalEnd timestamp for selection labels names
limitnumberoptionalMaximum number of label names to return
matchstringoptionalTime series selector argument that selects the series from which to read the label names
startstringoptionalStart timestamp for selection labels names
tenantstringoptionalName 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.

ParametersTypeDescription
metricstringSet of metrics to be relabeled. The metrics should be in the format of {<label_name>="<label_value>",...}.
relabel_configsstringPrometheus-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.

ParametersTypeDescription
endstringoptionalEnd timestamp for selection metric names
limitnumberoptionalMaximum number of metric names to return
matchstringoptionalTime series selector argument that selects the series from which to read the metrics
startstringoptionalStart timestamp for selection metric names
tenantstringoptionalName 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.

ParametersTypeDescription
limitnumberoptionalMaximum number of metrics to return
metricstringoptionalA metric name to filter metadata for. All metric metadata is retrieved if left empty
searchstringoptionalA keyword for search in description and metric name
tenantstringoptionalName of the tenant for which the list of metrics will be displayed
typestringoptionalThe metric type by which the list of metrics will be filtered
unitstringoptionalThe 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.

ParametersTypeDescription
querystringMetricsQL or PromQL expression for prettification. This is the query that will be formatted.
tenantstringoptionalName 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.

ParametersTypeDescription
querystringMetricsQL or PromQL expression for the query of the data
nocachebooleanoptionalIf true, the query will not use the rollup cache on execution.
stepstringoptionalOptional 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.
tenantstringoptionalName of the tenant for which the data will be displayed
timestringoptionalTimestamp 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.
timeoutstringoptionalOptional 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.
tracebooleanoptionalIf 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.

ParametersTypeDescription
querystringMetricsQL or PromQL expression for the query of the data
startstringThe starting timestamp of the time range for query evaluation
endstringoptionalThe 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.
nocachebooleanoptionalIf true, the query will not use the rollup cache on execution.
stepstringoptionalthe 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).
tenantstringoptionalName of the tenant for which the data will be displayed
timeoutstringoptionaloptional 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.
tracebooleanoptionalIf 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.

ParametersTypeDescription
flagsstringCommandline flags values for retentionPeriod and retentionFilter. For example: -retentionPeriod=1y -retentionFilters={env!="prod"}:2w
metricsstringSet 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.

ParametersTypeDescription
exclude_alertsbooleanoptionalExclude alerts from the list
filterstringoptionalExtra 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_filesarrayoptionalFilter rules by file names
rule_groupsarrayoptionalFilter rules by group names
rule_namesarrayoptionalFilter rules by name
tenantstringoptionalName of the tenant for which the list of rules will be displayed
typestringoptionalRules 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.

ParametersTypeDescription
endstringoptionalEnd timestamp for selection time series
limitnumberoptionalMaximum number of time series to return
matchstringoptionalTime series selector argument that selects the series
startstringoptionalStart timestamp for selection time series
tenantstringoptionalName 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|stringoptional|Max lifetime of the queries to be taken into account during stats calculation. By default is 10m. tenant|stringoptional|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).

ParametersTypeDescription
datestringoptionalThe 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.
extraLabelstringoptionalOptional 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= would automatically add {user_id="123",group_id="456"} label filters to the given . This functionality can be used for limiting the scope of time series visible to the given tenant.
focusLabelstringoptionalReturns label values with the highest number of time series for the given label name in the seriesCountByFocusLabelValue list.
matchstringoptionalArbitrary time series selector for series to take into account during stats calculation. By default all the series are taken into account.
tenantstringoptionalName of the tenant for which the TSDB stats will be displayed
topNnumberoptionalis 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?

Related servers