
Mcp Victoriametrics
io.github.VictoriaMetrics-Community由 GitHub 帳號 VictoriaMetrics-Community 發布v1.18.0更新於 Oct 24, 2026
MCP Server for VictoriaMetrics. Provides integration with VictoriaMetrics API and documentation
概覽
VictoriaMetrics 的 MCP 伺服器,讓助理查詢指標、檢視序列、標籤與規則,並檢索內建文件。
- 可以做什麼
- 執行即時與範圍 PromQL 查詢,並美化、解釋或追蹤查詢
- 列出指標、中繼資料、標籤名稱與標籤值、時間序列及租戶
- 檢視告警與記錄規則、告警清單、作用中查詢與熱門查詢、TSDB 基數及實例參數
- 偵錯 relabel、降取樣與保留策略篩選器,並對規則做單元測試(預設關閉)
- 離線檢索內建的 VictoriaMetrics 文件
- 設定 Cloud API 金鑰後可管理 VictoriaMetrics Cloud 的部署、區域、方案、規則檔與存取權杖
- 適用情境
- 適用於使用 VictoriaMetrics 單機或叢集實例的情境:希望助理協助探索指標、偵錯查詢與規則、檢查基數與使用情況,而不必切換到 VMUI。也適合在對話中直接查閱 VictoriaMetrics 文件。
- 執行需求
- 以本機二進位檔、Docker 映像或原始碼方式執行(從原始碼建置需 Go 1.26 以上)。需要可連線的 VictoriaMetrics 實例:VM_INSTANCE_ENTRYPOINT 與 VM_INSTANCE_TYPE(single 或 cluster),或使用 VMC_API_KEY 連接 VictoriaMetrics Cloud;受保護的實例可選填 VM_INSTANCE_BEARER_TOKEN。需要能連線該實例的網路。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Victoriametrics,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[vm-community-icon] 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.
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:
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:
Requirements
- VictoriaMetrics or VictoriaMetrics Cloud instance (single-node or cluster)
- Go 1.26 or higher (if you want to build from source)
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):
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.
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:
-
Build binary from cloned source code:
-
Build image from cloned source code:
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:
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_KEYenvironment 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/sseand/messageendpoints for SSE connections.http- Streamable HTTP. Server will expose the/mcpendpoint for HTTP connections.
More info about traqnsports you can find in MCP docs:
Сonfiguration examples
Endpoints
In SSE and HTTP modes the MCP server provides the following endpoints:
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):
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
See Claude Desktop MCP docs for more info.
Claude Code
Run the command:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
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:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
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:
Or add the following to your Codex ~/.codex/config.toml file:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
See Codex MCP docs for more info.
Visual Studio Code
Add this to your VS Code MCP config file:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
See Visual Studio Code MCP docs for more info.
Zed
Add the following to your Zed config file:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
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:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
Windsurf
Add the following to your Windsurf MCP config file:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
See Windsurf MCP docs for more info.
Gemini CLI
Add the following to your Gemini CLI ~/.gemini/settings.json file:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
See Gemini CLI MCP docs for more info.
OpenCode
Add the following to your OpenCode config file in ~/.config/opencode/opencode.json:
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
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:
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:
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:
Prompts:
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.
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:
This configuration will:
- Look at each metric's name (the
__name__label)- Check if it matches either of the specified metrics
- 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_timestampandkube_pod_init_container_status_last_terminated_reasonmetrics are correctly dropped (resulting labels are empty{}).- The third test case confirms that other metrics like
kube_pod_status_phaseare 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?
🤖 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:
Key points:
- In the VMAgent spec, you use
inlineRelabelConfigfor inline relabeling rules- The field is called
sourceLabels(notsource_labelsas in Prometheus config)- This is a global relabeling that will be applied to all metrics before they're stored
👤 You: I decided not to remove those metrics, but just lower the sample rate for them using Downsampling. What downsampling parameters i have now?
🤖 I can see that you currently have the following downsampling configuration:
This means:
- Data newer than 7 days is kept at its original resolution
- Data between 7-30 days old is downsampled to 1-minute resolution
- Data between 30-180 days old is downsampled to 5-minute resolution
- Data older than 180 days is downsampled to 30-minute resolution
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:
...getting series and using downsampling filter debugger...
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:
This configuration:
- Applies 10-minute resolution downsampling for the rarely-queried metrics after just 1 day
- Maintains your existing downsampling policy for all other metrics
The order of the downsampling rules is important - more specific rules should be listed first.
During this dialog, the assistant was using the following tools:
tenantsto get the list of available tenantsdocumentationto get information about functionality and data formatsmetricsto get the list of available metricsmetric_statisticsto get the information about metrics usageseriesto get the time series for debuggingmetric_relabel_debugto debug relabeling rulesflagsto get the information about instance parametersdownsampling_filters_debugto debug downsampling configuration
But you can use any other tools and combine them in your own way.
Monitoring
In SSE and HTTP modes the MCP Server provides metrics in Prometheus format (see endpoints) and you can find in repo simple grafana dashboard for these metrics.
FAQ
Why is the MCP server using more resources than I would expect from a simple API proxy?
The server contains an embedded vector database with VictoriaMetrics documentation and blog posts for the documentation tool.
It helps to answer complex questions about VictoriaMetrics without providing all data to LLM.
This is the main source of resource usage. To reduce it, add documentation to MCP_DISABLED_TOOLS environment variable to completely disable the vector database loading.
How to use one MCP server instance for several VictoriaMetrics instances?
You can use MCP_PASSTHROUGH_HEADERS parameter in the MCP Server together with Header-based routing in vmauth to route MCP calls between instances based on HTTP header values from your MCP client config.
Roadmap
- Support "Prettify query" tool (done in
v0.0.5) - Support "Explain query" tool (done in
v0.0.6) - Support CI pipeline for building and pushing multiarch docker images (done in
v1.0.0) - Support tool for unit-testing of alerting and recording rules (done in
v0.0.7) - Support optional integration with VictoriaMetrics Cloud (via API keys) (done in
v0.0.9) - Add some extra knowledge to server in addition to current documentation tool:
- VictoriaMetrics blog posts (done in
v1.1.0) - CRD schemas
- VictoriaMetrics blog posts (done in
- Implement multitenant version of MCP (that will support several deployments)
- Add flags/configs validation tool
- Support tools for vmagent API
- Support new vmalert API
- Enabling/disabling tools via configuration (done in
v0.0.8) - Tools for Alertmanager APIs #6
- Support for metrics metadata in case of implementation in VictoriaMetrics
- Support authentication
- Add static index page with description and links to documentation
Mentions
[How to Use an AI Assistant with Your Monitoring System – VictoriaMetrics MCP Server]
[MCP Server Integration & Much More: What's New in VictoriaMetrics Cloud Q2 2025]
Disclaimer
AI services and agents along with MCP servers like this cannot guarantee the accuracy, completeness and reliability of results. You should double check the results obtained with AI.
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.
Contributing
Contributions to the MCP VictoriaMetrics project are welcome!
Please feel free to submit issues, feature requests, or pull requests.
來源:README.md,提交 da6157c
工具
0版本歷史
1- v1.18.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分