VictoriaMetrics MCP Server
Lets your AI agent query VictoriaMetrics: explore metrics, check alerts and rules, and debug your setup.
242 stars on GitHubby VictoriaMetricsLicense Apache-2.0Updated 22 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add victoriametrics -e VM_INSTANCE_ENTRYPOINT="<your value>" -e VM_INSTANCE_TYPE="<your value>" -e VM_INSTANCE_BEARER_TOKEN="<your value>" -- docker run -i --rm -e VM_INSTANCE_ENTRYPOINT -e VM_INSTANCE_TYPE -e VM_INSTANCE_BEARER_TOKEN -e VMC_API_KEY -e MCP_DISABLED_TOOLS -e MCP_DISABLE_RESOURCES -e MCP_PASSTHROUGH_HEADERS ghcr.io/victoriametrics/mcp-victoriametrics:1.120.1
What to fill in
| Name | What it is | Required |
|---|---|---|
VM_INSTANCE_ENTRYPOINT | URL to VictoriaMetrics instance (it should be root URL of vmsingle or vmselect), for example http://localhost:8428 or https://play.victoriametrics.com | Yes |
VM_INSTANCE_TYPE | Type of VictoriaMetrics instance (single / cluster) | Yes |
VM_INSTANCE_BEARER_TOKEN | Authentication token for VictoriaMetrics API | Yes |
VMC_API_KEY | Optional: API key from VictoriaMetrics Cloud Console (if you have deployment in VictoriaMetrics Cloud) | No |
MCP_DISABLED_TOOLS | Comma-separated list of tools to disable | No |
MCP_DISABLE_RESOURCES | Disable all resources (documentation tool will continue to work) | No |
MCP_PASSTHROUGH_HEADERS | HTTP header names to forward from incoming MCP requests to VictoriaMetrics (comma-separated list). Overrides VM_INSTANCE_HEADERS on collision. | No |
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Show the CPU usage for my web servers over the last hour.
Which metrics have the highest cardinality?
What it is
This MCP server gives your AI access to almost all read-only APIs of VictoriaMetrics, the same things you can do in VMUI. It also has the VictoriaMetrics docs built in, so it can search them offline. It works with a single-node or cluster instance and with VictoriaMetrics Cloud.
What it can do
- Query metrics and explore data
- List and export metrics, labels, label values and series
- Analyze and test alerting and recording rules
- Explore cardinality and metrics usage
- Analyze, trace and explain queries
- Debug relabeling, downsampling and retention settings
- Search built-in documentation
When to use
- βΊWhen you want to ask in plain language what a metric shows
- βΊWhen an alert fires and you need help tracing the cause
- βΊWhen you want to check why cardinality is growing
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
cloud-monitoring-promql-queryWrites valid PromQL queries for Cloud Monitoring from a metric's details, including aggregations for any Google Cloud resource.prometheusHelps your agent set up Prometheus monitoring with PromQL queries, alerting rules and Grafana dashboards that stay useful.observability-monitoring-monitor-setupSets up metrics, distributed tracing, log aggregation, and dashboards for application monitoring.Frequently asked questions
Is it free and open source?
Yes, it is open source on GitHub.
Is it read-only?
It uses read-only APIs. Some tools such as export and test_rules are disabled by default.
Can I try it first?
Yes, there is a public playground server at https://play-mcp.victoriametrics.com/mcp for MCP clients.
Which modes are there?
stdio (default), sse and http, set with MCP_SERVER_MODE.
Does it work with VictoriaMetrics Cloud?
Yes, use a VMC_API_KEY.
Can it work offline?
The documentation search is embedded and works without online access.
If it does not work
- βΊCheck VM_INSTANCE_ENTRYPOINT points to the root URL of vmsingle or vmselect.
- βΊSet VM_INSTANCE_TYPE to single or cluster, and add VM_INSTANCE_BEARER_TOKEN if your instance needs one.
- βΊDisabled tools can be changed with MCP_DISABLED_TOOLS.
5 new skills a week. 1 minute to read.