mcp-vmanomaly

v0.7.0
io.github.VictoriaMetrics/mcp-vmanomaly Checked 5 hours ago Published 5 days ago

MCP Server for vmanomaly - VictoriaMetrics anomaly detection

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

vmanomaly_cancel_autotune_task

Request cooperative cancellation of a running shared autotune task.

ParameterTypeDescription
task_id *stringAutotune task identifier returned by vmanomaly_create_autotune_task

vmanomaly_check_compatibility

Check if persisted vmanomaly state is compatible with the current or target runtime version. Returns compatibility status and required migration actions.

ParameterTypeDescription
version_tostringOptional target version to check compatibility against. If omitted, checks against current runtime version.

vmanomaly_create_autotune_task

Start shared unsupervised autotune on sampled query results for one requested model class. Returns a task_id immediately. Use this after choosing a model class from vmanomaly_timeseries_characteristics, then poll vmanomaly_get_autotune_task until done. Pass the same step used for profiling and the final detect-anomalies task/config. Tell the user the budget and anomaly assumption before calling; MCP defaults to optimization_timeout=8, optimization_n_trials=32, and anomaly_percentage=0.02 unless overridden.

ParameterTypeDescription
tuned_class_name *stringModel class or alias to tune. Call vmanomaly_list_models first for available models. Supports one expression or named queries with separate business policies. Tune the multivariate class directly for…
anomaly_percentagenumberExpected anomaly fraction in the range [0 0.5) for unsupervised tuning (conservative MCP default: 0.02)
datasource_typestringDatasource type (default: 'vm')
datasource_urlstringOptional VictoriaMetrics or VictoriaLogs datasource URL
endnumberOptional query end timestamp as Unix seconds
frozen_paramsobjectTop-level model parameters to freeze while tuning
limitintegerSampled series cap for profiling and shared autotune (default: 100)
optimization_n_trialsintegerMaximum Optuna trials. Use small values for interactive Copilot runs; MCP default is 32.
optimization_paramsobjectAdvanced tuning controls: n_trials timeout n_jobs n_splits train_val_ratio seed validation_scheme beta show_progress_bar gc_after_trial exact optimize_complexity. Set exact=true for online models when…
optimization_timeoutnumberOptimization timeout in seconds. Use small values for interactive Copilot runs; MCP default is 8.
optimized_business_paramsarrayLegacy model-local business parameters to tune: detection_direction min_dev_from_expected min_rel_dev_from_expected. For vmanomaly v1.30.2+ prefer freezing stable policies during tuning and emitting t…
pass_auth_headersbooleanForward MCP request authorization headers to datasource
queriesobjectNamed expressions keyed by alias with optional per-query business policies. One shared study across all inputs; use frozen_params.groupby for multivariate or peer grouping. On v1.31.0+ peer_outlier ke…
querystringLegacy expression; provide exactly one of query or queries
replayobjectOptional deployment-schedule evaluation on fixed start/end Unix timestamps with preceding fit history. Omit for fold-based tuning. Requires backend replay support; verify completed result_data.data.op…
short_gap_stepsintegerShort gaps to interpolate during profiling (default: 2)
startnumberOptional query start timestamp as Unix seconds
stepstringQuery step/resolution (default: '1s'; examples: '1m' '5m' '1h'). Use the same step from time-series characteristics and the final detect-anomalies task/config.
tenant_idstringOptional tenant ID for cluster datasources
timezonestringIANA timezone for profile-guided calendar hints
use_profile_hintsbooleanPass sampled time-series characteristics as search hints when the selected model search space supports them (default: true)

vmanomaly_discover_metrics

Discover scoped metric names, labels or series using one bounded request. Supply selectors and a fixed time window. Returned counts are not exact cardinality; preserve completeness and warnings. Requires the discovery API; 404 means unsupported, not an empty inventory. No automatic retries or tenant enumeration.

ParameterTypeDescription
datasource_url *stringAuthorized VictoriaMetrics datasource URL; include any required path prefix.
end *numberFixed window end as Unix seconds, greater than start and at most 31 days after it.
match *arrayOne to ten PromQL series selectors restricting discovery; each is at most 4096 UTF-8 bytes.
operation *stringMetadata to discover: metric names, label names, values of a named label, or series label sets.
start *numberFixed window start as Unix seconds since the epoch; fractional seconds are accepted.
labelstringTarget label name, required and nonblank for label_values; omitted for other operations.
limitintegerMaximum returned items, 1 to 1000; omit for the server default of 100. Returned counts are not total cardinality.
pass_auth_headersbooleanWhether the server may forward incoming authentication headers to the datasource. Default false; enable only when credential forwarding to this datasource is authorized.
tenant_idstringOptional cluster tenant: accountID, accountID:projectID or multitenant. May be embedded in datasource_url; conflicting settings are rejected. Preserve the requested scope; never automatically broaden…
timeout_secondsnumberUpstream metadata request timeout in seconds, up to 30; omit or use 0 for the server default of 10.

vmanomaly_estimate_deployment_resources

Experimental vmanomaly deployment resource sizing, not monitored-metric forecasting or forecast_at. FORWARD sizing for a known entity_count: estimate required CPU, RAM, disk and fit/inference stage costs. When the user instead gives CPU/RAM and cadence without a series count, use vmanomaly_estimate_inference_capacity; do not ask for cardinality to make a forward request. For suspected OOM distinguish observed events from CrashLoopBackOff. For an existing single pod set options.deployment.members_count=1. Online models default to bootstrap only and advisory fit duration, retaining peak RAM/disk…

ParameterTypeDescription
workloads *arrayOne to sixteen model workloads. State required history and sampling when known; defaults are two weeks of five-minute data.
optionsobjectAdditional capacity request fields: policy (cpu_candidates <= max_cpus_per_node, storage_mode, persist_models, ram_limit_bytes_per_node, margin_ratio, fit_budget_seconds, infer_budget_seconds (default…

vmanomaly_estimate_inference_capacity

Experimental vmanomaly deployment inference capacity, not monitored-metric forecasting or forecast_at. REVERSE sizing: given CPUs, optional RAM limit and inference cadence, return approximate maximum active models per interval. Choose this for 'estimate capacity' with fixed resources and no series count. Active model/entity count is the OUTPUT: never request it as an input or invent it. For univariate models this is series count; multivariate entities are groups with channels_per_entity input series each. Report input_series separately. Clarify missing history or disclose a default; retain the…

ParameterTypeDescription
cpus *integerCPU/worker allocation on one instance, 1 through 256.
infer_every_seconds *numberInference cadence in seconds, e.g. 300.
model_class *stringConcrete built-in model; mad/mad_online and zscore/zscore_online resolve to the same online classes. Prefer mad_online or zscore_online.
optionsobjectAdditional throughput fields: model_params, topology, channels_per_entity, history (window_seconds, step_seconds; optional fit_every_seconds; inclusive points=floor(window/step)+1), infer_points_per_c…
ram_limit_bytesintegerOptional container RAM limit, in bytes. Omit when unconstrained.

vmanomaly_generate_alert_rule

Generate a VMAlert rule YAML configuration for anomaly score alerting. Creates an example vmalert rule that triggers when anomaly_score exceeds the threshold. Use this to set up alerting for anomalies detected by vmanomaly.

ParameterTypeDescription
query *stringPromQL query to include in alert description
step *stringQuery step/resolution (e.g. '1s' '1m' '5m')
anomaly_thresholdnumberAnomaly score threshold (default: 1.0)
group_namestringVMAlert rule group name (default: 'VMAnomalyAlerts')
infer_everystringInference cadence (defaults to step value)
rule_descriptionstringCustom alert description/summary
rule_namestringCustom alert rule name

vmanomaly_generate_preset_artifacts

Render matching vmanomaly configuration and vmalert rules from a complete configuration. Preserves query policies and model/scheduler mappings. Supply a public incident base URL for investigation annotations. Schema-valid does not mean live-tested; retain all warnings. Requires the artifact API; do not retry unsupported targets or infer writer destinations.

ParameterTypeDescription
config *objectComplete configuration including explicit reader, writer, models and schedulers. Use secret references rather than inline credentials.
alertsobjectOptional alert policy. Omit to use backend defaults; generation does not deploy rules or test notification delivery.
deploymentobjectOptional deployment files. If target and storage are known, include them in the first generation call; do not generate a preliminary base-only bundle. Generate base files first only when target or sto…
required_inputsarrayUnresolved draft fields: writer.datasource_url and/or writer.tenant_id. Use http://replace-me.invalid:8428 for an unknown writer URL and never probe it. The backend returns a required-input checklist…

vmanomaly_get_autotune_task

Get a shared autotune task. While status is running, wait briefly before polling again and never issue concurrent duplicate polls. When status is done, use result_data.data.modelConfig and related result_data fields. Treat error and canceled as terminal.

ParameterTypeDescription
task_id *stringAutotune task ID returned by creation
wait_secondsintegerWait up to this many seconds for completion (default 0: immediate). Prefer 10 to avoid repeated LLM polling turns. Returns latest status if still running; never creates a new task.

vmanomaly_get_buildinfo

Get vmanomaly server build information including version number, build timestamp, and Go version. Use this to verify server version, check compatibility, or troubleshoot issues by confirming which version is running.

vmanomaly_get_deployment_sizing_profiles

List shipped experimental deployment-sizing model/parameter profiles, target versions and CPU reference. Use to discover calibrated configurations before sizing; unavailable on older servers.

vmanomaly_get_metrics

Get currently instant Prometheus-formatted self-monitoring metrics from vmanomaly server. Returns operational metrics including reader/writer performance, model execution stats, system info, and resource usage. Output is in standard Prometheus text exposition format suitable for scraping or monitoring analysis.

vmanomaly_get_model_schema

Get the complete JSON schema for a UI-compatible model type returned by vmanomaly_list_models. Returns parameters, types, validation rules, defaults, and descriptions. Multivariate models are intentionally unavailable from this UI-oriented endpoint; configure them outside VMUI using documentation and validate the complete model config.

ParameterTypeDescription
model_class *stringUI-compatible model class or alias returned by vmanomaly_list_models. Multivariate models are intentionally unavailable from this UI-oriented schema endpoint.

vmanomaly_get_preset_guide

Retrieve the versioned workflow for building an anomaly-detection preset from discovered signals. Call before starting a preset request, including node-exporter onboarding. Covers bounded discovery, profiling, model selection, sizing, missing destinations and generating downloadable config/alert artifacts. Does not query data or modify configuration.

vmanomaly_get_server_models

Get configured server models and their query attachments. Returns runtime model aliases, model configuration, attached queries, and model metadata from the vmanomaly server.

vmanomaly_get_server_queries

Get query aliases and MetricsQL/LogsQL expressions configured on the running vmanomaly server.

vmanomaly_health_check

Check the health status of the vmanomaly server

vmanomaly_list_models

List model types exposed to VMUI and other UI-oriented configuration flows. Use this before selecting a model in UI, then call vmanomaly_get_model_schema. Experimental multivariate models may be included depending on the connected server version. Use its response as the source of truth.

vmanomaly_read_doc_section

Read a bounded documentation section by source URI and character offset returned by search. Follow next_offset for continuation; fetch relevant sections before relying on truncated guidance.

ParameterTypeDescription
uri *stringExact documentation URI returned by search
limitintegerCharacter count
offsetintegerZero-based character offset (default 0)

vmanomaly_search_docs

Search vmanomaly documentation using full-text search with fuzzy matching. Returns ranked excerpts with source URIs and character offsets. Use vmanomaly_read_doc_section for additional text; excerpts are not complete documentation. Use this when you need information about model parameters, configuration syntax, troubleshooting, or feature explanations.

ParameterTypeDescription
query *stringSearch query for vmanomaly documentation. Supports keywords phrases or natural language questions. Example queries: 'temporal envelope parameters' 'how to configure seasonality' 'online models' 'insta…
limitnumberMaximum number of documentation resources to return. Range: 1-100. Default: 5. Ranking and requested top-k are preserved; excerpts share a bounded text budget.

vmanomaly_timeseries_characteristics

Profile a sampled set of time series returned by a query. Returns compact batch characteristics such as detected seasonalities, trend share, flatness/spikiness, coverage, and sampling stats. Use this before recommending a model from data rather than from a manual description.

ParameterTypeDescription
query *stringPromQL or LogsQL query to profile on sampled time series
datasource_typestringDatasource type (default: 'vm')
datasource_urlstringOptional VictoriaMetrics or VictoriaLogs datasource URL
endnumberOptional query end timestamp as Unix seconds
limitintegerSampled series cap for profiling (default: 100)
pass_auth_headersbooleanForward MCP request authorization headers to datasource
short_gap_stepsintegerShort gaps to interpolate during profiling (default: 2)
startnumberOptional query start timestamp as Unix seconds
stepstringQuery step/resolution (default: '1s'; examples: '1m' '5m' '1h'). Use the same step that will be used for autotune and the final detect-anomalies task/config.
tenant_idstringOptional tenant ID for cluster datasources
timezonestringIANA timezone for calendar profiling
verbosebooleanInclude expanded aggregate diagnostics without per-series identifiers. Prefer false for a compact response.

vmanomaly_validate_config

Validate the schema of a complete vmanomaly YAML configuration. Takes a full configuration object (with reader, schedulers, models, writer sections) and returns validation result with normalized config or error details. Schema validation does not establish deployment readiness; perform separate deployment rendering and live checks.

ParameterTypeDescription
config *objectComplete vmanomaly configuration object to validate. Must include all required sections: 'reader' (data source) 'schedulers' (timing) 'models' (detection algorithms) and 'writer' (output destination).…

vmanomaly_validate_model_config

Validate the schema of an anomaly detection model configuration. This does not assess model fit, data compatibility or deployment readiness. Returns validation result with the normalized/validated configuration or detailed error messages if invalid. Use this after building your model config to catch configuration errors before creating a detection task with vmanomaly_create_detection_task.

ParameterTypeDescription
model_spec *objectModel configuration object to validate. Must include 'class' plus model-specific parameters. Use vmanomaly_list_models and vmanomaly_get_model_schema to discover available models