{
  "markdown": "# MCP Server for vmanomaly\n\n[![Latest Release](https://img.shields.io/github/v/release/VictoriaMetrics/mcp-vmanomaly?sort=semver&label=&logo=github&labelColor=gray&color=gray)](https://github.com/VictoriaMetrics/mcp-vmanomaly/releases)\n![License](https://img.shields.io/github/license/VictoriaMetrics/mcp-vmanomaly?labelColor=green&label=&link=https%3A%2F%2Fgithub.com%2FVictoriaMetrics%2Fmcp-vmanomaly%2Fblob%2Fmain%2FLICENSE)\n![Slack](https://img.shields.io/badge/Join-4A154B?logo=slack&link=https%3A%2F%2Fslack.victoriametrics.com)\n![X](https://img.shields.io/twitter/follow/VictoriaMetrics?style=flat&label=Follow&color=black&logo=x&labelColor=black&link=https%3A%2F%2Fx.com%2FVictoriaMetrics)\n\nThe implementation of [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for [`vmanomaly`](https://docs.victoriametrics.com/anomaly-detection/) - VictoriaMetrics Anomaly Detection product.\n\nThis provides seamless integration with `vmanomaly` REST API and [documentation](https://docs.victoriametrics.com/anomaly-detection/) for AI-assisted anomaly detection, model management, and observability insights.\n\n## Features\n\nThis MCP server enables AI assistants like Claude to interact with `vmanomaly` for:\n\n- **Health Monitoring**: Check `vmanomaly` server health and build information\n- **Model Management**: Discover UI-compatible models and validate univariate or multivariate configurations\n- **Data-Driven Recommendations**: Profile sampled time series and run shared autotune suggestions for one production-ready model config across many returned series\n- **Configuration Generation**: Generate complete `vmanomaly` YAML configurations\n- **Alert Rule Generation**: Generate [`vmalert`](https://docs.victoriametrics.com/victoriametrics/vmalert/) [alerting rules](https://docs.victoriametrics.com/victoriametrics/vmalert/#alerting-rules) based on [anomaly score metrics](https://docs.victoriametrics.com/anomaly-detection/faq/#what-is-anomaly-score) to simplify alerting setup\n- **Documentation Search**: Full-text search across embedded `vmanomaly` documentation with fuzzy matching\n\nThe MCP server contains embedded up-to-date `vmanomaly` documentation and is able to search it without online access.\n\n> 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.\n\n## Requirements\n\n- [`vmanomaly`](https://docs.victoriametrics.com/anomaly-detection/) instance with REST API access:\n  - version [1.28.3](https://docs.victoriametrics.com/anomaly-detection/changelog/#v1283)+ for the core MCP toolset\n  - version [1.30.0](https://docs.victoriametrics.com/anomaly-detection/changelog/#v1300)+ for time-series characteristics and task-based shared autotune\n- Go 1.24 or higher (if building from source)\n\n## Installation\n\n### Go\n\n```bash\ngo install github.com/VictoriaMetrics/mcp-vmanomaly/cmd/mcp-vmanomaly@vX.Y.Z\n```\n\nReplace `vX.Y.Z` with the exact release you have reviewed.\n\n### Binaries\n\nDownload the latest release from [Releases](https://github.com/VictoriaMetrics/mcp-vmanomaly/releases) page and put it to your PATH.\n\nExample for Linux x86_64 (other architectures and platforms are also available). Select an\nexplicit release rather than a mutable `latest` URL, verify its checksum, and then verify its\nGitHub build-provenance attestation:\n\n```bash\nversion=vX.Y.Z\narchive=mcp-vmanomaly_Linux_x86_64.tar.gz\ncurl -fLO \"https://github.com/VictoriaMetrics/mcp-vmanomaly/releases/download/${version}/${archive}\"\ncurl -fLO \"https://github.com/VictoriaMetrics/mcp-vmanomaly/releases/download/${version}/checksums.txt\"\ngrep \"  ${archive}$\" checksums.txt | sha256sum --check -\ngh attestation verify \"${archive}\" --repo VictoriaMetrics/mcp-vmanomaly\ntar axvf \"${archive}\"\n./mcp-vmanomaly --version\n```\n\nBuild-provenance attestations are available for releases produced by the hardened release\nworkflow. Release tags must be annotated, cryptographically signed, and marked as verified by\nGitHub before that workflow publishes artifacts.\n\n### Docker\n\nYou can run `vmanomaly` MCP Server using Docker.\n\nThis is the easiest way to get started without needing to install Go or build from source.\n\n```bash\ndocker run -d --name mcp-vmanomaly \\\n  --add-host=host.docker.internal:host-gateway \\\n  -e VMANOMALY_ENDPOINT=http://host.docker.internal:8490 \\\n  -e MCP_SERVER_MODE=http \\\n  -e MCP_LISTEN_ADDR=:8080 \\\n  -p 127.0.0.1:8080:8080 \\\n  ghcr.io/victoriametrics/mcp-vmanomaly:vX.Y.Z\n```\n\nReplace `vX.Y.Z` and the environment variables with your own parameters. When both services\nrun in Docker, prefer a private Docker network and use the vmanomaly service name as the endpoint.\n\nNote that the `MCP_SERVER_MODE=http` flag is used to enable Streamable HTTP mode.\nMore details about server modes can be found in the [Configuration](#configuration) section.\n\nSee available docker images in [github registry](https://github.com/VictoriaMetrics/mcp-vmanomaly/pkgs/container/mcp-vmanomaly).\n\nAlso 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.\n\n### Source Code\n\nFor building binary from source code you can use the following approach:\n\n- Clone repo:\n\n  ```bash\n  git clone https://github.com/VictoriaMetrics/mcp-vmanomaly.git\n  cd mcp-vmanomaly\n  ```\n\n- Build binary from cloned source code:\n\n  ```bash\n  make build\n  # after that you can find binary mcp-vmanomaly and copy this file to your PATH or run inplace\n  ```\n\n- Build image from cloned source code:\n\n  ```bash\n  docker build -t mcp-vmanomaly .\n  # after that you can use docker image mcp-vmanomaly for running or pushing\n  ```\n\n  For local UI/Copilot testing from the vmanomaly repository, build with a local tag:\n\n  ```bash\n  docker build -t mcp-vmanomaly:local .\n  ```\n\n  Then run the vmanomaly repository helper with:\n\n  ```bash\n  MCP_VMANOMALY_IMAGE=mcp-vmanomaly:local bin/run-mcp-http.sh\n  ```\n\n## Configuration\n\nMCP Server for vmanomaly is configured via environment variables:\n\n| Variable                 | Description                                                                                             | Required | Default          | Allowed values         |\n|--------------------------|---------------------------------------------------------------------------------------------------------|----------|------------------|------------------------|\n| `VMANOMALY_ENDPOINT`     | vmanomaly server endpoint URL (e.g., http://localhost:8490)                                             | Yes      | -                | -                      |\n| `VMANOMALY_BEARER_TOKEN` | Bearer token for authenticating with vmanomaly API (mutually exclusive with the token file)           | No       | -                | -                      |\n| `VMANOMALY_BEARER_TOKEN_FILE` | Path to a bearer-token file, suitable for mounted container/orchestrator secrets                  | No       | -                | -                      |\n| `VMANOMALY_HEADERS`      | Custom HTTP headers for requests (comma-separated key=value pairs, e.g., X-Custom=value1,X-Auth=value2) | No       | -                | -                      |\n| `VMANOMALY_REQUEST_TIMEOUT` | HTTP timeout for calls from MCP to vmanomaly, e.g. `60s`                                             | No       | `30s`            | -                      |\n| `MCP_SERVER_MODE`        | Server operation mode. See [Modes](#modes) for details.                                                 | No       | `stdio`          | `stdio`, `http`, `sse` |\n| `MCP_LISTEN_ADDR`        | Address for HTTP server to listen on                                                                    | No       | `localhost:8080` | -                      |\n| `MCP_ENABLED_TOOLS`      | Positive comma-separated tool allowlist; empty enables all registered tools                            | No       | -                | -                      |\n| `MCP_DISABLED_TOOLS`     | Comma-separated tool denylist; takes precedence over the allowlist                                     | No       | -                | -                      |\n| `MCP_DISABLE_RESOURCES`  | Disable all resources (documentation search will continue to work)                                      | No       | `false`          | `false`, `true`        |\n| `MCP_HEARTBEAT_INTERVAL` | Heartbeat interval for streamable-http protocol (keeps connection alive through network infrastructure) | No       | `30s`            | -                      |\n| `MCP_LOG_LEVEL`          | Log level: `debug` (verbose), `info` (default), `warn`, or `error`                                      | No       | `info`           | -                      |\n| `MCP_LOG_FILE`           | Log file path (empty = stderr)                                                                          | No       | `stderr`         | -                      |\n\n### Modes\n\nMCP Server supports the following modes of operation (transports):\n\n- `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.\n- `http` - Streamable HTTP. Server will expose the `/mcp` endpoint for HTTP connections.\n- `sse` - Server-Sent Events. Server will expose the `/sse` and `/message` endpoints for SSE connections.\n\n> [!NOTE]\n> The `sse` transport mode was officially deprecated from MCP\n> Specification [(version 2025-03-26)](https://modelcontextprotocol.io/specification/2025-03-26/changelog#major-changes)\n> and was replaced by Streamable HTTP transport (`http` mode).\n> In future releases its support can be deprecated, use Streamable HTTP transport if your client supports it.\n\nMore info about transports you can find in MCP docs:\n\n- [Core concepts → Transports](https://modelcontextprotocol.io/docs/concepts/transports)\n- [Specifications → Transports](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports)\n\n### Configuration examples\n\n```bash\n# Basic configuration\nexport VMANOMALY_ENDPOINT=\"http://localhost:8490\"\n\n# With authentication\nexport VMANOMALY_ENDPOINT=\"http://localhost:8490\"\nexport VMANOMALY_BEARER_TOKEN=\"your-token\"\n\n# Or load the token from a mounted secret file\nexport VMANOMALY_BEARER_TOKEN_FILE=\"/run/secrets/vmanomaly-token\"\n\n# With custom headers (e.g., behind a reverse proxy)\nexport VMANOMALY_HEADERS=\"X-Custom-Header=value1,X-Another=value2\"\n\n# Expose only the tools required by this deployment. A denylist can further\n# narrow this set and always takes precedence.\nexport MCP_ENABLED_TOOLS=\"vmanomaly_health_check,vmanomaly_search_docs\"\nexport MCP_DISABLED_TOOLS=\"vmanomaly_get_metrics\"\n\n# Server mode\nexport MCP_SERVER_MODE=\"http\"\nexport MCP_LISTEN_ADDR=\"0.0.0.0:8080\"\n\n# Logging\nexport MCP_LOG_LEVEL=\"debug\"\nexport MCP_LOG_FILE=\"/tmp/mcp-vmanomaly.log\"\n```\n\n## Endpoints\n\nIn HTTP and SSE modes the MCP server provides the following endpoints:\n\n| Endpoint             | Description                                                                                      |\n|----------------------|--------------------------------------------------------------------------------------------------|\n| `/mcp`               | HTTP endpoint for streaming messages in HTTP mode (for MCP clients that support Streamable HTTP) |\n| `/metrics`           | Metrics in Prometheus format for monitoring the MCP server                                       |\n| `/health/liveness`   | Liveness check endpoint to ensure the server is running                                          |\n| `/health/readiness`  | Readiness check endpoint to ensure the server is ready to accept requests                        |\n| `/sse` + `/message`  | Endpoints for messages in SSE mode (for MCP clients that support SSE)                            |\n\n## Security\n\nTreat an MCP client as an operator of every enabled tool. The server forwards requests to\n`vmanomaly` with the process-wide bearer token and headers configured at startup; it does not add\nan independent user identity or authorization boundary.\n\nUse one of these routing models while preserving the invariant that each tool call reaches only\nthe caller's trusted-domain vmanomaly installation:\n\n- A local per-user `stdio` process may use that user's token as its configured upstream token.\n- A remote MCP instance dedicated to one trusted domain may use a domain-scoped service token.\n- A shared remote MCP requires per-request forwarding of a verified user token so the gateway can\n  route each call to the correct trusted domain. The current process-wide token configuration does\n  not implement this pass-through mode; do not place multiple untrusted domains behind one static\n  MCP credential.\n\n- Prefer `stdio` for a local, single-user integration. It has no network listener and inherits\n  access control from the process that launches it.\n- HTTP and SSE transports do not provide built-in client authentication. Keep the default\n  loopback bind where possible. If remote access is required, place the server behind an\n  authenticated TLS reverse proxy such as `vmauth`, restrict the network path, and do not expose\n  `/mcp`, `/sse`, or `/message` directly to an untrusted network.\n- Keep `/metrics` on an internal monitoring network or protect it at the proxy; health endpoints\n  can be exposed only as required by the deployment platform.\n- Give the configured vmanomaly credential the least privilege and trusted-domain scope available.\n  Prefer `VMANOMALY_BEARER_TOKEN_FILE` for mounted secrets; never put tokens in command-line\n  arguments, image layers, or committed client configuration.\n- Treat `VMANOMALY_HEADERS` as trusted operator configuration. Tools that set\n  `pass_auth_headers=true` can ask vmanomaly to forward authorization to a datasource, so permit\n  that only for approved datasource origins and enforce an outbound network policy.\n- Use `MCP_ENABLED_TOOLS` as a deployment allowlist. Both the allowlist and denylist are enforced\n  for discovery and direct invocation, so hidden tools cannot be called by name. An empty\n  allowlist retains backward compatibility by enabling every registered tool.\n- `MCP_DISABLE_RESOURCES=true` hides resource discovery and reads. The documentation-search tool\n  remains independent and can be separately disabled with the tool policy.\n- Logs and metrics intentionally omit tool arguments/results, raw errors, client metadata, and\n  resource URIs. Treat MCP responses and downstream vmanomaly logs as sensitive nevertheless.\n\nThese controls reduce the MCP server's exposure but do not create tenant isolation. Treat one\nlogical vmanomaly installation, including its replicas or shards, as one trusted domain. Route\nmutually untrusted domains to separate installations through `vmauth` or another authenticated\ngateway. Users inside one trusted domain share its task and resource boundary.\n\nReport suspected vulnerabilities using the private process in [SECURITY.md](SECURITY.md).\n\n## Setup in clients\n\n### Cursor\n\nGo to: `Settings` → `Cursor Settings` → `MCP` → `Add new global MCP server` and paste the following configuration into your Cursor `~/.cursor/mcp.json` file:\n\n```json\n{\n  \"mcpServers\": {\n    \"vmanomaly\": {\n      \"command\": \"/path/to/mcp-vmanomaly\",\n      \"env\": {\n        \"VMANOMALY_ENDPOINT\": \"http://localhost:8490\",\n        \"VMANOMALY_BEARER_TOKEN\": \"<YOUR_TOKEN>\",\n        \"VMANOMALY_HEADERS\": \"X-Custom=value1,X-Auth=value2\"\n      }\n    }\n  }\n}\n```\n\nSee [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) for more info.\n\n### Claude Desktop\n\nAdd this to your Claude Desktop `claude_desktop_config.json` file (you can find it if open `Settings` → `Developer` → `Edit config`):\n\n```json\n{\n  \"mcpServers\": {\n    \"vmanomaly\": {\n      \"command\": \"/path/to/mcp-vmanomaly\",\n      \"env\": {\n        \"VMANOMALY_ENDPOINT\": \"http://localhost:8490\",\n        \"VMANOMALY_BEARER_TOKEN\": \"<YOUR_TOKEN>\",\n        \"VMANOMALY_HEADERS\": \"X-Custom=value1,X-Auth=value2\"\n      }\n    }\n  }\n}\n```\n\nSee [Claude Desktop MCP docs](https://modelcontextprotocol.io/quickstart/user) for more info.\n\n### Claude Code\n\nRun the command:\n\n```sh\nclaude mcp add vmanomaly -- /path/to/mcp-vmanomaly \\\n  -e VMANOMALY_ENDPOINT=http://localhost:8490 \\\n  -e VMANOMALY_BEARER_TOKEN=<YOUR_TOKEN> \\\n  -e VMANOMALY_HEADERS=\"X-Custom=value1,X-Auth=value2\"\n```\n\nSee [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.\n\n### Visual Studio Code\n\nAdd this to your VS Code MCP config file:\n\n```json\n{\n  \"servers\": {\n    \"vmanomaly\": {\n      \"type\": \"stdio\",\n      \"command\": \"/path/to/mcp-vmanomaly\",\n      \"env\": {\n        \"VMANOMALY_ENDPOINT\": \"http://localhost:8490\",\n        \"VMANOMALY_BEARER_TOKEN\": \"<YOUR_TOKEN>\",\n        \"VMANOMALY_HEADERS\": \"X-Custom=value1,X-Auth=value2\"\n      }\n    }\n  }\n}\n```\n\nSee [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.\n\n### Zed\n\nAdd the following to your Zed config file:\n\n```json\n  \"context_servers\": {\n    \"vmanomaly\": {\n      \"command\": {\n        \"path\": \"/path/to/mcp-vmanomaly\",\n        \"args\": [],\n        \"env\": {\n          \"VMANOMALY_ENDPOINT\": \"http://localhost:8490\",\n          \"VMANOMALY_BEARER_TOKEN\": \"<YOUR_TOKEN>\",\n          \"VMANOMALY_HEADERS\": \"X-Custom=value1,X-Auth=value2\"\n        }\n      },\n      \"settings\": {}\n    }\n  }\n```\n\nSee [Zed MCP docs](https://zed.dev/docs/ai/mcp) for more info.\n\n### JetBrains IDEs\n\n- Open `Settings` → `Tools` → `AI Assistant` → `Model Context Protocol (MCP)`.\n- Click `Add (+)`\n- Select `As JSON`\n- Put the following to the input field:\n\n```json\n{\n  \"mcpServers\": {\n    \"vmanomaly\": {\n      \"command\": \"/path/to/mcp-vmanomaly\",\n      \"env\": {\n        \"VMANOMALY_ENDPOINT\": \"http://localhost:8490\",\n        \"VMANOMALY_BEARER_TOKEN\": \"<YOUR_TOKEN>\",\n        \"VMANOMALY_HEADERS\": \"X-Custom=value1,X-Auth=value2\"\n      }\n    }\n  }\n}\n```\n\n### Windsurf\n\nAdd the following to your Windsurf MCP config file:\n\n```json\n{\n  \"mcpServers\": {\n    \"vmanomaly\": {\n      \"command\": \"/path/to/mcp-vmanomaly\",\n      \"env\": {\n        \"VMANOMALY_ENDPOINT\": \"http://localhost:8490\",\n        \"VMANOMALY_BEARER_TOKEN\": \"<YOUR_TOKEN>\",\n        \"VMANOMALY_HEADERS\": \"X-Custom=value1,X-Auth=value2\"\n      }\n    }\n  }\n}\n```\n\nSee [Windsurf MCP docs](https://docs.windsurf.com/windsurf/mcp) for more info.\n\n### Using Docker instead of binary\n\nYou can run vmanomaly MCP server using Docker instead of local binary.\n\nYou should replace run command in configuration examples above in the following way:\n\n```json\n{\n  \"mcpServers\": {\n    \"vmanomaly\": {\n      \"command\": \"docker\",\n      \"args\": [\n        \"run\",\n        \"-i\", \"--rm\",\n        \"-e\", \"VMANOMALY_ENDPOINT\",\n        \"-e\", \"VMANOMALY_BEARER_TOKEN\",\n        \"-e\", \"VMANOMALY_HEADERS\",\n        \"ghcr.io/victoriametrics/mcp-vmanomaly\"\n      ],\n      \"env\": {\n        \"VMANOMALY_ENDPOINT\": \"http://localhost:8490\",\n        \"VMANOMALY_BEARER_TOKEN\": \"<YOUR_TOKEN>\",\n        \"VMANOMALY_HEADERS\": \"X-Custom=value1,X-Auth=value2\"\n      }\n    }\n  }\n}\n```\n\n## Usage\n\nAfter [installing](#installation) and [configuring](#setup-in-clients) the MCP server, you can start using it with your favorite MCP client.\n\nYou can start dialog with AI assistant from the phrase:\n\n```\nUse MCP vmanomaly in the following answers\n```\n\nBut 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.\n\n### Toolset\n\nMCP vmanomaly provides tools organized into categories:\n\n#### Health & Info (4 tools)\n\n| Tool                           | Description                                             |\n|--------------------------------|---------------------------------------------------------|\n| `vmanomaly_health_check`       | Check vmanomaly server health status                    |\n| `vmanomaly_get_buildinfo`      | Get build information (version, build time, Go version) |\n| `vmanomaly_get_server_queries` | Get configured server query aliases and expressions     |\n| `vmanomaly_get_metrics`        | Get vmanomaly server metrics in Prometheus format       |\n\n#### Model Configuration (4 tools)\n\n| Tool                              | Description                                             |\n|-----------------------------------|---------------------------------------------------------|\n| `vmanomaly_list_models`           | List models exposed to VMUI and other UI-oriented flows |\n| `vmanomaly_get_server_models`     | Get configured server models and their query attachments |\n| `vmanomaly_get_model_schema`      | Get JSON schema for a specific model type               |\n| `vmanomaly_validate_model_config` | Validate model configuration before using it            |\n\n#### Configuration (1 tool)\n\n| Tool                        | Description                                    |\n|-----------------------------|------------------------------------------------|\n| `vmanomaly_validate_config` | Validate complete vmanomaly YAML configuration |\n\n#### Documentation (1 tool)\n\n| Tool                      | Description                                                         |\n|---------------------------|---------------------------------------------------------------------|\n| `vmanomaly_search_docs`   | Full-text search across vmanomaly documentation with fuzzy matching |\n\n#### Compatibility (1 tool)\n\n| Tool                            | Description                                                 |\n|---------------------------------|-------------------------------------------------------------|\n| `vmanomaly_check_compatibility` | Check if persisted state is compatible with runtime version |\n\n#### Alerting (1 tool)\n\n| Tool                              | Description                                              |\n|-----------------------------------|----------------------------------------------------------|\n| `vmanomaly_generate_alert_rule`   | Generate VMAlert rule YAML for anomaly score alerting    |\n\n#### Analysis & Autotune (4 tools)\n\n| Tool                                   | Description                                                                  |\n|----------------------------------------|------------------------------------------------------------------------------|\n| `vmanomaly_timeseries_characteristics` | Profile sampled query results for trends, seasonalities, spikiness, and gaps |\n| `vmanomaly_create_autotune_task`       | Start tuning one requested model class on sampled series                    |\n| `vmanomaly_get_autotune_task`          | Poll autotune progress and retrieve a completed recommendation              |\n| `vmanomaly_cancel_autotune_task`       | Request cooperative cancellation of an autotune task                        |\n\n`vmanomaly_create_autotune_task` accepts `optimization_n_trials`, `optimization_timeout`, and advanced\n`optimization_params` to bound Optuna work. The MCP tool uses interactive defaults of 32 trials and\n8 seconds when no optimization budget is provided, and a conservative anomaly fraction of 0.02 when\n`anomaly_percentage` is omitted; the vmanomaly API defaults are larger. Poll\n`vmanomaly_get_autotune_task` until `status` is `done`, then use the recommendation under\n`result_data`. Treat `error` and `canceled` as terminal statuses.\n\nThe list/schema endpoints intentionally expose only models supported by VMUI. Outside VMUI,\ndocumented multivariate aliases such as `temporal_envelope_multivariate` can still be shared-autotuned\nand validated as complete model configurations. Do not recommend multivariate models in VMUI.\n\nFor new configurations, prefer online models. Prophet, Holt-Winters, and Isolation Forest remain\nsupported for existing deployments but are planned for future deprecation; use Temporal Envelope as\nthe corresponding univariate or multivariate migration target.\n\n### Dialog example\n\nThis example shows data-driven model selection rather than choosing a model from the metric name. The YAML is a\ncomplete deployment-config excerpt: VMUI suggestion cards continue to carry business-policy fields in the model\nconfiguration because the UI query editor currently exposes only the query expression and language.\n\n- > **You**: Detect sustained CPU spikes for\n  > `avg by (instance) (1 - rate(node_cpu_seconds_total{mode=\"idle\"}[5m]))` at a `5m` step.\n- > **Assistant**: *I profiled the exact query first. The sampled series contain a trend and recurring\n  > hour-of-day/day-of-week structure, so `temporal_envelope` is the best online starting point. If\n  > the profile had no meaningful trend or seasonality, I would prefer `mad_online` for robust data,\n  > or `zscore_online` only for a stable light-tailed distribution.*\n- > **Assistant**: *I verified the model and schema, then started shared autotune with the same `5m`\n  > step, `anomaly_percentage=0.02`, and causal `exact=true` validation. After sequentially polling\n  > the task to completion, I validated the returned model configuration before presenting it.*\n  >\n  > ```yaml\n  > reader:\n  >   workers: 0\n  >   queries:\n  >     cpu_non_idle:\n  >       expr: avg by (instance) (1 - rate(node_cpu_seconds_total{mode=\"idle\"}[5m]))\n  >       detection_direction: above_expected\n  >       min_rel_dev_from_expected: [0, 15]\n  >\n  > models:\n  >   cpu_envelope:\n  >     class: temporal_envelope\n  >     queries: [cpu_non_idle]\n  >     schedulers: [cpu_5m]\n  >     seasonalities: [hod_smooth, dow_smooth]\n  > ```\n  >\n  > *The exact tuned parameters depend on the sampled data; the final model spec is always validated\n  > against the running vmanomaly instance.*\n\nDuring this dialog, the assistant used the following tools:\n\n- `vmanomaly_timeseries_characteristics` to measure the sampled data profile\n- `vmanomaly_list_models` and `vmanomaly_get_model_schema` to verify the UI-compatible model\n- `vmanomaly_create_autotune_task` and `vmanomaly_get_autotune_task` to tune shared parameters\n- `vmanomaly_validate_model_config` to validate the tuned model\n- `vmanomaly_validate_config` to validate the configuration\n\n## Monitoring\n\nIn [HTTP and SSE modes](#modes) the MCP Server provides metrics in Prometheus format at the `/metrics` endpoint.\n\n**Tracked operations**:\n\n- `mcp_vmanomaly_initialize_total` - Client connections\n- `mcp_vmanomaly_call_tool_total{name,is_error}` - Tool calls with success/error tracking\n- `mcp_vmanomaly_read_resource_total` - Documentation resource reads\n- `mcp_vmanomaly_list_*_total` - List operations (tools, resources, prompts)\n- `mcp_vmanomaly_error_total{method,error_class}` - Errors by bounded, non-sensitive class\n\n**Example**:\n\n```bash\n# Start in HTTP mode\nVMANOMALY_ENDPOINT=\"http://localhost:8490\" MCP_SERVER_MODE=http ./bin/mcp-vmanomaly\n\n# Query metrics\ncurl http://localhost:8080/metrics\n```\n\n## Roadmap\n\n- [ ] Grafana dashboard for MCP server monitoring\n- [ ] Add API compatibility matrix to gracefully handle version differences between MCP client and vmanomaly server (API is evolving, features may be unavailable)\n\n## Disclaimer\n\nAI services and agents along with MCP servers like this cannot guarantee the accuracy, completeness and reliability of results.\nYou should double check the results obtained with AI.\n\nThe 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.\n\n## Contributing\n\nContributions to the MCP vmanomaly project are welcome!\n\nPlease feel free to submit issues, feature requests, or pull requests.\n\n## Related Projects\n\n- [vmanomaly](https://docs.victoriametrics.com/anomaly-detection/) - VictoriaMetrics anomaly detection\n- [VictoriaMetrics](https://victoriametrics.com/) - Time series database\n- [mcp-victoriametrics](https://github.com/VictoriaMetrics/mcp-victoriametrics) - MCP server for VictoriaMetrics\n- [Model Context Protocol](https://modelcontextprotocol.io/) - MCP specification\n\n## Support\n\nFor vmanomaly-specific questions, see the [vmanomaly documentation](https://docs.victoriametrics.com/anomaly-detection/).\n\nFor MCP server issues, please open an issue in this repository.\n",
  "bytes": 28101,
  "sha": "ad9bbf157af7ca70d80dc32da76f6ef867a02436a8e1ab57e2346ac134ef8d44",
  "repo_slug": "victoriametrics/mcp-vmanomaly",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_victoriametrics_mcp_vmanomaly_cdb4cef0/readme"
}