VictoriaMetrics MCP Server APIs, Monitoring, Documentation
Monitor and debug VictoriaMetrics instances with MCP server APIs, documentation and observability tools for seamless integration and troubleshooting.
npx -y @VictoriaMetrics-Community/mcp-victoriametricsOverview
The VictoriaMetrics MCP Server provides a lightweight HTTP API and observability layer that helps you monitor, inspect, and debug VictoriaMetrics instances. It acts as a diagnostics and control plane for VictoriaMetrics deployments, exposing health, metadata, metrics, and debugging endpoints that can be integrated with Prometheus, Grafana, CI/CD and automation tooling.
This server is useful when you need a standardized, machine-readable way to introspect VictoriaMetrics clusters, troubleshoot ingestion or query issues, and collect runtime telemetry (metrics, logs, profiling). It simplifies common operational tasks—like checking instance health, listing connected targets, or gathering pprof traces—without having to run ad-hoc scripts against each VM node.
Features
- HTTP REST APIs to query instance status, configuration and topology
- Prometheus metrics endpoint suitable for scraping
- Health and readiness probes for orchestration systems (Kubernetes)
- Basic debug endpoints (e.g., logs, runtime profiling) for root-cause analysis
- Configuration via file and CLI flags for easy automation
- Lightweight: intended to be run alongside VictoriaMetrics or as a centralized gatekeeper
- GitHub repository with source code for customization and contribution
Installation / Configuration
Prerequisites: Go 1.18+ (for building from source) or Docker.
Clone repository:
Build from source:
# build the server (example Go build invocation)
# run with defaults
Run with Docker:
Example CLI flags / environment variables (typical):
- –listen-address=:8080 # HTTP listen address
- –metrics-endpoint=/metrics # Prometheus metrics path
- –target-vm=http://vm-host:8428 # Target VictoriaMetrics instance to monitor
- –config-file=/etc/mcp/config.yaml
Example config file (YAML):
listenAddress: ":8080"
metricsPath: "/metrics"
targets:
- name: "vm-primary"
url: "http://vm-primary:8428"
- name: "vm-replica"
url: "http://vm-replica:8428"
tls:
enabled: false
certFile: "/etc/mcp/tls.crt"
keyFile: "/etc/mcp/tls.key"
basicAuth:
username: "mcp"
password: "changeme"
Start server with config file:
Available Resources
- Source code and issues: https://github.com/VictoriaMetrics-Community/mcp-victoriametrics
- Prometheus scrape target: /metrics (exposes instrumented metrics from the MCP server)
- Health endpoints: /health, /ready (for Kubernetes liveness/readiness probes)
- Diagnostics (examples): /api/instances, /api/instances/{id}/status, /api/instances/{id}/pprof
- Documentation and contribution guidelines: check the GitHub repository README and docs directory
Note: Exact endpoint paths may vary by release — check the built-in –help or the repository docs for the deployed version.
Use Cases
Quick health checks (Kubernetes probes)
- Configure liveness and readiness probes to call the MCP server:
readinessProbe: httpGet: path: /ready port: 8080 initialDelaySeconds: 5 periodSeconds: 10Scrape MCP metrics with Prometheus
- Add MCP server to Prometheus scrape targets:
scrape_configs: - job_name: 'mcp-victoriametrics' static_configs: - targets: metrics_path: /metricsList and inspect instances
- Retrieve registered VictoriaMetrics instances:
|- Get status for a specific instance:
|Collect a CPU profile for troubleshooting long queries
# Analyze with go tool pprofDebug remote_write / ingestion spikes
- Use instance status and ingestion-related metrics exposed by MCP to correlate spikes in write latency with network or disk metrics, then export targeted traces or logs.
Monitoring & Troubleshooting Tips
- Always scrape /metrics from the MCP server itself; it provides telemetry about connectivity to VictoriaMetrics targets and internal error rates.
- Tie MCP metrics to Grafana dashboards to visualize historical trends (ingestion latency, connection errors, scrape durations).
- When collecting pprof or logs, prefer short durations (10–60s) to limit