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 e
Add this skill
npx mdskills install VictoriaMetrics-Community/mcp-victoriametricsComprehensive monitoring MCP server with extensive VictoriaMetrics API access and embedded docs
1# <img width="25" height="25" alt="vm-community-icon" src="https://github.com/user-attachments/assets/1c060750-370a-4440-b619-78b78c7abd7a" /> VictoriaMetrics MCP Server23[](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases)4[](https://archestra.ai/mcp-catalog/victoriametrics-community__mcp-victoriametrics)5678910The implementation of [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [VictoriaMetrics](https://docs.victoriametrics.com/victoriametrics/).1112This provides access to your VictoriaMetrics instance and seamless integration with [VictoriaMetrics APIs](https://docs.victoriametrics.com/victoriametrics/url-examples/) and [documentation](https://docs.victoriametrics.com/).13It 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.1415## Features1617This MCP server allows you to use almost all read-only APIs of VictoriaMetrics, i.e. all functions available in [VMUI](https://docs.victoriametrics.com/#vmui):1819- Querying metrics and exploring data (even drawing graphs if your client supports it)20- Listing and exporting available metrics, labels, labels values and entire series21- Analyzing and testing your alerting and recording rules and alerts22- Showing parameters of your VictoriaMetrics instance23- Exploring cardinality of your data and metrics usage statistics24- Analyzing, tracing, prettifying and explaining your queries25- Debugging your relabeling rules, downsampling and retention policy configurations26- Integration with [VictoriaMetrics Cloud](https://docs.victoriametrics.com/victoriametrics-cloud/)2728In addition, the MCP server contains embedded up-to-date documentation and is able to search it without online access.2930More details about the exact available tools and prompts can be found in the [Usage](#usage) section.3132You can combine functionality of tools, docs search in your prompts and invent great usage scenarios for your VictoriaMetrics instance.33Just check the [Dialog example](#dialog-example) section to see how it can work.34And 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.3536You can also combine the MCP server with other observability or doc search related MCP Servers and get even more powerful results.3738## Try without installation3940There is a publicly available instance of the VictoriaMetrics MCP Server that you can use to test the features without installing it:4142```43https://play-mcp.victoriametrics.com/mcp44```4546**Attention!** This URL is not supposed to be opened in a browser, it is intended to be used in MCP clients.4748It's available in [Streamable HTTP](#modes) mode and configured to work with [Public VictoriaMetrics Playground](https://play.victoriametrics.com).4950Here is example of configuration for [Claude Desktop](https://claude.ai/download):51525354## Requirements5556- [VictoriaMetrics](https://docs.victoriametrics.com/victoriametrics/) or [VictoriaMetrics Cloud](https://docs.victoriametrics.com/victoriametrics-cloud/) instance ([single-node](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/) or [cluster](https://docs.victoriametrics.com/victoriametrics/cluster-victoriametrics/))57- Go 1.24 or higher (if you want to build from source)5859## Installation6061### Go6263```bash64go install github.com/VictoriaMetrics-Community/mcp-victoriametrics/cmd/mcp-victoriametrics@latest65```6667### Binaries6869Just download the latest release from [Releases](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases) page and put it to your PATH.7071Example for Linux x86_64 (note that other architectures and platforms are also available):7273```bash74latest=$(curl -s https://api.github.com/repos/VictoriaMetrics-Community/mcp-victoriametrics/releases/latest | grep 'tag_name' | cut -d\" -f4)75wget https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases/download/$latest/mcp-victoriametrics_Linux_x86_64.tar.gz76tar axvf mcp-victoriametrics_Linux_x86_64.tar.gz77```7879### Docker8081You can run VictoriaMetrics MCP Server using Docker.8283This is the easiest way to get started without needing to install Go or build from source.8485```bash86docker run -d --name mcp-victoriametrics \87 -e VM_INSTANCE_ENTRYPOINT=https://play.victoriametrics.com \88 -e VM_INSTANCE_TYPE=cluster \89 -e MCP_SERVER_MODE=sse \90 -e MCP_LISTEN_ADDR=:8080 \91 -p 8080:8080 \92 ghcr.io/victoriametrics-community/mcp-victoriametrics93```9495You should replace environment variables with your own parameters.9697Note that the `MCP_SERVER_MODE=http` flag is used to enable Streamable HTTP mode.98More details about server modes can be found in the [Configuration](#configuration) section.99100See available docker images in [github registry](https://github.com/orgs/VictoriaMetrics-Community/packages/container/package/mcp-victoriametrics).101102Also see [Using Docker instead of binary](#using-docker-instead-of-binary) section for more details about using Docker with MCP server with clients in stdio mode.103104### Source Code105106For building binary from source code you can use the following approach:107108- Clone repo:109110 ```bash111 git clone https://github.com/VictoriaMetrics-Community/mcp-victoriametrics.git112 cd mcp-victoriametrics113 ```114- Build binary from cloned source code:115116 ```bash117 make build118 # after that you can find binary mcp-victoriametrics and copy this file to your PATH or run inplace119 ```120- Build image from cloned source code:121122 ```bash123 docker build -t mcp-victoriametrics .124 # after that you can use docker image mcp-victoriametrics for running or pushing125 ```126127## Configuration128129MCP Server for VictoriaMetrics is configured via environment variables:130131| Variable | Description | Required | Default | Allowed values |132|------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------|---------------------------------------------------------------------------------------------------|------------------------|133| `VM_INSTANCE_ENTRYPOINT` / `VMC_API_KEY` | URL to VictoriaMetrics instance (it should be root `/` URL of vmsingle or vmselect) | Yes (if you don't use `VMC_API_KEY`) | - | - |134| `VM_INSTANCE_TYPE` | Type of VictoriaMetrics instance | Yes (if you don't use ``VMC_API_KEY``) | - | `single`, `cluster` |135| `VM_INSTANCE_BEARER_TOKEN` | Authentication token for VictoriaMetrics API | No | - | - |136| `VM_INSTANCE_HEADERS` | Custom HTTP headers to send with requests (comma-separated key=value pairs) | No | - | - |137| `VM_DEFAULT_TENANT_ID` | Default tenant ID for cluster mode. Format: `accountID` or `accountID:projectID` (32-bit integers). See [VictoriaMetrics cluster docs](https://docs.victoriametrics.com/cluster-victoriametrics/#multitenancy) | No | `0` | - |138| `VMC_API_KEY` | [API key from VictoriaMetrics Cloud Console](https://docs.victoriametrics.com/victoriametrics-cloud/api/) | No | - | - |139| `MCP_SERVER_MODE` | Server operation mode. See [Modes](#modes) for details. | No | `stdio` | `stdio`, `sse`, `http` |140| `MCP_LISTEN_ADDR` | Address for SSE or HTTP server to listen on | No | `localhost:8080` | - |141| `MCP_DISABLED_TOOLS` | Comma-separated list of tools to disable | No | 'export,flags,metric_relabel_debug,downsampling_filters_debug,retention_filters_debug,test_rules' | - |142| `MCP_DISABLE_RESOURCES` | Disable all resources (documentation tool will continue to work) | No | `false` | `false`, `true` |143| `MCP_HEARTBEAT_INTERVAL` | Defines the heartbeat interval for the streamable-http protocol. <br /> It means the MCP server will send a heartbeat to the client through the GET connection, <br /> to keep the connection alive from being closed by the network infrastructure (e.g. gateways) | No | `30s` | - |144| `MCP_LOG_FORMAT` | Log output format | No | `text` | `text`, `json` |145| `MCP_LOG_LEVEL` | Minimum log level | No | `info` | `debug`, `info`, `warn`, `error` |146147You can use two options to connect to your VictoriaMetrics instance:148149- 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.150- Using `VMC_API_KEY` environment variable to work with your [VictoriaMetrics Cloud](https://victoriametrics.com/products/cloud/) instances.151152### Modes153154MCP Server supports the following modes of operation (transports):155156- `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.157- `sse` - Server-Sent Events. Server will expose the `/sse` and `/message` endpoints for SSE connections.158- `http` - Streamable HTTP. Server will expose the `/mcp` endpoint for HTTP connections.159160More info about traqnsports you can find in MCP docs:161162- [Core concepts -> Transports](https://modelcontextprotocol.io/docs/concepts/transports)163- [Specifications -> Transports](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports)164165### Сonfiguration examples166167```bash168# For a single-node instance169export VM_INSTANCE_ENTRYPOINT="http://localhost:8428"170export VM_INSTANCE_TYPE="single"171export VM_INSTANCE_BEARER_TOKEN="your-token"172173# For a cluster174export VM_INSTANCE_ENTRYPOINT="https://play.victoriametrics.com"175export VM_INSTANCE_TYPE="cluster"176export MCP_DISABLED_TOOLS="export,metric_statistics,test_rules" # disable export, statistics and rules unit test tools177178# For VictoriaMetrics Cloud179export VMC_API_KEY="<you-api-key>"180181# Server mode182export MCP_SERVER_MODE="sse"183export MCP_LISTEN_ADDR="0.0.0.0:8080"184185# Custom headers for authentication (e.g., behind a reverse proxy)186# Expected syntax is key=value separated by commas187export VM_INSTANCE_HEADERS="<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"188```189190## Endpoints191192In SSE and HTTP modes the MCP server provides the following endpoints:193194| Endpoint | Description |195|----------------------|---------------------------------------------------------------------------------------------------|196| `/sse` + `/message` | Endpoints for messages in SSE mode (for MCP clients that support SSE) |197| `/mcp` | HTTP endpoint for streaming messages in HTTP mode (for MCP clients that support Streamable HTTP) |198| `/metrics` | Metrics in Prometheus format for monitoring the MCP server |199| `/health/liveness` | Liveness check endpoint to ensure the server is running |200| `/health/readiness` | Readiness check endpoint to ensure the server is ready to accept requests |201202## Setup in clients203204### Cursor205206Go to: `Settings` -> `Cursor Settings` -> `MCP` -> `Add new global MCP server` and paste the following configuration into your Cursor `~/.cursor/mcp.json` file:207208```json209{210 "mcpServers": {211 "victoriametrics": {212 "command": "/path/to/mcp-victoriametrics",213 "env": {214 "VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",215 "VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",216 "VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",217 "VM_INSTANCE_HEADERS": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"218 }219 }220 }221}222```223224See [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) for more info.225226### Claude Desktop227228Add this to your Claude Desktop `claude_desktop_config.json` file (you can find it if open `Settings` -> `Developer` -> `Edit config`):229230```json231{232 "mcpServers": {233 "victoriametrics": {234 "command": "/path/to/mcp-victoriametrics",235 "env": {236 "VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",237 "VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",238 "VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",239 "VM_INSTANCE_HEADERS": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"240 }241 }242 }243}244```245246See [Claude Desktop MCP docs](https://modelcontextprotocol.io/quickstart/user) for more info.247248### Claude Code249250Run the command:251252```sh253claude mcp add victoriametrics -- /path/to/mcp-victoriametrics \254 -e VM_INSTANCE_ENTRYPOINT=<YOUR_VM_INSTANCE> \255 -e VM_INSTANCE_TYPE=<YOUR_VM_INSTANCE_TYPE>256 -e VM_INSTANCE_BEARER_TOKEN=<YOUR_VM_BEARER_TOKEN>257 -e VM_INSTANCE_HEADERS="<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"258```259260See [Claude Code MCP docs](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp) for more info.261262### Visual Studio Code263264Add this to your VS Code MCP config file:265266```json267{268 "servers": {269 "victoriametrics": {270 "type": "stdio",271 "command": "/path/to/mcp-victoriametrics",272 "env": {273 "VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",274 "VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",275 "VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",276 "VM_INSTANCE_HEADERS": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"277 }278 }279 }280}281```282283See [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.284285### Zed286287Add the following to your Zed config file:288289```json290 "context_servers": {291 "victoriametrics": {292 "command": {293 "path": "/path/to/mcp-victoriametrics",294 "args": [],295 "env": {296 "VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",297 "VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",298 "VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",299 "VM_INSTANCE_HEADERS": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"300 }301 },302 "settings": {}303 }304 }305```306307See [Zed MCP docs](https://zed.dev/docs/ai/mcp) for more info.308309### JetBrains IDEs310311- Open `Settings` -> `Tools` -> `AI Assistant` -> `Model Context Protocol (MCP)`.312- Click `Add (+)`313- Select `As JSON`314- Put the following to the input field:315316```json317{318 "mcpServers": {319 "victoriametrics": {320 "command": "/path/to/mcp-victoriametrics",321 "env": {322 "VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",323 "VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",324 "VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",325 "VM_INSTANCE_HEADERS": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"326 }327 }328 }329}330```331332### Windsurf333334Add the following to your Windsurf MCP config file.335336```json337{338 "mcpServers": {339 "victoriametrics": {340 "command": "/path/to/mcp-victoriametrics",341 "env": {342 "VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",343 "VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",344 "VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",345 "VM_INSTANCE_HEADERS": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"346 }347 }348 }349}350```351352See [Windsurf MCP docs](https://docs.windsurf.com/windsurf/mcp) for more info.353354### Using Docker instead of binary355356You can run VictoriaMetrics MCP server using Docker instead of local binary.357358You should replace run command in configuration examples above in the following way:359360```361{362 "mcpServers": {363 "victoriametrics": {364 "command": "docker",365 "args": [366 "run",367 "-i", "--rm",368 "-e", "VM_INSTANCE_ENTRYPOINT",369 "-e", "VM_INSTANCE_TYPE",370 "-e", "VM_INSTANCE_BEARER_TOKEN",371 "-e", "VM_INSTANCE_HEADERS",372 "ghcr.io/victoriametrics-community/mcp-victoriametrics",373 ],374 "env": {375 "VM_INSTANCE_ENTRYPOINT": "<YOUR_VM_INSTANCE>",376 "VM_INSTANCE_TYPE": "<YOUR_VM_INSTANCE_TYPE>",377 "VM_INSTANCE_BEARER_TOKEN": "<YOUR_VM_BEARER_TOKEN>",378 "VM_INSTANCE_HEADERS": "<HEADER>=<HEADER_VALUE>,<HEADER>=<HEADER_VALUE>"379 }380 }381 }382}383```384385## Usage386387After [installing](#installation) and [configuring](#setup-in-clients) the MCP server, you can start using it with your favorite MCP client.388389You can start dialog with AI assistant from the phrase:390391```392Use MCP VictoriaMetrics in the following answers393```394395But 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.396Just take a look into [Dialog example](#dialog-example) section for better understanding what you can do with it.397398### Toolset399400MCP VictoriaMetrics provides numerous tools for interacting with your VictoriaMetrics instance.401402Here's a list of common available tools:403404| Tool | Description | Enabled by default |405|------------------------------|-----------------------------------------------------------|:------------------:|406| `query` | Execute instant PromQL/MetricsQL queries | ✅ |407| `query_range` | Execute range PromQL/MetricsQL queries over a time period | ✅ |408| `metrics` | List available metrics | ✅ |409| `metrics_metadata` | Stored metrics metadata (type, help and unit) | ✅ |410| `labels` | List available label names | ✅ |411| `label_values` | List values for a specific label | ✅ |412| `series` | List available time series | ✅ |413| `export` | Export raw time series data to JSON or CSV | ❌ |414| `rules` | View alerting and recording rules | ✅ |415| `alerts` | View current alerts (firing and pending) | ✅ |416| `flags` | View non-default flags of the VictoriaMetrics instance | ❌ |417| `metric_statistics` | Get metrics usage (in queries) statistics | ✅ |418| `active_queries` | View currently executing queries | ✅ |419| `top_queries` | View most frequent or slowest queries | ✅ |420| `tsdb_status` | View TSDB cardinality statistics | ✅ |421| `tenants` | List available tenants in multi-tenant cluster setup | ✅ |422| `documentation` | Search in embedded VictoriaMetrics documentation | ✅ |423| `metric_relabel_debug` | Debug Prometheus-compatible relabeling rules | ❌ |424| `downsampling_filters_debug` | Debug downsampling configuration | ❌ |425| `retention_filters_debug` | Debug retention filters configuration | ❌ |426| `prettify_query` | Prettify and format PromQL/MetricsQL queries | ✅ |427| `explain_query` | Parse PromQL/MetricsQL queries and explain how it works | ✅ |428| `test_rules` | Unit-test alerting and recording rules using vmalert tool | ❌ |429430Here are some additional tools that are available for [VictoriaMetrics Cloud](https://docs.victoriametrics.com/victoriametrics-cloud/) (with specifying `VMC_API_KEY` parameter) users:431432| Tool | Description | Enabled by default |433|-------------------|--------------------------------------------------------------------------------|:------------------:|434| `deployments` | List available deployments in VictoriaMetrics Cloud | ✅ |435| `cloud_providers` | List available cloud providers in VictoriaMetrics Cloud | ✅ |436| `regions` | List available cloud providers regions in VictoriaMetrics Cloud | ✅ |437| `tiers` | List available deployment tiers in VictoriaMetrics Cloud | ✅ |438| `access_tokens` | List available deployment access tokens in VictoriaMetrics Cloud | ✅ |439| `rule_filenames` | List available alerting and recording rule filenames in VictoriaMetrics Cloud | ✅ |440| `rule_file` | Content of a specific alerting or recording rule file in VictoriaMetrics Cloud | ✅ |441442### Prompts443444The server includes pre-defined prompts for common tasks.445446These are just examples at the moment, the prompt library will be added to in the future:447448| Prompt | Description |449|--------|-------------|450| `unused_metrics` | Find metrics that are never queried and create relabel configs to stop ingesting them |451| `documentation` | Search VictoriaMetrics documentation for specific topics |452| `rarely_used_metrics_with_high_cardinality` | Identify high-cardinality metrics that are rarely queried |453454## Dialog example455456This is just example of dialog with Assistant using MCP Server that can help to understand how it can work (but's it's real dialog with using the Victoria Metrics MCP server with Claude Desktop and configured to [public playground instance](https://play.victoriametrics.com)):457458- > **You**: What tenants are available in my VM?459- > **Assistant** *In your VictoriaMetrics instance, the following tenants are available `0:0` (default tenant), `1:0`, `10:0`, `100:0`*460- > **You**: From now on, please use only default tenant461- > **Assistant**: *I understand. From now on, I'll use only the default tenant (0:0) for all operations with your VictoriaMetrics instance.*462- > **You**: Which metrics do we have?463- > **Assistant**: *There are many metrics available in your VictoriaMetrics instance. The list includes metrics from various systems and components, such as:*464 >465 > - *System metrics (`node_`, `machine_`, etc.),*466 > - *Kubernetes metrics (`kube_`, `container_`, `apiserver_`, etc.),*467 > - *VictoriaMetrics-specific metrics (`vm_`, `vmagent_`, `vmalert_`, etc.),*468 > - *Go runtime metrics (`go_`),*469 > - *Prometheus-related metrics (`scrape_`, `promhttp_`),*470 > - *Various application metrics (`argocd_`, `alertmanager_`).*471 >472 > *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?*473- > **You**: Ok, let's work with kubernetes metrics from now on. Please show me which of these metrics never queried?474- > **Assistant**: *Based on the results, I can see that there are two Kubernetes metrics that have never been queried (query count is 0):*475 >476 > - *`kube_persistentvolumeclaim_deletion_timestamp` - This metric provides information about when PersistentVolumeClaims were marked for deletion.*477 > - *`kube_pod_init_container_status_last_terminated_reason` - This metric shows the reason why init containers in pods were last terminated.*478 >479 > *These metrics might be valuable for monitoring and troubleshooting purposes:*480 >481 > - *The PVC deletion timestamp metric could help track deletion patterns or identify stuck PVCs.*482 > - *The init container termination reason metric could help identify common failure patterns in your initialization containers.*483 >484 > *Would you like me to explain more about what these metrics track or suggest some useful queries to start monitoring them?*485- > **You**: Yes, please. And also, can you create relabeling rules to stop ingesting these metrics?486- > **Assistant**: *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:*487 >488 > ```yaml489 > relabel_configs:490 > - action: drop491 > source_labels: [__name__]492 > regex: kube_persistentvolumeclaim_deletion_timestamp|kube_pod_init_container_status_last_terminated_reason493 > ```494 >495 > *This configuration will:*496 > 1. *Look at each metric's name (the `__name__` label)*497 > 2. *Check if it matches either of the specified metrics*498 > 3. *Drop the metrics that match, preventing them from being collected and stored*499 >500 > *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.*501 > *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.*502- > **You**: Yes, please debug this relabel config on real time series to see how it would affect my metrics503- > **Assistant**: *Perfect! The relabel config works as expected:*504 >505 > - *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 `{}`).*506 > - *The third test case confirms that other metrics like `kube_pod_status_phase` are preserved and not affected by our drop rule.*507 >508 > *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.*509- > **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?510- > **Assistant**: *You're right, since you're using the VictoriaMetrics Operator and the VMAgent custom resource, the configuration needs to be in the appropriate format for that CR. Here's how you can add the relabel configuration to your VMAgent specification:*511 >512 > ```yaml513 > apiVersion: operator.victoriametrics.com/v1beta1514 > kind: VMAgent515 > metadata:516 > name: your-vmagent-name517 > spec:518 > # ... your existing configuration ...519 >520 > # Add this section to configure global metric relabeling521 > inlineRelabelConfig:522 > - action: drop523 > sourceLabels: ["__name__"]524 > regex: kube_persistentvolumeclaim_deletion_timestamp|kube_pod_init_container_status_last_terminated_reason525 >526 > # ... rest of your configuration ...527 > ```528 >529 > *Key points:*530 >531 > - *In the VMAgent spec, you use `inlineRelabelConfig` for inline relabeling rules*532 > - *The field is called `sourceLabels` (not `source_labels` as in Prometheus config)*533 > - *This is a global relabeling that will be applied to all metrics before they're stored*534- > **You**: I decided not to remove those metrics, but just lower the sample rate for them using Downsampling. What downsampling parameters i have now?535- > **Assistant**: *I can see that you currently have the following downsampling configuration:*536 >537 > ```538 > -downsampling.period="7d:1m,30d:5m,180d:30m"539 > ```540 >541 > *This means:*542 >543 > - *Data newer than 7 days is kept at its original resolution*544 > - *Data between 7-30 days old is downsampled to 1-minute resolution*545 > - *Data between 30-180 days old is downsampled to 5-minute resolution*546 > - *Data older than 180 days is downsampled to 30-minute resolution*547 >548 > *Now, if you want to add specific downsampling rules for those rarely-queried metrics, you can use the downsampling filters debug tool to test how new rules would work. Let's test a configuration where we apply more aggressive downsampling to those specific metrics:*549 >550 > *...getting series and using downsampling filter debugger...*551 >552 > *Great! Now our test is working correctly. Based on the current configuration and our testing, here's a suggested downsampling configuration for your VMAgent CR that would apply more aggressive downsampling to those rarely-queried metrics:*553 >554 > ```yaml555 > apiVersion: operator.victoriametrics.com/v1beta1556 > kind: VMCluster557 > metadata:558 > name: monitoring-vm-cluster559 > spec:560 > # ... your existing configuration ...561 >562 > # Update the vmstorage section with the new downsampling parameters563 > vmstorage:564 > extraArgs:565 > downsampling.period: '{__name__=\"kube_persistentvolumeclaim_deletion_timestamp\"}:1d:10m,{__name__=\"kube_pod_init_container_status_last_terminated_reason\"}:1d:10m,7d:1m,30d:5m,180d:30m'566 >567 > # ... rest of your configuration ...568 > ```569 >570 > *This configuration:*571 >572 > *- Applies 10-minute resolution downsampling for the rarely-queried metrics after just 1 day*573 > *- Maintains your existing downsampling policy for all other metrics*574 >575 > *The order of the downsampling rules is important - more specific rules should be listed first.*576577During this dialog, the assistant was using the following tools:578579- `tenants` to get the list of available tenants580- `documentation` to get information about functionality and data formats581- `metrics` to get the list of available metrics582- `metrics_staistics` to get the information about metrics usage583- `series` to get the time series for debugging584- `metric_relabel_debug` to debug relabeling rules585- `flags` to get the information about instance parameters586- `downsampling_filters_debug` to debug downsampling configuration587588But you can use any other tools and combine them in your own way.589590## Monitoring591592In [SSE and HTTP modes](#modes) the MCP Server provides metrics in Prometheus format (see [endpoints](#endpoints)) and you can find [in repo simple grafana dashboard](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/blob/main/dashboard/mcp-victoriametrics-grafana.json) for these metrics.593594## Roadmap595596- [x] Support "Prettify query" tool (done in [`v0.0.5`](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases/tag/v0.0.5))597- [x] Support "Explain query" tool (done in [`v0.0.6`](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases/tag/v0.0.6))598- [x] Support CI pipeline for building and pushing multiarch docker images (done in [`v1.0.0`](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases/tag/v1.0.0))599- [ ] Support tool for analysis of [Query execution statistics](https://docs.victoriametrics.com/victoriametrics/query-stats/)600- [ ] Support vmanomaly601- [x] Support tool for [unit-testing of alerting and recording rules](https://docs.victoriametrics.com/victoriametrics/vmalert-tool/) (done in [`v0.0.7`](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases/tag/v0.0.7))602- [x] Support optional integration with [VictoriaMetrics Cloud](https://victoriametrics.com/products/cloud/) (via [API keys](https://docs.victoriametrics.com/victoriametrics-cloud/api/)) (done in [`v0.0.9`](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases/tag/v0.0.9))603- [ ] Add some extra knowledge to server in addition to current documentation tool:604 - [x] [VictoriaMetrics blog](https://victoriametrics.com/blog/) posts (done in [`v1.1.0`](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases/tag/v1.1.0))605 - [ ] Github issues606 - [ ] Public slack chat history607 - [ ] CRD schemas608 - [ ] Alerting and recording rule sets609- [ ] Implement multitenant version of MCP (that will support several deployments)610- [ ] Add flags/configs validation tool611- [ ] Support tools for vmagent API612- [ ] Support [new vmalert API](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/9046/files)613- [x] Enabling/disabling tools via configuration (done in [`v0.0.8`](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/releases/tag/v0.0.8))614- [ ] Tools for Alertmanager APIs [#6](https://github.com/VictoriaMetrics-Community/mcp-victoriametrics/issues/6)615- [ ] Support for [metrics metadata](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2974) in case of implementation in VictoriaMetrics616- [ ] Support authentication617- [ ] Add static index page with description and links to documentation618619## Mentions620621[<img src="https://github.com/user-attachments/assets/76355b76-8a54-487d-a7d9-0b64886938fb" alt="How to Use an AI Assistant with Your Monitoring System – VictoriaMetrics MCP Server" width="520px" />](https://www.youtube.com/watch?v=1k7xgbRi1k0)622623[<img src="https://github.com/user-attachments/assets/2b93a545-7834-4020-aa2c-369ddcc90a29" alt="MCP Server Integration & Much More: What's New in VictoriaMetrics Cloud Q2 2025" width="520px" />](https://victoriametrics.com/blog/q2-2025-whats-new-victoriametrics-cloud/)624625## Disclaimer626627AI services and agents along with MCP servers like this cannot guarantee the accuracy, completeness and reliability of results.628You should double check the results obtained with AI.629630The 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.631632## Contributing633634Contributions to the MCP VictoriaMetrics project are welcome!635636Please feel free to submit issues, feature requests, or pull requests.637
Full transparency — inspect the skill content before installing.