Listed from the MCP registry; nobody on Odel publishes it.
MCP Server for vmanomaly - VictoriaMetrics anomaly detection
Runs on your machine from its package; the steps are below.
At most: creates or changes data: records, files, settings.
Odel charges nothing per call. The publisher may charge for its own service.
Runs locally over stdio
This server isn't hosted — your MCP client launches it from a package registry. Use one of the commands below, or drop the config into your client (e.g. Claude Desktop).
Run
docker run -i --rm ghcr.io/victoriametrics/mcp-vmanomaly:0.7.0
MCP client config
{
"mcpServers": {
"vmanomaly": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/victoriametrics/mcp-vmanomaly:0.7.0"
]
}
}
}The implementation of Model Context Protocol (MCP) server for vmanomaly - VictoriaMetrics Anomaly Detection product.
This provides seamless integration with vmanomaly REST API and documentation for AI-assisted anomaly detection, model management, and observability insights.
This MCP server enables AI assistants like Claude to interact with vmanomaly for:
vmanomaly server health and build informationvmanomaly YAML configurationsvmalert alerting rules based on anomaly score metrics to simplify alerting setupvmanomaly documentation with fuzzy matchingThe MCP server contains embedded up-to-date vmanomaly documentation and is able to search it without online access.
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.
vmanomaly instance with REST API access:
go install github.com/VictoriaMetrics/mcp-vmanomaly/cmd/mcp-vmanomaly@vX.Y.Z
Replace vX.Y.Z with the exact release you have reviewed.
Download the latest release from Releases page and put it to your PATH.
Example for Linux x86_64 (other architectures and platforms are also available). Select an
explicit release rather than a mutable latest URL, verify its checksum, and then verify its
GitHub build-provenance attestation:
version=vX.Y.Z
archive=mcp-vmanomaly_Linux_x86_64.tar.gz
curl -fLO "https://github.com/VictoriaMetrics/mcp-vmanomaly/releases/download/${version}/${archive}"
curl -fLO "https://github.com/VictoriaMetrics/mcp-vmanomaly/releases/download/${version}/checksums.txt"
grep " ${archive}$" checksums.txt | sha256sum --check -
gh attestation verify "${archive}" --repo VictoriaMetrics/mcp-vmanomaly
tar axvf "${archive}"
./mcp-vmanomaly --version
Build-provenance attestations are available for releases produced by the hardened release workflow. Release tags must be annotated, cryptographically signed, and marked as verified by GitHub before that workflow publishes artifacts.
You can run vmanomaly 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-vmanomaly \
--add-host=host.docker.internal:host-gateway \
-e VMANOMALY_ENDPOINT=http://host.docker.internal:8490 \
-e MCP_SERVER_MODE=http \
-e MCP_LISTEN_ADDR=:8080 \
-p 127.0.0.1:8080:8080 \
ghcr.io/victoriametrics/mcp-vmanomaly:vX.Y.Z
Replace vX.Y.Z and the environment variables with your own parameters. When both services
run in Docker, prefer a private Docker network and use the vmanomaly service name as the endpoint.
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.
For building binary from source code you can use the following approach:
Clone repo:
git clone https://github.com/VictoriaMetrics/mcp-vmanomaly.git
cd mcp-vmanomaly
Build binary from cloned source code:
make build
# after that you can find binary mcp-vmanomaly and copy this file to your PATH or run inplace
Build image from cloned source code:
docker build -t mcp-vmanomaly .
# after that you can use docker image mcp-vmanomaly for running or pushing
For local UI/Copilot testing from the vmanomaly repository, build with a local tag:
docker build -t mcp-vmanomaly:local .
Then run the vmanomaly repository helper with:
MCP_VMANOMALY_IMAGE=mcp-vmanomaly:local bin/run-mcp-http.sh
MCP Server for vmanomaly is configured via environment variables:
| Variable | Description | Required | Default | Allowed values |
|---|---|---|---|---|
VMANOMALY_ENDPOINT | vmanomaly server endpoint URL (e.g., http://localhost:8490) | Yes | - | - |
VMANOMALY_BEARER_TOKEN | Bearer token for authenticating with vmanomaly API (mutually exclusive with the token file) | No | - | - |
VMANOMALY_BEARER_TOKEN_FILE | Path to a bearer-token file, suitable for mounted container/orchestrator secrets | No | - | - |
VMANOMALY_HEADERS | Custom HTTP headers for requests (comma-separated key=value pairs, e.g., X-Custom=value1,X-Auth=value2) | No | - | - |
VMANOMALY_REQUEST_TIMEOUT | HTTP timeout for calls from MCP to vmanomaly, e.g. 60s | No | 30s | - |
VMANOMALY_TLS_CA_CERT_FILE | PEM CA bundle added to the system trust store to verify the vmanomaly server certificate. VMANOMALY_TLS_CA_FILE is a deprecated alias | No | - | - |
VMANOMALY_TLS_CA_CERT | Same as VMANOMALY_TLS_CA_CERT_FILE, but the PEM content itself, for runtimes without file mounts; mutually exclusive with VMANOMALY_TLS_CA_CERT_FILE | No | - | - |
VMANOMALY_TLS_CERT_FILE | PEM client certificate for vmanomaly servers that require mutual TLS; set together with the key file | No | - | - |
VMANOMALY_TLS_KEY_FILE | PEM private key for VMANOMALY_TLS_CERT_FILE | No | - | - |
VMANOMALY_TLS_INSECURE_SKIP_VERIFY | Skip server certificate verification. Insecure, for development and testing only | No | false | false, true |
MCP_SERVER_MODE | Server operation mode. See Modes for details. | No | stdio | stdio, http, sse |
MCP_LISTEN_ADDR | Address for HTTP server to listen on | No | localhost:8080 | - |
MCP_ENABLED_TOOLS | Positive comma-separated tool allowlist; empty enables all registered tools | No | - | - |
MCP_DISABLED_TOOLS | Comma-separated tool denylist; takes precedence over the allowlist | No | - | - |
MCP_DISABLE_RESOURCES | Disable all resources (documentation search will continue to work) | No | false | false, true |
MCP_HEARTBEAT_INTERVAL | Heartbeat interval for streamable-http protocol (keeps connection alive through network infrastructure) | No | 30s | - |
MCP_AUTH_TOKEN | Bearer token MCP clients must send as Authorization: Bearer <token>. /health/* and /metrics stay public. An empty value disables authentication; a value of only whitespace fails startup. Only applies in sse/http modes | No | - | - |
MCP_AUTH_TOKEN_FILE | Path to a file with the MCP_AUTH_TOKEN value, for mounted secrets; mutually exclusive with MCP_AUTH_TOKEN; an empty file fails startup | No | - | - |
MCP_PASSTHROUGH_HEADERS | HTTP header names to forward from incoming MCP requests to vmanomaly (comma-separated list). Overrides VMANOMALY_HEADERS on collision; a forwarded Authorization replaces the one built from VMANOMALY_BEARER_TOKEN. Cannot include Authorization when MCP_AUTH_TOKEN is set, nor headers the server sets itself (Content-Type, Host, Content-Length and other hop-by-hop headers). Only applies in sse/http modes | No | - | - |
MCP_STATELESS | Run the Streamable HTTP server in stateless mode: Mcp-Session-Id values are ignored instead of validated. Useful behind a gateway that injects its own session IDs. GET /mcp then answers 405, as no standalone notification stream is offered. Only applies in http mode | No | false | false, true |
MCP_DISABLE_LOCALHOST_PROTECTION | Disable the DNS-rebinding guard that answers 403 to a request arriving over a loopback connection whose Host header is not a localhost value. Needed when a same-host proxy or sidecar forwards over 127.0.0.1 and keeps the original Host. Applies in http and sse modes | No | false | false, true |
MCP_LOG_LEVEL | Minimum log level. debug also logs MCP request and result payloads, raw errors and client names; see Security | No | info | debug, info, warn, error |
MCP_LOG_FORMAT | Log output format; json suits Kubernetes log collectors | No | text | text, json |
MCP_LOG_FILE | Log file path (empty = stderr) | No | stderr | - |
MCP_INSTRUCTIONS_OVERRIDE | Text that fully replaces the default MCP server instructions sent to clients. The defaults target VMUI Copilot and the preset workflow; override them to describe your instance, environment or conventions | No | - | - |
Use an https:// URL in VMANOMALY_ENDPOINT. Server certificates are verified against the system trust store. For a private CA, set VMANOMALY_TLS_CA_CERT_FILE, or VMANOMALY_TLS_CA_CERT with the PEM content when the runtime cannot mount files; the CA is added to the system roots. When vmanomaly requires client certificates (mutual TLS), also set VMANOMALY_TLS_CERT_FILE and VMANOMALY_TLS_KEY_FILE. VMANOMALY_TLS_INSECURE_SKIP_VERIFY=true disables server certificate verification and cannot be combined with a custom CA; use it only for development or testing. VMANOMALY_TLS_CA_CERT_FILE, VMANOMALY_TLS_CERT_FILE and VMANOMALY_TLS_KEY_FILE are re-read at most once per second while requests are made, so certificates rotated in place (for example by cert-manager or a mounted Kubernetes secret) are used without a restart; new connections pick up the new files. If a rotated file is invalid or the certificate and key do not match yet, the previous version stays in use and a warning is logged. An inline VMANOMALY_TLS_CA_CERT is read at startup only.
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.http - Streamable HTTP. Server will expose the /mcp endpoint for HTTP connections.sse - Server-Sent Events. Server will expose the /sse and /message endpoints for SSE connections.Note
The sse transport mode was officially deprecated from MCP
Specification (version 2025-03-26)
and was replaced by Streamable HTTP transport (http mode).
In future releases its support can be deprecated, use Streamable HTTP transport if your client supports it.
Note
Some platforms, such as AWS Bedrock AgentCore Runtime, inject their own Mcp-Session-Id
header and keep the original non-localhost Host header while forwarding over 127.0.0.1.
With default settings the server rejects such session IDs and answers 403 from the DNS-rebinding guard,
so tool discovery fails. Set MCP_STATELESS=true and MCP_DISABLE_LOCALHOST_PROTECTION=true together with
MCP_SERVER_MODE=http for that setup, and keep both disabled for direct or local use.
More info about transports you can find in MCP docs:
# Basic configuration
export VMANOMALY_ENDPOINT="http://localhost:8490"
# With authentication
export VMANOMALY_ENDPOINT="http://localhost:8490"
export VMANOMALY_BEARER_TOKEN="your-token"
# Or load the token from a mounted secret file
export VMANOMALY_BEARER_TOKEN_FILE="/run/secrets/vmanomaly-token"
# With custom headers (e.g., behind a reverse proxy)
export VMANOMALY_HEADERS="X-Custom-Header=value1,X-Another=value2"
# Require a token from MCP clients in http/sse modes
export MCP_AUTH_TOKEN_FILE="/run/secrets/mcp-auth-token"
# Forward per-client headers to vmanomaly, e.g. for vmauth header-based routing
export MCP_PASSTHROUGH_HEADERS="X-Tenant,X-Access-Key"
# Expose only the tools required by this deployment. A denylist can further
# narrow this set and always takes precedence.
export MCP_ENABLED_TOOLS="vmanomaly_health_check,vmanomaly_search_docs"
export MCP_DISABLED_TOOLS="vmanomaly_get_metrics"
# Server mode
export MCP_SERVER_MODE="http"
export MCP_LISTEN_ADDR="0.0.0.0:8080"
# Logging
export MCP_LOG_LEVEL="debug"
export MCP_LOG_FORMAT="json"
export MCP_LOG_FILE="/tmp/mcp-vmanomaly.log"
# Replace the default instructions sent to MCP clients
export MCP_INSTRUCTIONS_OVERRIDE="This server connects to the staging vmanomaly installation of team A."
In HTTP and SSE modes the MCP server provides the following endpoints:
| Endpoint | Description |
|---|---|
/mcp | HTTP endpoint for streaming messages in HTTP mode (for MCP clients that support Streamable HTTP) |
/metrics | Metrics in Prometheus format for monitoring the MCP server |
/health/liveness | Liveness check endpoint to ensure the server is running |
/health/readiness | Readiness check endpoint to ensure the server is ready to accept requests |
/sse + /message | Endpoints for messages in SSE mode (for MCP clients that support SSE) |
Treat an MCP client as an operator of every enabled tool. The server forwards requests to
vmanomaly with the process-wide bearer token and headers configured at startup; it does not add
an independent user identity or authorization boundary.
Use one of these routing models while preserving the invariant that each tool call reaches only the caller's trusted-domain vmanomaly installation:
A local per-user stdio process may use that user's token as its configured upstream token.
A remote MCP instance dedicated to one trusted domain may use a domain-scoped service token.
A shared remote MCP requires per-request forwarding of a verified user token so the gateway can
route each call to the correct trusted domain. List the routing and credential headers in
MCP_PASSTHROUGH_HEADERS and let an authenticating gateway such as vmauth in front of
vmanomaly verify them and pick the installation. Do not place multiple untrusted domains behind
one static VMANOMALY_BEARER_TOKEN.
Prefer stdio for a local, single-user integration. It has no network listener and inherits
access control from the process that launches it.
HTTP and SSE transports accept clients without credentials unless MCP_AUTH_TOKEN (or
MCP_AUTH_TOKEN_FILE) is set. The token is one shared secret compared in constant time; it
does not identify users. Keep the default loopback bind where possible. If remote access is
required, set the token, terminate TLS in a reverse proxy such as vmauth, restrict the network
path, and do not expose /mcp, /sse, or /message directly to an untrusted network.
MCP_PASSTHROUGH_HEADERS forwards client-controlled values to vmanomaly. Only list headers that
the next hop verifies or that select between installations the caller may already reach. When
MCP_AUTH_TOKEN is set, Authorization cannot be forwarded, so the MCP token never reaches
vmanomaly; use a separate header for upstream credentials.
Keep /metrics on an internal monitoring network or protect it at the proxy; health endpoints
can be exposed only as required by the deployment platform.
Give the configured vmanomaly credential the least privilege and trusted-domain scope available.
Prefer VMANOMALY_BEARER_TOKEN_FILE for mounted secrets; never put tokens in command-line
arguments, image layers, or committed client configuration.
Treat VMANOMALY_HEADERS as trusted operator configuration. Tools that set
pass_auth_headers=true can ask vmanomaly to forward authorization to a datasource, so permit
that only for approved datasource origins and enforce an outbound network policy.
Use MCP_ENABLED_TOOLS as a deployment allowlist. Both the allowlist and denylist are enforced
for discovery and direct invocation, so hidden tools cannot be called by name. An empty
allowlist retains backward compatibility by enabling every registered tool.
MCP_DISABLE_RESOURCES=true hides resource discovery and reads. The documentation-search tool
remains independent and can be separately disabled with the tool policy.
At info level and above, the MCP request, tool and access logs and the metrics intentionally
omit tool arguments/results, raw errors, client metadata, and resource URIs; failures are logged
with a bounded error_class, and client-chosen request IDs, session IDs and names are truncated.
MCP_LOG_LEVEL=debug adds request and result payloads, raw errors and client names to the
logs, so enable it only for troubleshooting and treat such logs as secrets. The HTTP access log
records method, path (without query string), status, size, duration, remote address and MCP
session ID. Transport failures that mcp-go reports itself, such as a broken stdio stream or a
recovered panic, are logged at error level with their original message. Treat MCP responses
and downstream vmanomaly logs as sensitive nevertheless.
These controls reduce the MCP server's exposure but do not create tenant isolation. Treat one
logical vmanomaly installation, including its replicas or shards, as one trusted domain. Route
mutually untrusted domains to separate installations through vmauth or another authenticated
gateway. Users inside one trusted domain share its task and resource boundary.
Report suspected vulnerabilities using the private process in SECURITY.md.
Go to: Settings → Cursor Settings → MCP → Add new global MCP server and paste the following configuration into your Cursor ~/.cursor/mcp.json file:
{
"mcpServers": {
"vmanomaly": {
"command": "/path/to/mcp-vmanomaly",
"env": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
}
}
}
See Cursor MCP docs for more info.
Add this to your Claude Desktop claude_desktop_config.json file (you can find it if open Settings → Developer → Edit config):
{
"mcpServers": {
"vmanomaly": {
"command": "/path/to/mcp-vmanomaly",
"env": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
}
}
}
See Claude Desktop MCP docs for more info.
Run the command:
claude mcp add vmanomaly \
-e VMANOMALY_ENDPOINT=http://localhost:8490 \
-e VMANOMALY_BEARER_TOKEN_FILE=/path/to/vmanomaly-token \
-e VMANOMALY_HEADERS="X-Custom=value1,X-Auth=value2" \
-- /path/to/mcp-vmanomaly
To connect to a server running in Streamable HTTP mode, pass the MCP_AUTH_TOKEN and any
headers listed in MCP_PASSTHROUGH_HEADERS. With --scope project the entry goes to .mcp.json, where Claude Code
expands ${VMANOMALY_MCP_TOKEN} from the environment, so the single-quoted token reference is safe to commit:
claude mcp add --scope project --transport http vmanomaly http://localhost:8080/mcp \
--header 'Authorization: Bearer ${VMANOMALY_MCP_TOKEN}' \
--header 'X-Vmanomaly-Instance: team-a'
See Claude Code MCP docs for more info.
Add this to your VS Code MCP config file:
{
"servers": {
"vmanomaly": {
"type": "stdio",
"command": "/path/to/mcp-vmanomaly",
"env": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
}
}
}
See VS Code MCP docs for more info.
Add the following to your Zed config file:
"context_servers": {
"vmanomaly": {
"command": {
"path": "/path/to/mcp-vmanomaly",
"args": [],
"env": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
},
"settings": {}
}
}
See Zed MCP docs for more info.
Settings → Tools → AI Assistant → Model Context Protocol (MCP).Add (+)As JSON{
"mcpServers": {
"vmanomaly": {
"command": "/path/to/mcp-vmanomaly",
"env": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
}
}
}
Add the following to your Windsurf MCP config file:
{
"mcpServers": {
"vmanomaly": {
"command": "/path/to/mcp-vmanomaly",
"env": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
}
}
}
See Windsurf MCP docs for more info.
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 vmanomaly \
--env VMANOMALY_ENDPOINT=http://localhost:8490 \
--env VMANOMALY_BEARER_TOKEN_FILE=/path/to/vmanomaly-token \
--env VMANOMALY_HEADERS="X-Custom=value1,X-Auth=value2" \
-- /path/to/mcp-vmanomaly
The command line takes the path of a token file, not the token itself, so the token stays out of shell history.
Or add the following to your Codex ~/.codex/config.toml file:
[mcp_servers.vmanomaly]
command = "/path/to/mcp-vmanomaly"
[mcp_servers.vmanomaly.env]
VMANOMALY_ENDPOINT = "http://localhost:8490"
VMANOMALY_BEARER_TOKEN = "<YOUR_TOKEN>"
VMANOMALY_HEADERS = "X-Custom=value1,X-Auth=value2"
If you run the server in Streamable HTTP mode, you can register it with:
codex mcp add vmanomaly --url http://localhost:8080/mcp
When the server requires MCP_AUTH_TOKEN or forwards headers listed in MCP_PASSTHROUGH_HEADERS, configure them
in ~/.codex/config.toml. bearer_token_env_var names the environment variable that holds the token:
[mcp_servers.vmanomaly]
url = "http://localhost:8080/mcp"
bearer_token_env_var = "VMANOMALY_MCP_TOKEN"
http_headers = { "X-Vmanomaly-Instance" = "team-a" }
See Codex MCP docs for more info.
Add the following to your Gemini CLI ~/.gemini/settings.json file:
{
"mcpServers": {
"vmanomaly": {
"command": "/path/to/mcp-vmanomaly",
"env": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
}
}
}
To connect to a server running in Streamable HTTP mode at http://localhost:8080:
gemini mcp add --transport http vmanomaly http://localhost:8080/mcp
When the server requires MCP_AUTH_TOKEN or forwards headers listed in MCP_PASSTHROUGH_HEADERS, pass them with
--header in the same command. The single quotes store ${VMANOMALY_MCP_TOKEN} literally, and Gemini CLI expands
it from the environment when it loads the settings, so the token is not saved in a file or in shell history:
gemini mcp add --scope user --transport http \
--header 'Authorization: Bearer ${VMANOMALY_MCP_TOKEN}' \
--header 'X-Vmanomaly-Instance: team-a' \
vmanomaly http://localhost:8080/mcp
gemini mcp add writes to the project's .gemini/settings.json unless --scope user is given, and project
settings override user settings. Keep a single vmanomaly entry, or the one without headers wins and every
call fails with 401.
See Gemini CLI MCP docs for more info.
Add the following to your OpenCode config file in ~/.config/opencode/opencode.json. OpenCode V2 nests servers under
mcp.servers; OpenCode V1 places them directly under mcp:
{
"mcp": {
"servers": {
"vmanomaly": {
"type": "local",
"command": ["/path/to/mcp-vmanomaly"],
"environment": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
}
}
}
}
To connect to a server running in Streamable HTTP mode at http://localhost:8080, pass the
MCP_AUTH_TOKEN and any headers listed in MCP_PASSTHROUGH_HEADERS. OpenCode tries OAuth for remote servers by
default, so set "oauth": false when the server uses a static token:
{
"mcp": {
"servers": {
"vmanomaly": {
"type": "remote",
"url": "http://localhost:8080/mcp",
"oauth": false,
"headers": {
"Authorization": "Bearer {env:VMANOMALY_MCP_TOKEN}",
"X-Vmanomaly-Instance": "team-a"
}
}
}
}
}
See OpenCode MCP docs for more info.
You can run vmanomaly MCP server using Docker instead of local binary.
You should replace run command in configuration examples above in the following way:
{
"mcpServers": {
"vmanomaly": {
"command": "docker",
"args": [
"run",
"-i", "--rm",
"-e", "VMANOMALY_ENDPOINT",
"-e", "VMANOMALY_BEARER_TOKEN",
"-e", "VMANOMALY_HEADERS",
"ghcr.io/victoriametrics/mcp-vmanomaly"
],
"env": {
"VMANOMALY_ENDPOINT": "http://localhost:8490",
"VMANOMALY_BEARER_TOKEN": "<YOUR_TOKEN>",
"VMANOMALY_HEADERS": "X-Custom=value1,X-Auth=value2"
}
}
}
}
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 vmanomaly 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.
MCP vmanomaly provides tools organized into categories:
vmanomaly_discover_metrics calls the additive POST /api/v1/discovery API. Requires vmanomaly 1.32.0+; treat 404 as unsupported. Supply a datasource, optional explicit tenant, selectors and a fixed window. Tenant scope may be numeric (accountID or accountID:projectID) or explicitly multitenant, including a /select/multitenant/prometheus datasource URL; conflicting URL/request tenants are rejected by the discovery API. Multitenant metadata reads require VictoriaMetrics v1.104.0 or newer and a discovery API version that accepts this scope. Preserve vm_account_id/vm_project_id selectors and returned series labels; never automatically broaden a numeric tenant scope. Metric/label inventories across tenants do not establish per-tenant coverage. Each call performs one metadata request; no historical samples, retries or tenant enumeration. Defaults are 100 results and 10 seconds; maxima are 1,000 results, 10 selectors, 31 days and 30 seconds. The MCP client caps response bytes but does not limit concurrent discovery calls; server-side admission limits depend on the deployed backend. These caps do not bound the TSDB index scan. Preserve upstream warnings and completeness; returned counts are neither total cardinality nor exact historical coverage.
vmanomaly_generate_preset_artifacts calls the additive POST /api/v1/preset/artifacts API. Requires vmanomaly 1.32.0+; treat 404 as unsupported. Supply a complete configuration with explicit reader and VictoriaMetrics writer destinations, models and schedulers. Optional alert policy controls threshold, evaluation interval, persistence and the externally reachable incident base URL. entity_labels contains only known source labels; omit it for query-group links. Results retain structured configuration/rules, equivalent YAML, schema version and warnings. The request is limited to 1 MiB and the response to 8 MiB.
With vmanomaly v1.32.0+, optional deployment selects targets (compose, helm, operator), storage (memory or persistent) and an explicit released image tag. Include known choices in the first generation call to receive the complete bundle once. The backend owns validation and rendering; MCP preserves the returned files, per-file requirements and warnings without rewriting them. Helm uses pinned chart 1.12.19; Operator uses v0.75.2 and supports persistent storage only. Missing license or volume details use backend-generated draft requirements; request-level required_inputs remains restricted to the two writer fields. Generation does not install anything or verify a live deployment.
Generation is read-only. schema-valid does not establish data coverage, sizing, connectivity, alert delivery or deployment readiness. The existing configuration and example-rule tools remain available; a successful validation response describes schema validation only. Use separate rendering and live checks before deployment.
| Tool | Description |
|---|---|
vmanomaly_health_check | Check vmanomaly server health status |
vmanomaly_get_buildinfo | Get build information (version, build time, Go version) |
vmanomaly_get_server_queries | Get configured server query aliases and expressions |
vmanomaly_get_metrics | Get vmanomaly server metrics in Prometheus format |
Peer-pool sizing is experimental and requires backend support: use model_class: peer_outlier, options.topology: wide and options.channels_per_entity for peers per pool. Forward entity_count counts pools; reverse capacity counts pool-models, with peer-series count returned separately. For example, two five-peer pools are two entities and ten input series. Initial support is limited to equal-size fixed pools (3–10,000 peers, meeting min_peer_count, default 5), complete observations, one query per workload and no churn retention. Omit model_params.groupby; declare separate forward workloads for distinct queries or pool sizes. Do not average unequal pools or replace an unsupported peer estimate with univariate sizing. No peer profile is initially shipped; bounded live calibration requires the installed backend version. Pool widths above 64 use bounded-sample n log(n) CPU and linear memory/output approximations. Shared fallback worker coefficients are not peer-specific measurements. Keep the user's requested pool width; never substitute a smaller pool. Estimates need representative validation.
Currently experimental as of vmanomaly v1.31.0; requires a server exposing the deployment-sizing API. Earlier targets are unsupported; an omitted target uses the installed server version. Report any version fallback returned by the server without claiming validation on the requested release. Deployment sizing estimates resources for vmanomaly itself, rather than forecasting a monitored metric with forecast_at.
| Tool | Purpose |
|---|---|
vmanomaly_estimate_deployment_resources | Deployment CPU/RAM/disk and composable stage estimates |
vmanomaly_estimate_inference_capacity | Approximate active models per inference interval at fixed CPUs, optionally RAM constrained |
vmanomaly_get_deployment_sizing_profiles | Discover supported sizing profiles and their model parameters |
Forward sizing accepts workloads, each with model_class, entity_count and infer_every_seconds. Reverse sizing needs model_class, cpus and infer_every_seconds; ram_limit_bytes is optional. Each accepts an options object for the corresponding backend fields, with workload-specific options nested in each workload. For example:
{"model_class":"mad_online","cpus":2,"infer_every_seconds":300,"ram_limit_bytes":2147483648,"options":{"vmanomaly_version":"v1.31.0","infer_points_per_cycle":2}}
Choose the flow by the unknown: a known series count needs forward sizing; fixed CPU/RAM and cadence with no count needs reverse sizing, even if the user simply asks for "capacity". Do not request cardinality for reverse sizing. The output is active model/entity count: univariate entities are series, multivariate entities are groups. Supply topology and channels_per_entity for multivariate requests and report input_series separately. Missing history can be clarified or explicitly defaulted. Compare memory and disk with otherwise identical inputs. In reverse sizing, an explicit numeric history.step_seconds defaults the scored batch to ceil(infer_every_seconds / step_seconds) unless infer_points_per_cycle is supplied. MCP reports this non-overlapping-cycle assumption alongside successful and failed sizing results.
For online models, forward sizing automatically treats fit duration as advisory against inference cadence; fit peak RAM/disk still count. Provide history window/step and omit fit_every_seconds unless the user requests periodic refits. Never infer refit cadence from fit_window. mad/mad_online and zscore/zscore_online resolve to the same online classes. An explicit finite interval includes recurring compute. Batch models keep hard fit deadlines and default to daily fitting. Use explicit options.deployment.members_count and split_by=queries for a fixed query-shard layout.
Results preserve resolved inputs, stage costs, resource constraints and operational warnings, with a single experimental-estimate notice. Internal calibration diagnostics are omitted from forward/reverse tool results; profile discovery is returned unchanged. Reverse sizing covers inference only, excluding bootstrap/refits/churn. Check the model schema or profile before supplying required parameters; do not invent them. Unsupported seasonal configurations require a matching profile or offline calibration, rather than fewer series or a different cadence.
Requests use the existing authenticated backend client, fixed routes, bounded request bodies and a bounded cancelable queue. The request timeout includes waiting, and profile discovery remains independent. Backend validation and overload errors are returned as tool errors without automatic retries; the session can accept a corrected follow-up. Older servers may not expose these routes. These tools do not change a running deployment.
Forward sizing resolves omitted scored points from explicit sampling and cadence, and defaults the inference deadline to the shortest workload cadence. Explicit overrides are preserved. An infeasible explicit deployment returns binding constraints; the adapter does not retry or substitute a balanced repartition. Compare CPU candidates in one call, and keep nominal versus margin-adjusted times distinct.
| Tool | Description |
|---|---|
vmanomaly_list_models | List models exposed to VMUI and other UI-oriented flows |
vmanomaly_get_server_models | Get configured server models and their query attachments |
vmanomaly_get_model_schema | Get JSON schema for a specific model type |
vmanomaly_validate_model_config | Validate model configuration before using it |
| Tool | Description |
|---|---|
vmanomaly_validate_config | Validate complete vmanomaly YAML configuration |
| Tool | Description |
|---|---|
vmanomaly_search_docs | Full-text search across vmanomaly documentation with fuzzy matching |
| Tool | Description |
|---|---|
vmanomaly_check_compatibility | Check if persisted state is compatible with runtime version |
| Tool | Description |
|---|---|
vmanomaly_generate_alert_rule | Generate VMAlert rule YAML for anomaly score alerting |
| Tool | Description |
|---|---|
vmanomaly_timeseries_characteristics | Profile sampled query results for trends, seasonalities, spikiness, and gaps |
vmanomaly_create_autotune_task | Start tuning one requested model class on sampled series |
vmanomaly_get_autotune_task | Poll autotune progress and retrieve a completed recommendation |
vmanomaly_cancel_autotune_task | Request cooperative cancellation of an autotune task |
For schedule-aware tuning, optionally pass replay: {"fit_window":"3d", "fit_every":"1000w", "infer_every":"5m"} together with fixed start/end Unix timestamps and the production sampling step. The backend fetches preceding training history and evaluates that inference range with the requested schedule. For causal online updates, also set optimization_params.exact: true. Omitting replay preserves fold-based tuning. The backend owns duration parsing and schedule validation.
Replay requires vmanomaly 1.31.0+. Check that the completed result_data.data.optimization.replay matches the requested schedule; older backends may ignore unknown fields. Missing/mismatched replay metadata is not schedule validation. Preserve errors rather than retrying without replay. This evaluated range was used for tuning: validate the selected configuration on a separate later holdout before claiming generalization or reduced false positives.
vmanomaly_create_autotune_task accepts optimization_n_trials, optimization_timeout, and advanced
optimization_params to bound Optuna work. The MCP tool uses interactive defaults of 32 trials and
8 seconds when no optimization budget is provided, and a conservative anomaly fraction of 0.02 when
anomaly_percentage is omitted; the vmanomaly API defaults are larger. Poll
vmanomaly_get_autotune_task until status is done, then use the recommendation under
result_data. Treat error and canceled as terminal statuses.
The running server's list/schema endpoints expose UI-compatible models, not an exhaustive catalog of every deployable model. Their contents depend on the server version; servers supporting the corresponding investigation views can include multivariate and peer-group models. Check the returned list and schema rather than assuming those models are always present or always excluded.
For multivariate detection, tune the multivariate class directly with aligned named queries and any frozen_params.groupby labels; the result uses a joint anomaly score. Documented models not exposed by an older server's UI endpoints may still support server-side tuning and complete configuration validation; verify that server's capabilities before using them or suggesting them in VMUI.
With vmanomaly 1.31.0+, shared tuning accepts peer_outlier. Keep entity labels in query results and supply population grouping in frozen_params.groupby; queries remain separate populations. Stable query policies remain authoritative. The tuning result is a concrete model configuration: deployment sizing can estimate that model's fit/inference resources, not the auto wrapper's search cost. Supervised marking is available in VMUI; the current MCP tuning tool exposes the unsupervised objective, not label submission.
On servers exposing the corresponding model schema, service configurations can request is_holiday for Prophet and Temporal Envelope v1/v2. Existing configuration maps preserve holidays and provide_series; check the connected schema before adding them. Deployment-sizing options also pass through unchanged: accepted options.reader.fit_response_format values are defined by the connected backend's sizing schema. This is an estimation assumption, not a runtime reader setting.
For new configurations, prefer online models. vmanomaly 1.33 deprecates Holt-Winters and Isolation Forest, with removal scheduled for 1.34. Prophet remains supported for existing deployments. For Holt-Winters and Isolation Forest, use Temporal Envelope as the corresponding univariate or multivariate migration target.
This example shows data-driven model selection rather than choosing a model from the metric name. The YAML is a complete deployment-config excerpt: VMUI suggestion cards continue to carry business-policy fields in the model configuration because the UI query editor currently exposes only the query expression and language.
You: Detect sustained CPU spikes for
avg by (instance) (1 - rate(node_cpu_seconds_total{mode="idle"}[5m]))at a5mstep.
Assistant: I profiled the exact query first. The sampled series contain a trend and recurring hour-of-day/day-of-week structure, so
temporal_envelopeis the best online starting point. If the profile had no meaningful trend or seasonality, I would prefermad_onlinefor robust data, orzscore_onlineonly for a stable light-tailed distribution.
Assistant: I verified the model and schema, then started shared autotune with the same
5mstep,anomaly_percentage=0.02, and causalexact=truevalidation. After sequentially polling the task to completion, I validated the returned model configuration before presenting it.yamlreader: workers: 0 queries: cpu_non_idle: expr: avg by (instance) (1 - rate(node_cpu_seconds_total{mode="idle"}[5m])) detection_direction: above_expected min_rel_dev_from_expected: [0, 15] models: cpu_envelope: class: temporal_envelope queries: [cpu_non_idle] schedulers: [cpu_5m] seasonalities: [hod_smooth, dow_smooth]The exact tuned parameters depend on the sampled data; the final model spec is always validated against the running vmanomaly instance.
During this dialog, the assistant used the following tools:
vmanomaly_timeseries_characteristics to measure the sampled data profilevmanomaly_list_models and vmanomaly_get_model_schema to verify the UI-compatible modelvmanomaly_create_autotune_task and vmanomaly_get_autotune_task to tune shared parametersvmanomaly_validate_model_config to validate the tuned modelvmanomaly_validate_config to validate the configurationIn HTTP and SSE modes the MCP Server provides metrics in Prometheus format at the /metrics endpoint.
Tracked operations:
mcp_vmanomaly_initialize_total - Client connectionsmcp_vmanomaly_call_tool_total{name,is_error} - Tool calls with success/error trackingmcp_vmanomaly_read_resource_total - Documentation resource readsmcp_vmanomaly_list_*_total - List operations (tools, resources, prompts)mcp_vmanomaly_error_total{method,error_class} - Errors by bounded, non-sensitive classExample:
# Start in HTTP mode
VMANOMALY_ENDPOINT="http://localhost:8490" MCP_SERVER_MODE=http ./bin/mcp-vmanomaly
# Query metrics
curl http://localhost:8080/metrics
Set MCP_PASSTHROUGH_HEADERS and point VMANOMALY_ENDPOINT at
vmauth with
header-based routing, so each MCP
client selects its installation with a header value from its own config. This is routing, not isolation: a
client can send any value, see Security.
Headers listed in MCP_PASSTHROUGH_HEADERS override the same headers from VMANOMALY_HEADERS.
A forwarded Authorization header also replaces the one built from VMANOMALY_BEARER_TOKEN.
Headers the server sets itself, such as Content-Type, Host and Content-Length, cannot be listed.
Authorization cannot be forwarded when MCP_AUTH_TOKEN is set, because the incoming Authorization
header then carries the MCP server's own token. Forward upstream credentials in a different header and let
vmauth or another gateway translate it.
The vmanomaly documentation is embedded in the binary. The first vmanomaly_search_docs call builds an
in-memory full-text index over it, which stays for the lifetime of the process. If documentation search is not
needed, add vmanomaly_search_docs to MCP_DISABLED_TOOLS so the index is never built.
MCP_DISABLE_RESOURCES=true additionally stops registering every documentation section as an MCP resource.
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.
For preset requests, retrieve vmanomaly_get_preset_guide before choosing tools. MCP initialization advertises this routing instruction. The read-only, no-argument tool returns the complete guide and version/source/SHA-256 metadata without network or backend access. Clients with resource support can read vmanomaly://guides/preset/v1; resources do not execute automatically.
The canonical source is plugins/vmanomaly/skills/vmanomaly-preset/references/copilot-preset-guide-v1.md in VictoriaMetrics/skills. Do not edit the embedded copy. Run python3 scripts/sync-preset-guide.py /path/to/skills from a fetched canonical checkout after the skills changes merge into origin/main; --check verifies the committed snapshot and provenance. For a dependent PR only, --allow-unmerged explicitly marks review provenance; rerun without that flag from the merged skills revision before merging the MCP follow-up. The origin URL check prevents accidental misattribution, not malicious local Git metadata.
The guide lives in internal/resources/guides/, separately from release documentation search. Its tool remains available when documentation resources are disabled. It requires the discovery/artifact capabilities for that workflow, but retrieving it works offline. Instructions establish workflow budgets, not runtime enforcement. Successful artifact results become download cards only in clients implementing that renderer. Unknown writer settings default to draft generation using a .invalid URL and required_inputs (writer URL and/or tenant). Never probe placeholders. Deployment-ready requests require resolving those inputs first. Responses retain the checklist and deployment_ready: false; schema validation alone never proves readiness. No deployment is performed.
The model-selection guide is an external reference, not bundled content. Search installed documentation for related model details; do not assume this page is available offline. Live schemas take precedence over static guidance.
Run make update-docs for selected manuals, or bash scripts/update-docs.sh --revision <tag> for a source release tag. The resolved source commit is recorded in internal/resources/docs/snapshot.json. Refresh the preset guide separately with python3 scripts/sync-preset-guide.py /path/to/skills; its committed source revision and content hash are recorded alongside it. The model-selection page remains link-only during refreshes.
Both refreshes stage complete snapshots in repository-local tmp/resource-sync, serialize writers with a nonblocking lock, and restore the previous snapshot if publication fails. Run them before builds: directory replacement has a short absence window, and this is not a crash-atomic transaction. A failed rollback preserves the previous snapshot under that scratch directory for recovery. These maintainer scripts require Python 3.10+ on Linux/macOS; their offline regression tests run with python3 -m unittest discover -s scripts/tests -v.
The guide links to the Helm chart and VM Operator documentation. A chart's Chart.yaml identifies a version but cannot define values or render manifests by itself. Use matching release values/templates/schema or Operator CRDs when preparing those deployment formats; these links are not bundled deployment generators.
Contributions to the MCP vmanomaly project are welcome!
Please feel free to submit issues, feature requests, or pull requests.
For vmanomaly-specific questions, see the vmanomaly documentation.
For MCP server issues, please open an issue in this repository.