vmaf-mcp
v1.0.0rc3MCP server exposing VMAF scoring, model listing, and benchmark runs via JSON-RPC.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
vmaf_score
Compute a VMAF score for a (reference, distorted) YUV pair. Optional tiny-AI/DNN, feature-selection, CTC-preset, and frame-range parameters map onto the corresponding vmaf CLI flags (ADR-1117).
| Parameter | Type | Description |
|---|---|---|
bitdepth * | integer | |
dis * | string | Distorted YUV path. |
height * | integer | |
pixfmt * | string | |
ref * | string | Reference YUV path. |
width * | integer | |
aom_ctc | string | AOM Common Test Conditions preset (--aom_ctc). Configures a fixed model + feature set; mutually exclusive with manual feature/model config. |
backend | string | |
cpumask | integer | Bitmask restricting permitted CPU SIMD instruction sets (--cpumask). |
csv | boolean | Write output file as CSV (--csv). Equivalent to output_fmt='csv'. |
disable_clip | boolean | Disable score clipping to [0, 100] on the model (--model ...:disable_clip). |
dnn_ep | string | Alias for tiny_device: ONNX Runtime execution provider for the tiny model (--dnn-ep / --tiny-device). Default: auto. |
enable_transform | boolean | Enable score transform on the model (--model ...:enable_transform). |
feature | array | Additional feature extractors, each passed as a repeated --feature flag. Use the libvmaf 'name[=key=val:...]' syntax, e.g. 'psnr' or 'cambi=full_ref=true'. Mutually exclusive with aom_ctc/nflx_ctc. |
frame_cnt | integer | Maximum number of frames to process (--frame_cnt). |
frame_skip_dist | integer | Skip the first N frames of the distorted input (--frame_skip_dist). |
frame_skip_ref | integer | Skip the first N frames of the reference (--frame_skip_ref). |
gpumask | integer | Bitmask restricting permitted GPU operations (--gpumask). |
hip_device | integer | Select HIP GPU device by index (--hip_device). |
metal_device | integer | Select Metal GPU device by index (--metal_device). |
model | string | |
nflx_ctc | string | Netflix Common Test Conditions preset (--nflx_ctc). Mutually exclusive with manual feature/model config. |
no_prediction | boolean | Extract features only, skip VMAF prediction (--no_prediction). |
no_reference | boolean | No-reference (NR) mode (--no-reference). Requires tiny_model (an NR ONNX model); the reference path becomes a formality — pass any valid YUV of matching geometry since only the distorted picture is… |
output_fmt | string | Score output format (--json, --xml, --csv, --sub). Default: json. |
precision | string | Score precision format. Default 'legacy' (%.6f, Netflix-compatible per ADR-0119); use 'max' for lossless float output (%.17g). |
sub | boolean | Write output file as subtitle-style per-frame scores (--sub). Equivalent to output_fmt='sub'. |
subsample | integer | Score every Nth frame (1 = every frame). |
sycl_device | integer | Select SYCL GPU device by index (--sycl_device). |
threads | integer | Worker thread count (--threads). Capped to hardware cores by the CLI. |
tiny_codec | string | Encoder name for codec-aware tiny models (--tiny-codec), e.g. libx264. |
tiny_crf | integer | CRF / QP integer for codec-aware tiny models (--tiny-crf; clamped to 0..63). |
tiny_device | string | ONNX Runtime execution provider for the tiny model (--tiny-device / --dnn-ep). Default: auto. |
tiny_fp16 | boolean | Request fp16 IO where the execution provider supports it (--tiny-fp16). |
tiny_model | string | Path to a tiny ONNX model loaded alongside classic models (--tiny-model). |
tiny_model_verify | boolean | Require Sigstore-bundle verification of the tiny model before use (--tiny-model-verify). |
tiny_preset | string | Encoder preset string for codec-aware tiny models (--tiny-preset). |
tiny_resize | string | Auto-resize filter for NCHW tiny models on dimension mismatch (--tiny-resize). Default: disabled (mismatch hard-errors). |
tiny_threads | integer | CPU EP intra-op thread count for the tiny model (--tiny-threads; 0 = ORT default). |
list_models
Enumerate VMAF models (JSON / pickle / ONNX) shipped with the repo.
list_backends
Report which runtime backends (cpu / cuda / sycl / hip / metal) the local vmaf binary was built with.
run_benchmark
Run the full multi-fixture benchmark harness (bench_all.sh) across all available backends (CPU, CUDA, SYCL) on three canonical YUV fixture sets: the 576x324 Netflix golden pair, a 1080p 5-frame pair, and the 4K BBB 200-frame pair. Returns stdout (per-backend scores + backend comparison table) and stderr. Takes no arguments — fixtures are built-in. ADR-0513.
eval_model_on_split
Run an ONNX tiny-AI regressor on a parquet feature cache, filter to a deterministic train/val/test split (keyed by the 'key' column), and report PLCC / SROCC / RMSE.
| Parameter | Type | Description |
|---|---|---|
features * | string | Parquet feature cache path. |
model * | string | ONNX model path. |
input_name | string | |
split | string |
compare_models
Rank several ONNX models on the same parquet feature split by descending PLCC. Models that fail to load or score are listed under 'errors' instead of aborting the whole call.
| Parameter | Type | Description |
|---|---|---|
features * | string | |
models * | array | |
input_name | string | |
split | string |
describe_worst_frames
Score a (ref, dis) pair, pick the N worst-VMAF frames, extract each as PNG via ffmpeg, and describe the visible artefacts with a local vision-language model through ONNX Runtime GenAI (VMAF_MCP_VLM_MODEL, [vlm] extra). Returns frame metadata with a note when no model is configured. ADR-0172 / ADR-1886.
| Parameter | Type | Description |
|---|---|---|
bitdepth * | integer | |
dis * | string | |
height * | integer | |
pixfmt * | string | |
ref * | string | |
width * | integer | |
backend | string | |
model | string | |
n | integer | How many worst-VMAF frames to describe. |
probe_backend
Run a 1-frame VMAF health check to distinguish 'compiled in' from 'driver present + functional'. Returns compiled_in (bool), runtime_healthy (bool), latency_ms, score (the VMAF mean on a 64×64 mid-grey pair; >=36px per dimension is required by CUDA ADM), and any error string. Use this when list_backends returns true but actual GPU dispatch may fail (driver not loaded, ICD missing, KFD ioctl failure, etc.). ADR-0608.
| Parameter | Type | Description |
|---|---|---|
backend * | string | Backend to health-check. |
vmaf_version
Return the local vmaf binary's identity and build flags. Reports binary_path, version string (from --version), and build_flags dict (cpu/cuda/sycl/hip/metal). Use this to confirm which fork build is running before scoring. ADR-0608.
vmaf_score_encoded
Score a (reference, distorted) pair of encoded video files (MP4, MKV, Y4M, WebM, etc.) by decoding them to raw YUV via ffmpeg and then running vmaf_score. Geometry (width, height, pixel format, bit depth) is probed automatically from the reference stream — no manual size entry required. Returns the same response shape as vmaf_score plus reference_encoded and distorted_encoded fields. Requires ffmpeg + ffprobe on PATH. ADR-0608.
| Parameter | Type | Description |
|---|---|---|
distorted_encoded * | string | Path to the distorted encoded video. |
reference_encoded * | string | Path to the reference encoded video (MP4/MKV/Y4M/...). Must be under an allowlisted root (VMAF_MCP_ALLOW). |
aom_ctc | string | AOM Common Test Conditions preset (--aom_ctc). Configures a fixed model + feature set; mutually exclusive with manual feature/model config. |
backend | string | |
cpumask | integer | Bitmask restricting permitted CPU SIMD instruction sets (--cpumask). |
csv | boolean | Write output file as CSV (--csv). Equivalent to output_fmt='csv'. |
disable_clip | boolean | Disable score clipping to [0, 100] on the model (--model ...:disable_clip). |
dnn_ep | string | Alias for tiny_device: ONNX Runtime execution provider for the tiny model (--dnn-ep / --tiny-device). Default: auto. |
enable_transform | boolean | Enable score transform on the model (--model ...:enable_transform). |
feature | array | Additional feature extractors, each passed as a repeated --feature flag. Use the libvmaf 'name[=key=val:...]' syntax, e.g. 'psnr' or 'cambi=full_ref=true'. Mutually exclusive with aom_ctc/nflx_ctc. |
frame_cnt | integer | Maximum number of frames to process (--frame_cnt). |
frame_skip_dist | integer | Skip the first N frames of the distorted input (--frame_skip_dist). |
frame_skip_ref | integer | Skip the first N frames of the reference (--frame_skip_ref). |
gpumask | integer | Bitmask restricting permitted GPU operations (--gpumask). |
hip_device | integer | Select HIP GPU device by index (--hip_device). |
metal_device | integer | Select Metal GPU device by index (--metal_device). |
model | string | |
nflx_ctc | string | Netflix Common Test Conditions preset (--nflx_ctc). Mutually exclusive with manual feature/model config. |
no_prediction | boolean | Extract features only, skip VMAF prediction (--no_prediction). |
no_reference | boolean | No-reference (NR) mode (--no-reference). Requires tiny_model (an NR ONNX model); the reference path becomes a formality — pass any valid YUV of matching geometry since only the distorted picture is… |
output_fmt | string | Score output format (--json, --xml, --csv, --sub). Default: json. |
precision | string | Score precision format. Default 'legacy' (%.6f, Netflix-compatible per ADR-0119); use 'max' for lossless float output (%.17g). |
sub | boolean | Write output file as subtitle-style per-frame scores (--sub). Equivalent to output_fmt='sub'. |
subsample | integer | Score every Nth frame (1 = every frame). |
sycl_device | integer | Select SYCL GPU device by index (--sycl_device). |
threads | integer | Worker thread count (--threads). Capped to hardware cores by the CLI. |
tiny_codec | string | Encoder name for codec-aware tiny models (--tiny-codec), e.g. libx264. |
tiny_crf | integer | CRF / QP integer for codec-aware tiny models (--tiny-crf; clamped to 0..63). |
tiny_device | string | ONNX Runtime execution provider for the tiny model (--tiny-device / --dnn-ep). Default: auto. |
tiny_fp16 | boolean | Request fp16 IO where the execution provider supports it (--tiny-fp16). |
tiny_model | string | Path to a tiny ONNX model loaded alongside classic models (--tiny-model). |
tiny_model_verify | boolean | Require Sigstore-bundle verification of the tiny model before use (--tiny-model-verify). |
tiny_preset | string | Encoder preset string for codec-aware tiny models (--tiny-preset). |
tiny_resize | string | Auto-resize filter for NCHW tiny models on dimension mismatch (--tiny-resize). Default: disabled (mismatch hard-errors). |
tiny_threads | integer | CPU EP intra-op thread count for the tiny model (--tiny-threads; 0 = ORT default). |
list_extractors
Enumerate all VmafFeatureExtractor implementations found in the local libvmaf C source tree. Returns each extractor's advertised name, inferred backend (cpu / cuda / sycl / hip / metal), and the source file it was defined in. Requires no binary — parses the C source directly. ADR-0608.
describe_model
Return metadata for a VMAF model by name or path. Accepts the model's filename stem (e.g. 'vmaf_v0.6.1'), its full filename (e.g. 'vmaf_v0.6.1.json'), or a path relative to the repo root. Fixes the Path.stem bug: 'vmaf_v0.6.1' is matched correctly against 'vmaf_v0.6.1.json' — not mis-trimmed to 'vmaf_v0.6'. Returns: name, path, format, size_bytes, model_type (JSON only), feature_names (JSON only). ADR-0608.
| Parameter | Type | Description |
|---|---|---|
name * | string | Model name stem (e.g. 'vmaf_v0.6.1'), full filename (e.g. 'vmaf_v0.6.1.json'), or repo-relative path. |
run_compare
Wrap 'vmaf-tune compare': compare codec adapters at one or more target VMAF scores and return a ranked report. Requires vmaf-tune to be installed (pip install -e tools/vmaf-tune). Emits MCP progress notifications when params._meta.progressToken is set. Default encoders: libx264,libx265,libsvtav1,libvpx-vp9. ADR-0608.
| Parameter | Type | Description |
|---|---|---|
src * | string | Source video path (any FFmpeg-readable format or raw YUV). |
encoders | string | Comma-separated encoder list, e.g. 'libx264,libx265'. |
framerate | number | Source framerate. |
height | integer | Source height (raw YUV only). |
no_parallel | boolean | Dispatch encoders sequentially (default: parallel). |
pix_fmt | string | |
target_vmaf | number | Single VMAF target (legacy, single-target schema). |
target_vmafs | string | Comma-separated VMAF targets, e.g. '94,96,97,98'. |
width | integer | Source width (raw YUV only). |
run_ladder
Wrap 'vmaf-tune ladder': build a per-title bitrate ladder via convex-hull sweep over resolution x target-VMAF, pick K knees, and emit an HLS / DASH / JSON manifest. Requires vmaf-tune. Emits MCP progress notifications. ADR-0608.
| Parameter | Type | Description |
|---|---|---|
resolutions * | string | Comma-separated WxH list, e.g. '1920x1080,1280x720,854x480'. |
src * | string | Source video path. |
target_vmafs * | string | Comma-separated VMAF targets, e.g. '95,90,85'. |
encoder | string | Codec adapter (default libx264). |
format | string | Manifest format. |
framerate | number | Source framerate. |
quality_tiers | integer | Number of ladder rungs to select. |
spacing | string |
run_tune_per_shot
Wrap 'vmaf-tune tune-per-shot': detect scene cuts, run a per-shot CRF bisect targeting a VMAF score, and return the encoding plan. Requires vmaf-tune. Emits MCP progress notifications. ADR-0608.
| Parameter | Type | Description |
|---|---|---|
src * | string | Source video path. |
encoder | string | |
format | string | |
framerate | number | |
output | string | Output video path (optional; plan-only if omitted). |
pix_fmt | string | |
scene_threshold | number | Scene-cut detection threshold (0..1). |
target_vmaf | number | Target VMAF score. |
vmaf_per_shot
Wrap the 'vmaf-perShot' sidecar binary: scan a raw YUV reference, detect shot boundaries from luma complexity + motion energy, and return a per-shot CRF plan targeting a VMAF score. Returns the parsed JSON plan by default (format='csv' returns the raw CSV text instead). ADR-0222.
| Parameter | Type | Description |
|---|---|---|
height * | integer | |
reference * | string | Reference raw planar YUV path (must be under an allowlisted root). |
width * | integer | |
bitdepth | integer | Planar YUV bit depth (--bitdepth). |
crf_max | integer | Upper CRF clamp (--crf-max). |
crf_min | integer | Lower CRF clamp (--crf-min). Must not exceed crf_max. |
diff_threshold | number | Shot-detector frame-diff cutoff (--diff-threshold; C default 12). |
format | string | Plan encoding (--format). The MCP tool defaults to json (the C CLI defaults to csv) so the plan comes back structured. |
pixel_format | string | Planar YUV subsampling (--pixel_format). |
target_vmaf | number | Target VMAF score the CRF predictor aims at (--target-vmaf). |
vmaf_roi
Wrap the 'vmaf_roi' sidecar binary: compute a per-CTU saliency grid for one frame of a raw YUV file and emit an encoder ROI sidecar. encoder='x265' returns the qpfile text in 'qpfile'; encoder='svt-av1' returns the raw int8 ROI map base64-encoded in 'roi_map_base64'. Without saliency_model a centre-weighted radial placeholder is used (smoke-test quality only).
| Parameter | Type | Description |
|---|---|---|
frame * | integer | 0-based frame index to score (--frame). |
height * | integer | |
reference * | string | Reference raw planar YUV path (must be under an allowlisted root). |
width * | integer | |
bitdepth | integer | |
ctu_size | integer | CTU grid cell size (--ctu-size; x265 max-ctu). |
encoder | string | Sidecar dialect (--encoder). |
pixel_format | string | |
saliency_model | string | Optional ONNX [1,1,H,W] luma->[0,1] saliency model (--saliency-model). Must be under an allowlisted root. |
strength | number | QP-offset gain applied to the saliency grid (--strength). |
vmaf_bench
Wrap the 'vmaf_bench' sidecar binary: per-feature micro-benchmark over the built-in synthetic fixtures, or (validate=true) a GPU-vs-CPU correctness comparison. Distinct from run_benchmark, which runs the end-to-end bench_all.sh harness over real YUV fixtures. In validate mode a non-zero exit is reported as validation_failed=true rather than as a tool error.
| Parameter | Type | Description |
|---|---|---|
bpc | integer | Bits per component (--bpc; C default 8). |
data_dir | string | Test-data directory (--data-dir). Must be a directory under an allowlisted root. |
device_list | boolean | List the available GPU devices and exit (--list-devices). |
frames | integer | Frames per benchmark (--frames; C default 10, max 48). |
gpu_only | boolean | Skip the CPU targets (--gpu-only). |
resolution | string | Single resolution to test (--resolution). Omit to test all. |
validate | boolean | GPU-vs-CPU correctness comparison (--validate). |
vmaf_vpl
Wrap the 'vmaf_vpl' sidecar binary: decode an encoded (reference, distorted) pair with Intel oneVPL, import the VA surfaces zero-copy into SYCL via DMA-BUF, and score them. Only built when the oneVPL + libva + SYCL toolchain is present; otherwise the tool reports the missing binary. Returns the parsed vmaf_score and frames_processed alongside the raw stdout.
| Parameter | Type | Description |
|---|---|---|
dis * | string | Distorted encoded video path. |
ref * | string | Reference encoded video path. |
device | integer | SYCL device index (--device). |
fallback | boolean | Fall back to a host upload when the zero-copy import fails (--fallback). |
frames | integer | Max frames to process (--frames; 0 = all). |
model | string | Bare VMAF model name (--model). Paths are rejected. |
render_node | string | VA-API render node (--render-node). Restricted to /dev/dri/renderD<N> or /dev/dri/card<N>. |