Back to Browse

Victoriametrics MCP Server

Developer Tools10.0Low riskMCP RegistryLocal
Free

Server data from the Official MCP Registry

MCP Server for VictoriaMetrics. Provides integration with VictoriaMetrics API and documentation

About

MCP Server for VictoriaMetrics. Provides integration with VictoriaMetrics API and documentation

Security report

How we score
10.0out of 10Low riskMCP Marketplace security score

Valid MCP server (4 strong, 3 medium validity signals). No known CVEs in dependencies. Imported from the Official MCP Registry.

6 files analyzed · Nothing found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

file_system

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

URL to VictoriaMetrics instance (it should be root URL of vmsingle or vmselect), for example http://localhost:8428 or https://play.victoriametrics.comOptional

Environment variable: VM_INSTANCE_ENTRYPOINT

Type of VictoriaMetrics instance (single / cluster)Optional

Environment variable: VM_INSTANCE_TYPE

Authentication token for VictoriaMetrics APIRequired

Environment variable: VM_INSTANCE_BEARER_TOKEN

Optional: API key from VictoriaMetrics Cloud Console (if you have deployment in VictoriaMetrics Cloud)Required

Environment variable: VMC_API_KEY

Comma-separated list of tools to disableOptional

Environment variable: MCP_DISABLED_TOOLS

Disable all resources (documentation tool will continue to work)Optional

Environment variable: MCP_DISABLE_RESOURCES

HTTP header names to forward from incoming MCP requests to VictoriaMetrics (comma-separated list). Overrides VM_INSTANCE_HEADERS on collision.Optional

Environment variable: MCP_PASSTHROUGH_HEADERS

How to Install

Install command not verified. See the repository for install instructions.

View repository

Documentation

View on GitHub

From the project's GitHub README.

VictoriaMetrics MCP Server

Latest Release Trust Score License Slack X Reddit

The implementation of Model Context Protocol (MCP) server for VictoriaMetrics.

This 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.

Features

This MCP server allows you to use almost all read-only APIs of VictoriaMetrics, i.e. all functions available in VMUI:

  • Querying metrics and exploring data (even drawing graphs if your client supports it)
  • Listing and exporting available metrics, labels, labels values and entire series
  • Analyzing and testing your alerting and recording rules and alerts
  • Showing parameters of your VictoriaMetrics instance
  • Exploring cardinality of your data and metrics usage statistics
  • Analyzing, tracing, prettifying and explaining your queries
  • Debugging your relabeling rules, downsampling and retention policy configurations
  • Integration with VictoriaMetrics Cloud
  • UI with setup instrinctions and tools inspection on the root endpoint (only in Streamable HTTP mode)

In addition, the MCP server contains embedded up-to-date documentation and is able to search it without online access.

image

More details about the exact available tools and prompts can be found in the Usage section.

You can combine functionality of tools, docs search in your prompts and invent great usage scenarios for your VictoriaMetrics instance. Just check the Dialog example section to see how it can work. And please note the fact that the quality of the MCP Server and its responses depends very much on the capabilities of your client and the quality of the model you are using.

You can also combine the MCP server with other observability or doc search related MCP Servers and get even more powerful results.

Try without installation

There is a publicly available instance of the VictoriaMetrics MCP Server that you can use to test the features without installing it:

https://play-mcp.victoriametrics.com/mcp

Attention! This URL is not supposed to be opened in a browser, it is intended to be used in MCP clients.

It's available in Streamable HTTP mode and configured to work with Public VictoriaMetrics Playground.

Here is example of configuration for Claude Desktop:

image

Requirements

Installation

Binaries

Just download the latest release from Releases page and put it to your PATH.

Example for Linux x86_64 (note that other architectures and platforms are also available):

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.gz

Docker

You can run VictoriaMetrics MCP Server using Docker.

This is the easiest way to get started without needing to install Go or build from source.

docker run -d --name mcp-victoriametrics \
  -e VM_INSTANCE_ENTRYPOINT=https://play.victoriametrics.com \
  -e VM_INSTANCE_TYPE=cluster \
  -e MCP_SERVER_MODE=sse \
  -e MCP_LISTEN_ADDR=:8080 \
  -e MCP_AUTH_TOKEN=your-secret-token \
  -p 8080:8080 \
  ghcr.io/victoriametrics/mcp-victoriametrics

You should replace environment variables with your own parameters.

Note that the MCP_SERVER_MODE=http flag is used to enable Streamable HTTP mode. More details about server modes can be found in the Configuration section.

See available docker images in github registry.

Also see Using Docker instead of binary section for more details about using Docker with MCP server with clients in stdio mode.

Source Code

For building binary from source code you can use the following approach:

  • Clone repo:

    git clone https://github.com/VictoriaMetrics/mcp-victoriametrics.git
    cd mcp-victoriametrics
    
  • Build binary from cloned source code:

    make build
    # after that you can find binary mcp-victoriametrics and copy this file to your PATH or run inplace
    
  • Build image from cloned source code:

    docker build -t mcp-victoriametrics .
    # after that you can use docker image mcp-victoriametrics for running or pushing
    

Helm

Check out VictoriaMetrics MCP Server Helm chart documentation for more details about installation using Helm.

Configuration

MCP Server for VictoriaMetrics is configured via environment variables:

VariableDescriptionRequiredDefaultAllowed values
VM_INSTANCE_ENTRYPOINT / VMC_API_KEYURL to VictoriaMetrics instance (it should be root / URL of vmsingle or vmselect)Yes (if you don't use VMC_API_KEY)--
VM_INSTANCE_TYPEType of VictoriaMetrics instanceYes (if you don't use VMC_API_KEY)-single, cluster
VM_INSTANCE_BEARER_TOKENAuthentication token for VictoriaMetrics APINo--
VM_INSTANCE_HEADERSCustom HTTP headers to send with requests (comma-separated key=value pairs)No--
VM_INSTANCE_CA_CERTPEM-encoded CA certificate(s) to verify the TLS certificates of VictoriaMetrics and the VictoriaMetrics Cloud API with, instead of the system CA bundle. Useful when mounting a CA file is not possible. Literal \n sequences are treated as newlines. Cannot be used with VM_INSTANCE_CA_CERT_FILENo--
VM_INSTANCE_CA_CERT_FILEPath to a file with PEM-encoded CA certificate(s) to verify the TLS certificates of VictoriaMetrics and the VictoriaMetrics Cloud API with, instead of the system CA bundle. The file is re-read automatically, so CA rotation does not need a restart. Cannot be used with VM_INSTANCE_CA_CERTNo--
MCP_PASSTHROUGH_HEADERSHTTP header names to forward from incoming MCP requests to VictoriaMetrics (comma-separated list). Overrides VM_INSTANCE_HEADERS on collision. Only applies in sse/http modes.No--
VM_DEFAULT_TENANT_IDDefault tenant ID for cluster mode. Format: accountID or accountID:projectID (32-bit integers). See VictoriaMetrics cluster docsNo0-
VMC_API_KEYAPI key from VictoriaMetrics Cloud ConsoleNo--
MCP_SERVER_MODEServer operation mode. See Modes for details.Nostdiostdio, sse, http
MCP_LISTEN_ADDRAddress for SSE or HTTP server to listen onNolocalhost:8080-
MCP_DISABLED_TOOLSComma-separated list of tools to disableNo'export,flags,metric_relabel_debug,downsampling_filters_debug,retention_filters_debug,test_rules'-
MCP_DISABLE_RESOURCESDisable all resources (documentation tool will continue to work)Nofalsefalse, true
MCP_HEARTBEAT_INTERVALDefines the heartbeat interval for the streamable-http protocol. It means the MCP server will send a heartbeat to the client through the GET connection, to keep the connection alive from being closed by the network infrastructure (e.g. gateways)No30s-
MCP_STATELESSRun the Streamable HTTP server in stateless mode (http mode only). Session IDs are ignored instead of validated, so the server does not reject an Mcp-Session-Id injected by a fronting platform. Required when hosting behind a proxy that manages sessions for you (e.g. AWS Bedrock AgentCore Runtime).Nofalsefalse, true
MCP_DISABLE_LOCALHOST_PROTECTIONDisable the Streamable HTTP DNS-rebinding guard (http mode only), which otherwise rejects (403) any loopback request whose Host header is not a localhost value. Set true only behind a same-host reverse proxy that forwards over 127.0.0.1 while preserving the original Host header (e.g. AWS Bedrock AgentCore Runtime).Nofalsefalse, true
MCP_MAX_RESPONSE_SIZEMaximum size in bytes of a VictoriaMetrics response that a tool reads. A larger response is returned as a tool error instead of being read in full. 0 disables the limit.No16777216-
MCP_INSTRUCTIONS_OVERRIDEText that fully replaces the default MCP server instructions sent to clients. Useful for tailoring the server to a particular instance (environment, tenants, naming conventions, etc.)No--
MCP_AUTH_TOKENBearer token for authenticating incoming MCP requests (only applies in sse/http modes). Public paths (/health/*, /metrics, /, static assets) are excluded from authentication.No--
MCP_LOG_FORMATLog output formatNotexttext, json
MCP_LOG_LEVELMinimum log level. debug also logs MCP request and result payloadsNoinfodebug, info, warn, error

You can use two options to connect to your VictoriaMetrics instance:

  • Using VM_INSTANCE_ENTRYPOINT + VM_INSTANCE_TYPE + VM_INSTANCE_BEARER_TOKEN (optional) environment variables to connect to any single-node or cluster instance of VictoriaMetrics.
  • Using VMC_API_KEY environment variable to work with your VictoriaMetrics Cloud instances.

Modes

MCP Server supports the following modes of operation (transports):

  • stdio - Standard input/output mode, where the server reads commands from standard input and writes responses to standard output. This is the default mode and is suitable for local servers.
  • sse - Server-Sent Events. Server will expose the /sse and /message endpoints for SSE connections.
  • http - Streamable HTTP. Server will expose the /mcp endpoint for HTTP connections.

Hosting http mode behind a reverse proxy (e.g. AWS Bedrock AgentCore Runtime). A platform that terminates MCP for you and forwards requests to this server over loopback — injecting its own Mcp-Session-Id and preserving the original (non-localhost) Host header — needs two toggles, otherwise tool discovery fails (the server crash-loops on session rejection, or returns 403 from the DNS-rebinding guard): set MCP_STATELESS=true and MCP_DISABLE_LOCALHOST_PROTECTION=true alongside MCP_SERVER_MODE=http. Leave both off for direct/local use.

More info about traqnsports you can find in MCP docs:

Сonfiguration examples

# For a single-node instance
export VM_INSTANCE_ENTRYPOINT="http://localhost:8428"
export VM_INSTANCE_TYPE="single"
export VM_INSTANCE_BEARER_TOKEN="your-token"
export MCP_PASSTHROUGH_HEADERS="X-Token,X-Access-Key"

# For a cluster
export VM_INSTANCE_ENTRYPOINT="https://play.victoriametrics.com"
export VM_INSTANCE_TYPE="cluster"
export MCP_DISABLED_TOOLS="export,metric_statistics,test_rules" # disable export, statistics and rules unit test tools

# For VictoriaMetrics Cloud
export VMC_API_KEY="<you-api-key>"

# Server mode
export MCP_SERVER_MODE="sse"
export MCP_LISTEN_ADDR="0.0.0.0:8080"

# Authentication (optional, only for sse/http modes)
export MCP_AUTH_TOKEN="your-secret-token"

# Custom headers for authentication (e.g., behind a reverse proxy)
# Expected syntax is key=value separated by commas
export VM_INSTANCE_HEADERS="<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"

Endpoints

In SSE and HTTP modes the MCP server provides the following endpoints:

EndpointDescription
/Landing page with setup help and tool inspection
/sse + /messageEndpoints for messages in SSE mode (for MCP clients that support SSE)
/mcpHTTP endpoint for streaming messages in HTTP mode (for MCP clients that support Streamable HTTP)
/metricsMetrics in Prometheus format for monitoring the MCP server
/health/livenessLiveness check endpoint to ensure the server is running
/health/readinessReadiness check endpoint to ensure the server is ready to accept requests

Setup in clients

Claude Desktop

Add this to your Claude Desktop claude_desktop_config.json file (you can find it if open Settings -> Developer -> Edit config):

{
  "mcpServers": {
    "victoriametrics": {
      "command": "/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": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    }
  }
}

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

{
  "mcpServers": {
    "victoriametrics": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:8080/mcp"]
    }
  }
}

See Claude Desktop MCP docs for more info.

Claude Code

Run the command:

claude mcp add victoriametrics \
  -e VM_INSTANCE_ENTRYPOINT=<YOUR_VM_INSTANCE> \
  -e VM_INSTANCE_TYPE=<YOUR_VM_INSTANCE_TYPE> \
  -e VM_INSTANCE_BEARER_TOKEN=<YOUR_VM_BEARER_TOKEN> \
  -e VM_INSTANCE_HEADERS="<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>" \
  -- /path/to/mcp-victoriametrics

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

claude mcp add victoriametrics --transport http http://localhost:8080/mcp

See Claude Code MCP docs for more info.

Cursor

Go to: Settings -> Cursor Settings -> MCP -> Add new global MCP server and paste the following configuration into your Cursor ~/.cursor/mcp.json file:

{
  "mcpServers": {
    "victoriametrics": {
      "command": "/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": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    }
  }
}

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

{
  "mcpServers": {
    "victoriametrics": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

See Cursor MCP docs for more info.

Codex

Codex CLI and the IDE extension use the same MCP configuration file: ~/.codex/config.toml (or .codex/config.toml in a trusted project).

Run the command:

codex mcp add victoriametrics \
  --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="<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>" \
  -- /path/to/mcp-victoriametrics

Or add the following to your Codex ~/.codex/config.toml file:

[mcp_servers.victoriametrics]
command = "/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 = "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

codex mcp add victoriametrics --url http://localhost:8080/mcp

See Codex MCP docs for more info.

Visual Studio Code

Add this to your VS Code MCP config file:

{
  "servers": {
    "victoriametrics": {
      "type": "stdio",
      "command": "/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": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    }
  }
}

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

{
  "servers": {
    "victoriametrics": {
      "type": "http",
      "url": "http://localhost:8080/mcp"
    }
  }
}

See Visual Studio Code MCP docs for more info.

Zed

Add the following to your Zed config file:

"context_servers": {
  "victoriametrics": {
    "command": {
      "path": "/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": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    },
    "settings": {}
  }
}

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

{
  "context_servers": {
    "victoriametrics": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

See Zed MCP docs for more info.

JetBrains IDEs

  • Open Settings -> Tools -> AI Assistant -> Model Context Protocol (MCP).
  • Click Add (+)
  • Select As JSON
  • Put the following to the input field:
{
  "mcpServers": {
    "victoriametrics": {
      "command": "/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": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    }
  }
}

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

{
  "mcpServers": {
    "victoriametrics": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

Windsurf

Add the following to your Windsurf MCP config file:

{
  "mcpServers": {
    "victoriametrics": {
      "command": "/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": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    }
  }
}

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

{
  "mcpServers": {
    "victoriametrics": {
      "serverUrl": "http://localhost:8080/mcp"
    }
  }
}

See Windsurf MCP docs for more info.

Gemini CLI

Add the following to your Gemini CLI ~/.gemini/settings.json file:

{
  "mcpServers": {
    "victoriametrics": {
      "command": "/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": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    }
  }
}

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

gemini mcp add victoriametrics --transport http http://localhost:8080/mcp

See Gemini CLI MCP docs for more info.

OpenCode

Add the following to your OpenCode config file in ~/.config/opencode/opencode.json:

{
  "mcp": {
    "victoriametrics": {
      "type": "local",
      "command": ["/path/to/mcp-victoriametrics"],
      "enabled": true,
      "environment": {
        "VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",
        "VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",
        "VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",
        "VM_INSTANCE_HEADERS": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    }
  }
}

To connect to a server running in Streamable HTTP mode at http://localhost:8080:

{
  "mcp": {
    "victoriametrics": {
      "type": "remote",
      "url": "http://localhost:8080/mcp"
    }
  }
}

See OpenCode MCP docs for more info.

Using Docker instead of binary

You can run VictoriaMetrics MCP server using Docker instead of local binary.

You should replace run command in configuration examples above in the following way:

{
  "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": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"
      }
    }
  }
}

Usage

After installing and configuring the MCP server, you can start using it with your favorite MCP client.

You can start dialog with AI assistant from the phrase:

Use MCP VictoriaMetrics in the following answers

But it's not required, you can just start asking questions and the assistant will automatically use the tools and documentation to provide you with the best answers. Just take a look into Dialog example section for better understanding what you can do with it.

Tools and prompts

MCP Server provides numerous tools for interacting with your VictoriaMetrics instance and pre-defined prompts for common tasks.

Tools:

ToolDescriptionEnabled by default
active_queriesActive queries✅
alertsList of alerts✅
documentationSearch VictoriaMetrics documentation✅
downsampling_filters_debugDownsampling filters debugger❌
explain_queryExplain Query✅
exportExport time series❌
flagsList of non-default flags (parameters)❌
label_valuesList of label values✅
labelsList of label names✅
metric_relabel_debugMetric relabel debugger❌
metric_statisticsMetric statistics✅
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 (cluster mode only)✅
test_rulesUnit test rules❌
top_queriesTop queries✅
tsdb_statusTSDB Stats (information about cardinality of the data)✅

Prompts:

PromptDescription
documentationSearch by VictoriaMetrics documentation or give context for answering questions
rarely_used_metrics_with_high_cardinalityList of rarely used metrics with high cardinality in the VictoriaMetrics instance API
unused_metricsList of unused (never queried) metrics in the VictoriaMetrics instance API
VictoriaMetrics Cloud

Additional tools available for VictoriaMetrics Cloud deployments (with VMC_API_KEY parameter). In this mode, tools working with data require the deployment_id parameter.

ToolDescriptionEnabled by default
access_tokensList of deployment access tokens✅
cloud_providersList of cloud providers✅
deploymentsList of deployments✅
regionsList of regions✅
rule_fileGet rules file content✅
rule_filenamesList of filenames of alerting and recording rules✅
tiersList of tiers✅

Dialog example

Here is an example of a real dialog with the Assistant using the MCP Server with Claude Desktop, configured to work with the public playground instance. It shows how the server can help in practice.

👤 You: What tenants are available in my VM?

🤖 In your VictoriaMetrics instance, the following tenants are available 0:0 (default tenant), 1:0, 10:0, 100:0

👤 You: From now on, please use only default tenant

🤖 I understand. From now on, I'll use only the default tenant (0:0) for all operations with your VictoriaMetrics instance.

👤 You: Which metrics do we have?

🤖 There are many metrics available in your VictoriaMetrics instance. The list includes metrics from various systems and components, such as:

  • System metrics (node_, machine_, etc.),
  • Kubernetes metrics (kube_, container_, apiserver_, etc.),
  • VictoriaMetrics-specific metrics (vm_, vmagent_, vmalert_, etc.),
  • Go runtime metrics (go_),
  • Prometheus-related metrics (scrape_, promhttp_),
  • Various application metrics (argocd_, alertmanager_).

This is a comprehensive list of over 2000 metrics that are available for querying. Is there a specific type of metric you're interested in exploring further?

👤 You: Ok, let's work with kubernetes metrics from now on. Please show me which of these metrics never queried?

🤖 Based on the results, I can see that there are two Kubernetes metrics that have never been queried (query count is 0):

  • kube_persistentvolumeclaim_deletion_timestamp - This metric provides information about when PersistentVolumeClaims were marked for deletion.
  • kube_pod_init_container_status_last_terminated_reason - This metric shows the reason why init containers in pods were last terminated.

These metrics might be valuable for monitoring and troubleshooting purposes:

  • The PVC deletion timestamp metric could help track deletion patterns or identify stuck PVCs.
  • The init container termination reason metric could help identify common failure patterns in your initialization containers.

Would you like me to explain more about what these metrics track or suggest some useful queries to start monitoring them?

👤 You: Yes, please. And also, can you create relabeling rules to stop ingesting these metrics?

🤖 I'll create a relabel configuration to exclude these never-queried metrics from collection. This will help reduce storage and processing overhead. Here's the relabel configuration you can add to your VictoriaMetrics scrape configuration:

relabel_configs:
- action: drop
  source_labels: [__name__]
  regex: kube_persistentvolumeclaim_deletion_timestamp|kube_pod_init_container_status_last_terminated_reason

This configuration will:

  1. Look at each metric's name (the __name__ label)
  2. Check if it matches either of the specified metrics
  3. Drop the metrics that match, preventing them from being collected and stored

You can add this to your VictoriaMetrics configuration file or to the relevant scrape job configurations in your Prometheus configuration if you're using Prometheus as a scraper for VictoriaMetrics. If you want to test this relabel configuration before implementing it, you can use the metric relabel debug tool to see how it would affect your metrics.

👤 You: Yes, please debug this relabel config on real time series to see how it would affect my metrics

🤖 Perfect! The relabel config works as expected:

  • The first two test cases show that both kube_persistentvolumeclaim_deletion_timestamp and kube_pod_init_container_status_last_terminated_reason metrics are correctly dropped (resulting labels are empty {}).
  • The third test case confirms that other metrics like kube_pod_status_phase are preserved and not affected by our drop rule.

You can confidently add this relabel configuration to your VictoriaMetrics or Prometheus configuration to stop collecting these unused metrics. This will save storage space and reduce processing overhead without affecting your current monitoring capabilities.

👤 You: But i'm using vmagent resource of VictoriaMetrics operator, could you please give me part of specification for my agent with this relabel config?

Documentation truncated — see the full README on GitHub.

Reviews

No reviews yet

Be the first to review this server!