queryLABSCO SUMMARY
Read-only by construction, and it brings its own documentation.
The scope is drawn at what VMUI can do, which means an assistant can investigate a cardinality blow-up or a slow query without any way to change the instance. Bundling searchable VictoriaMetrics documentation into the binary is the part that pays off in practice: the model stops guessing at MetricsQL syntax and flag names because it can look them up, offline, in the same session.
What it is
The MCP server for VictoriaMetrics, covering essentially all of the read-only API surface — the same functions available in VMUI — plus embedded, up-to-date VictoriaMetrics documentation it can search offline. It works against a single-node instance, a cluster, or VictoriaMetrics Cloud.
What you get
- Instant and range PromQL/MetricsQL queries, with clients that support it able to draw the result —
query,query_range - Data exploration across metric names, metadata, label names, label values and series —
metrics,metrics_metadata,labels,label_values,series - Alerting and recording rules plus current firing and pending alerts —
rules,alerts - Cardinality and usage analysis: which metrics are expensive, which are never queried, what the TSDB status looks like —
tsdb_status,metric_statistics,top_queries,active_queries - Query authoring help — reformatting a query, and parsing one to explain how it works —
prettify_query,explain_query - Embedded documentation search that needs no online access —
documentation - Multi-tenant support with
tenantsand aVM_DEFAULT_TENANT_IDinaccountID:projectIDform - VictoriaMetrics Cloud tools for deployments, providers, regions, tiers, access tokens and rule files —
deployments,access_tokens,rule_filenames,rule_file - Three ready-made prompts, including one that finds never-queried metrics and writes relabel configs to stop ingesting them —
unused_metrics,rarely_used_metrics_with_high_cardinality
Requirements
A VictoriaMetrics instance — single-node or cluster — or a VictoriaMetrics Cloud deployment. Set VM_INSTANCE_ENTRYPOINT to the root URL of vmsingle or vmselect and VM_INSTANCE_TYPE to single or cluster; with Cloud you use VMC_API_KEY instead. VM_INSTANCE_BEARER_TOKEN, VM_INSTANCE_HEADERS and MCP_PASSTHROUGH_HEADERS cover authentication behind a proxy. MCP_SERVER_MODE chooses stdio, sse or http, and HTTP mode listens on MCP_LISTEN_ADDR, default localhost:8080. Install a release binary, the Docker image, or a Helm chart; building from source needs Go 1.26 or higher. Six tools ship disabled by default — export, flags, metric_relabel_debug, downsampling_filters_debug, retention_filters_debug and test_rules — and are enabled by editing MCP_DISABLED_TOOLS. A public instance at https://play-mcp.victoriametrics.com/mcp runs against the VictoriaMetrics playground if you want to try it before installing.
Setup effort
Follow the published steps
USE CASES
Finding out why cardinality exploded
Read the TSDB status for the worst offenders, then check usage statistics to see whether anyone is actually querying them.
Cutting ingestion you are not using
Run the unused-metrics prompt: it lists metrics never touched by a query and drafts relabel configs to stop ingesting them.
Chasing a slow dashboard
List the slowest and most frequent queries, then parse the offending one to see how it is being evaluated.
Checking an alert before you page someone
Read the firing and pending alerts alongside the rule that produced them, then run the expression as a range query to see the shape of the data.
Answering a MetricsQL question without leaving the session
Search the embedded documentation, which ships inside the binary and needs no network.
30 tools
Listed in project docs. Your client may show a different list.
query_rangemetricsmetrics_metadatalabelslabel_valuesseriesexportrulesalertsflagsmetric_statisticsactive_queriestop_queriestsdb_statustenantsdocumentationmetric_relabel_debugdownsampling_filters_debugretention_filters_debugprettify_queryexplain_querytest_rulesdeploymentscloud_providersregionstiersaccess_tokensrule_filenamesrule_fileBEFORE YOU INSTALL
What to know first
Tools you get
30 tools named in the project's documentation.
Requires
A VictoriaMetrics or VictoriaMetrics Cloud instance (single-node or cluster)
Where it runs
All 9 documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
# Download the latest release for your platform from
# https://github.com/VictoriaMetrics/mcp-victoriametrics/releases and put it on your PATH.
# Example for Linux x86_64:
latest=$(curl -s https://api.github.com/repos/VictoriaMetrics/mcp-victoriametrics/releases/latest | grep 'tag_name' | cut -d\" -f4)
wget https://github.com/VictoriaMetrics/mcp-victoriametrics/releases/download/$latest/mcp-victoriametrics_Linux_x86_64.tar.gz
tar axvf mcp-victoriametrics_Linux_x86_64.tar.gzMCP Clients
Cursor, Claude Desktop, JetBrains IDEs, Windsurf
{
"mcpServers": {
"victoriametrics": {
"command": "<YOUR_PATH_TO_MCP_VICTORIAMETRICS>",
"env": {
"VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",
"VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",
"VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",
"VM_INSTANCE_HEADERS": "<YOUR_HEADER>=<YOUR_HEADER_VALUE>,<YOUR_HEADER>=<YOUR_HEADER_VALUE>"
}
}
}
}Claude Code
claude mcp add --env VM_INSTANCE_ENTRYPOINT=<YOUR_VM_INSTANCE> --env VM_INSTANCE_TYPE=<YOUR_VM_INSTANCE_TYPE> --env VM_INSTANCE_BEARER_TOKEN=<YOUR_VM_BEARER_TOKEN> --env VM_INSTANCE_HEADERS="<YOUR_HEADER>=<YOUR_HEADER_VALUE>,<YOUR_HEADER>=<YOUR_HEADER_VALUE>" --transport stdio victoriametrics -- <YOUR_PATH_TO_MCP_VICTORIAMETRICS>Codex
[mcp_servers.victoriametrics]
command = "<YOUR_PATH_TO_MCP_VICTORIAMETRICS>"
[mcp_servers.victoriametrics.env]
VM_INSTANCE_ENTRYPOINT = "<YOUR_VM_INSTANCE>"
VM_INSTANCE_TYPE = "<YOUR_VM_INSTANCE_TYPE>"
VM_INSTANCE_BEARER_TOKEN = "<YOUR_VM_BEARER_TOKEN>"
VM_INSTANCE_HEADERS = "<YOUR_HEADER>=<YOUR_HEADER_VALUE>,<YOUR_HEADER>=<YOUR_HEADER_VALUE>"VS Code
{
"servers": {
"victoriametrics": {
"type": "stdio",
"command": "<YOUR_PATH_TO_MCP_VICTORIAMETRICS>",
"env": {
"VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",
"VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",
"VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",
"VM_INSTANCE_HEADERS": "<YOUR_HEADER>=<YOUR_HEADER_VALUE>,<YOUR_HEADER>=<YOUR_HEADER_VALUE>"
}
}
}
}Zed
{
"context_servers": {
"victoriametrics": {
"command": {
"path": "<YOUR_PATH_TO_MCP_VICTORIAMETRICS>",
"args": [],
"env": {
"VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",
"VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",
"VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",
"VM_INSTANCE_HEADERS": "<YOUR_HEADER>=<YOUR_HEADER_VALUE>,<YOUR_HEADER>=<YOUR_HEADER_VALUE>"
}
},
"settings": {}
}
}
}Any MCP client — Docker
{
"mcpServers": {
"victoriametrics": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"VM_INSTANCE_ENTRYPOINT",
"-e",
"VM_INSTANCE_TYPE",
"-e",
"VM_INSTANCE_BEARER_TOKEN",
"-e",
"VM_INSTANCE_HEADERS",
"ghcr.io/victoriametrics/mcp-victoriametrics"
],
"env": {
"VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",
"VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",
"VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",
"VM_INSTANCE_HEADERS": "<YOUR_HEADER>=<YOUR_HEADER_VALUE>,<YOUR_HEADER>=<YOUR_HEADER_VALUE>"
}
}
}
}