Skip to main content
Glama

RV MCP Server

MCP-сервер (Model Context Protocol), который связывает ИИ-ассистентов, таких как Claude, с Autodesk/Tweak RV, отраслевым стандартом приложений для просмотра медиаконтента. Управляйте воспроизведением, сравнивайте кадры, настраивайте цветокоррекцию и управляйте сеансами просмотра — и всё это с помощью естественного языка.

Внутри RV не требуется установка плагинов. Используется встроенный сетевой прослушиватель RV с поддержкой скриптов Mu через remote-eval.

Требования

  • OpenRV (или RV 2022.3.1+) с включенным сетевым режимом

  • Python 3.10+

  • Менеджер пакетов uv

Related MCP server: davinci-resolve-mcp-free

Быстрый старт

1. Запуск RV с поддержкой сети

Включите сеть в RV через RV → Networking → Enable Network (порт по умолчанию 45124).

Или из командной строки:

rv -network -networkPort 45124

2. Установка и регистрация

Claude Code (CLI):

claude mcp add --scope user rv-mcp -- uv run --no-sync --directory /path/to/RV_MCP rv-mcp

Примечание: --no-sync предотвращает конфликты блокировки файлов, когда несколько сеансов Claude используют один и тот же MCP-сервер. Запускайте uv sync вручную после изменения зависимостей.

Claude Desktop (~/.claude.json):

{
  "mcpServers": {
    "rv-mcp": {
      "command": "uv",
      "args": ["run", "--no-sync", "--directory", "/path/to/RV_MCP", "rv-mcp"]
    }
  }
}

Переменные окружения (опционально):

Переменная

По умолчанию

Описание

RV_MCP_HOST

127.0.0.1

Хост сети RV

RV_MCP_PORT

45124

Порт сети RV

3. Использование

Попросите Claude загрузить медиа, управлять воспроизведением, сравнить кадры или настроить цвета. Сервер автоматически преобразует естественный язык в команды RV.

Архитектура

Claude (stdio/MCP) --> FastMCP Server --> RV Network Protocol (TCP:45124) --> RV

Сервер поддерживает постоянное TCP-соединение с RV, используя пользовательский протокол на основе RvCommunicator из RV. Ключевые проектные решения:

  • Постоянное соединение с автоматическим переподключением при потере сокета

  • Потокобезопасность через threading.Lock для параллельных вызовов инструментов

  • Корректное завершение работы через обработчик atexit, который отправляет DISCONNECT (без этого RV отклоняет будущие соединения)

  • Обработка строк Mu — возвращаемые значения автоматически очищаются от кавычек и экранирования

Поток протокола

1. Connect TCP to 127.0.0.1:45124
2. Send: NEWGREETING <len> rv-mcp rvController
3. Send: PINGPONGCONTROL 1 0          (disable heartbeat)
4. Recv: NEWGREETING <len> <rv-name>   (consume RV's greeting)
5. For each command:
   Send: MESSAGE <len> RETURNEVENT remote-eval * { require commands; <mu_code> }
   Recv: MESSAGE <len> RETURN <value>
6. On shutdown:
   Send: MESSAGE <len> DISCONNECT

Управление цветом OCIO

Сервер включает полную поддержку OCIO v2. Когда установлена переменная $OCIO, RV может соответствовать точному преобразованию дисплея, используемому в ваших DCC-приложениях (3ds Max/Redshift, Nuke и т. д.).

Автоматическая настройка

В комплект входит скрипт rv_ocio_setup.py, который автоматически настраивает OCIO при загрузке медиа в RV:

  • Файлы EXR/HDR/TX автоматически определяются как scene-linear (ACEScg через роль scene_linear)

  • Преобразование дисплея устанавливается из настроек конфигурации по умолчанию (например, sRGB / ACES 1.0 SDR-video)

  • Метаданные цветности в EXR сопоставляются с цветовыми пространствами активной конфигурации

Для установки скопируйте rv_ocio_setup.py в путь поддержки RV:

# Windows
copy rv_ocio_setup.py %APPDATA%\RV\Python\

# Linux/macOS
cp rv_ocio_setup.py ~/.rv/Python/

Встроенный пакет ocio_source_setup в RV обнаружит и автоматически применит это переопределение.

Ручное управление OCIO через MCP

Инструмент

Описание

get_ocio_config

Список цветовых пространств, дисплеев, представлений и луков из активной конфигурации OCIO

set_ocio_colorspace

Установка входного цветового пространства для источника (вставляет узел OCIOFile)

set_ocio_display

Установка преобразования дисплея (вставляет узел OCIODisplay)

set_ocio_look

Применение лука OCIO к источнику

get_ocio_state

Получение текущего состояния узла OCIO в формате JSON

clear_ocio

Удаление узлов OCIO и восстановление конвейера по умолчанию

Сопоставление цветов Redshift + RV

Если вы используете конфигурацию OCIO от Redshift ($OCIO = C:\ProgramData\redshift\Data\OCIO\config.ocio), обратите внимание, что правила файлов помечают EXR как "Raw". Скрипт rv_ocio_setup.py переопределяет это, определяя форматы с плавающей запятой как scene-linear, гарантируя, что тональный компрессор ACES применяется в RV так же, как в окне рендеринга Redshift.

Инструменты (всего 47)

Выполнение (1)

Инструмент

Описание

execute_mu

Запуск произвольного кода Mu — «черный ход» для всего, что не покрыто специализированными инструментами

OCIO (6)

Инструмент

Описание

get_ocio_config

Получение информации о конфигурации OCIO (цветовые пространства, дисплеи, представления, луки)

set_ocio_colorspace

Установка входного цветового пространства OCIO для источника

set_ocio_display

Установка преобразования дисплея OCIO

set_ocio_look

Применение лука OCIO

get_ocio_state

Получение текущего состояния OCIO в формате JSON

clear_ocio

Удаление узлов OCIO, восстановление значений по умолчанию

Воспроизведение (17)

Инструмент

Описание

load_source

Загрузка медиафайла (последовательность изображений, фильм или одиночное изображение)

load_sources

Загрузка нескольких медиафайлов одновременно

play

Запуск воспроизведения

stop

Остановка воспроизведения

toggle_playback

Переключение воспроизведение/стоп, возвращает новое состояние

get_frame

Получение номера текущего кадра

set_frame

Переход к определенному кадру

step_forward

Шаг вперед на N кадров (по умолчанию 1)

step_backward

Шаг назад на N кадров (по умолчанию 1)

set_in_point

Установка начальной точки (начало диапазона воспроизведения)

set_out_point

Установка конечной точки (конец диапазона воспроизведения)

get_in_out_points

Получение текущих точек входа/выхода в формате JSON

set_fps

Установка частоты кадров воспроизведения

get_fps

Получение текущей частоты кадров воспроизведения

set_realtime

Включение/выключение режима реального времени (пропуск кадров для поддержания FPS)

set_play_mode

Установка режима цикла: loop, once или pingpong

set_playback_speed

Установка направления и скорости воспроизведения (1=вперед, -1=назад, 2=2x и т. д.)

get_frame_range

Получение полного состояния воспроизведения в формате JSON (кадр, диапазон, точки входа/выхода, воспроизведение, FPS)

Источники (7)

Инструмент

Описание

get_sources

Список всех загруженных узлов-источников в виде массива JSON

get_source_media_info

Получение подробной информации о медиа (разрешение, диапазон кадров, FPS, глубина цвета, каналы)

get_sources_at_frame

Получение узлов-источников, видимых на конкретном кадре

new_session

Создание нового пустого сеанса

clear_session

Очистка всех источников из текущего сеанса

save_session

Сохранение сеанса в файл .rv

get_session_info

Получение информации о сеансе в формате JSON (узел просмотра, диапазон кадров, количество источников)

Сравнение (4)

Инструмент

Описание

set_view_mode

Переключение вида: sequence (воспроизведение по порядку), stack (слои для сравнения), layout (плитка рядом)

set_composite_type

Установка режима композитинга стека: over, add, difference, -difference, replace, topmost

toggle_wipe

Переключение сравнения A/B (автоматически переключается в режим стека)

get_view_info

Получение текущего состояния вида в формате JSON

Цвет (12)

Инструмент

Описание

set_lut

Загрузка файла LUT (.3dl, .csp, .cube и т. д.) на цель (look, linearize, display)

clear_lut

Деактивация LUT на цели

set_cdl

Установка значений CDL (наклон, смещение, степень, насыщенность) — поддерживаются частичные обновления

clear_cdl

Деактивация цветокоррекции CDL

set_exposure

Установка экспозиции (поканально или равномерно)

set_gamma

Установка гамма-коррекции

set_saturation

Установка насыщенности

get_color_settings

Получение текущего состояния цветокоррекции в формате JSON

set_display_gamma

Установка гаммы дисплея (например, 2.2 для sRGB-подобных)

set_display_srgb

Включение/выключение преобразования дисплея sRGB

set_background

Установка фона окна просмотра: black, checker, grey18, grey50, crosshatch

Примеры использования

Загрузка и просмотр отснятого материала

"Load the EXR sequence at /shots/sh010/comp/sh010_comp.1-100#.exr"
"Play it back at 24fps"
"Go to frame 50"
"Set in point at 20 and out point at 80"

Сравнение двух версий

"Load both /shots/sh010/comp_v1.mov and /shots/sh010/comp_v2.mov"
"Switch to stack view"
"Set composite to difference mode"
"Toggle the wipe to compare side by side"

Цветокоррекция

"Apply CDL with slope [1.1, 0.95, 1.0] and saturation 1.2"
"Load the ACES LUT from /luts/sRGB.cube"
"Set exposure to 0.5"
"Show me the current color settings"

Продвинутый уровень (сырой Mu)

"Execute this Mu code: { require commands; let s = sources(); string(s.size()); }"

Структура проекта

RV_MCP/
├── pyproject.toml          # Package config, entry point, dependencies
├── README.md
├── .gitignore
└── src/
    ├── __init__.py
    ├── server.py           # FastMCP server + RvClient instantiation
    ├── rv_client.py        # Persistent TCP client (RV network protocol)
    └── tools/
        ├── __init__.py
        ├── execute.py      # execute_mu — raw Mu escape hatch
        ├── playback.py     # 17 playback/transport tools
        ├── sources.py      # 7 source & session tools
        ├── compare.py      # 4 view/compare tools
        ├── color.py        # 12 color/LUT/CDL tools
        └── ocio.py         # OCIO v2 color management tools

Устранение неполадок

"Could not connect to RV"

  • Убедитесь, что RV запущен с флагом -network

  • Проверьте, что порт 45124 не заблокирован брандмауэром

  • Используйте -networkPort 45124 для явного указания порта

RV отклоняет соединения после сбоя

Если сервер завершает работу без отправки DISCONNECT, RV может отклонять новые соединения. Перезапустите RV, чтобы очистить состояние. Сервер включает обработчик atexit, чтобы предотвратить это при нормальной работе.

Ошибки кода Mu

  • Всегда заключайте блоки кода в { require commands; ... }

  • Mu вычисляет обе ветки if/then/else — избегайте доступа к свойствам узлов, которые могут не существовать

  • Пути к файлам должны использовать прямые слэши; escape_mu_string() обрабатывает это автоматически

Ошибки тайм-аута

Тайм-аут по умолчанию составляет 30 секунд. Если код Mu выполняется дольше (например, при загрузке больших последовательностей), может возникнуть тайм-аут. Используйте execute_mu для длительных операций и рассмотрите возможность разбиения их на более мелкие шаги.

Разработка

# Install dependencies
uv sync

# Run the server directly
uv run rv-mcp

# Run with debug logging
uv run python -m src.server

Лицензия

MIT

Available Tools

47 tools
clear_cdlA

Deactivate CDL color correction.

Inputs: no named parameters. Returns: result

clear_lutA

Deactivate the LUT on a target.

Args: target: Which LUT to clear: "look", "linearize", or "display".

Inputs: target. Returns: result

clear_ocioA

Remove OCIO nodes and restore default RV pipeline.

Args: target: What to clear — "linearize", "display", "look", or "all".

Inputs: target. Returns: result

clear_sessionA

Clear all sources from the current session.

Inputs: no named parameters. Returns: result

execute_muA

Execute arbitrary Mu code in RV and return the result.

The code is evaluated via remote-eval. Use 'require commands;' at the start if you need commands functions like play(), stop(), etc.

Examples: execute_mu("{ require commands; string(frame()); }") execute_mu("{ require commands; play(); "playing"; }") execute_mu("{ require commands; sources(); }")

Inputs: code (required). Returns: result

get_color_settingsA

Get current color correction settings as JSON.

Requires at least one source loaded in the session.

Inputs: no named parameters. Returns: result

get_fpsA

Get the current playback FPS.

Inputs: no named parameters. Returns: result

get_frameA

Get the current frame number in RV.

Inputs: no named parameters. Returns: result

get_frame_rangeA

Get the full frame range and current state as JSON.

Returns JSON with: frame, frameStart, frameEnd, inPoint, outPoint, playing, fps.

Inputs: no named parameters. Returns: result

get_in_out_pointsA

Get the current in/out points as JSON.

Inputs: no named parameters. Returns: result

get_ocio_configA

Get OCIO config information as JSON.

Returns color spaces, displays, views, and looks from the active OCIO config (or a specific config file).

Args: config_path: Optional path to an OCIO config file. If omitted, uses the $OCIO environment variable.

Inputs: config_path. Returns: result

get_ocio_stateA

Get current OCIO state for all sources and display as JSON.

Returns which sources have OCIO nodes and their settings.

Inputs: no named parameters. Returns: result

get_session_infoB

Get current session information as JSON.

Returns: viewNode, frame, frameStart, frameEnd, sourceCount.

Inputs: no named parameters. Returns: result

get_source_media_infoB

Get detailed media info for a source node.

Args: source_node: The source node name (e.g. "sourceGroup000000").

Inputs: source_node (required). Returns: result

get_sourcesB

List all sources currently loaded in RV as JSON.

Returns a JSON array with source node names.

Inputs: no named parameters. Returns: result

get_sources_at_frameA

Get source nodes visible at a specific frame.

Args: frame: Frame number to query (-1 for current frame).

Inputs: frame. Returns: result

get_view_infoA

Get current view state as JSON.

Returns: viewNode, viewType, and wipe state.

Inputs: no named parameters. Returns: result

load_sourceA

Load a media file (image sequence, movie, or single image) into RV.

Args: file_path: Path to the media file. For sequences use RV notation e.g. "/path/to/image.1-100#.exr" or just the path to one frame.

Inputs: file_path (required). Returns: result

load_sourcesA

Load multiple media files into RV at once.

Args: file_paths: List of paths to media files.

Inputs: file_paths (required). Returns: result

new_sessionA

Create a new empty session, clearing all current sources.

Inputs: no named parameters. Returns: result

playB

Start playback in RV.

Inputs: no named parameters. Returns: result

save_sessionC

Save the current session to an .rv file.

Args: file_path: Path for the .rv session file.

Inputs: file_path (required). Returns: result

set_backgroundB

Set the viewport background.

Args: method: One of "black", "checker", "grey18", "grey50", "crosshatch".

Inputs: method. Returns: result

set_cdlB

Set CDL (Color Decision List) values.

All parameters are optional — only provided values are changed.

Args: slope: RGB slope values [r, g, b]. offset: RGB offset values [r, g, b]. power: RGB power values [r, g, b]. saturation: Global saturation value.

Inputs: slope, offset, power, saturation. Returns: result

set_composite_typeA

Set the compositing mode when in stack view.

Automatically switches to stack view if not already in it.

Args: composite_type: One of "over", "add", "difference", "-difference", "replace", "topmost".

Inputs: composite_type. Returns: result

set_display_gammaB

Set display gamma.

Args: gamma: Display gamma value (e.g. 2.2 for sRGB-like).

Inputs: gamma (required). Returns: result

set_display_srgbA

Enable or disable sRGB display transform.

Args: enabled: True to enable sRGB, False to disable.

Inputs: enabled. Returns: result

set_exposureB

Set exposure adjustment.

Args: value: Exposure value (0.0 = no change). channel: "all" for uniform, or "r", "g", "b" for per-channel.

Inputs: value (required), channel. Returns: result

set_fpsC

Set the playback frames per second.

Args: fps: Target FPS value.

Inputs: fps (required). Returns: result

set_frameB

Go to a specific frame in RV.

Args: frame: The frame number to jump to.

Inputs: frame (required). Returns: result

set_gammaB

Set gamma correction.

Args: value: Gamma value (1.0 = no change).

Inputs: value (required). Returns: result

set_in_pointB

Set the in-point (start of playback range).

Args: frame: Frame number for the in-point.

Inputs: frame (required). Returns: result

set_lutA

Load a LUT file and activate it.

Args: lut_file_path: Path to the LUT file (.3dl, .csp, .cube, etc.). target: Where to apply: "look" (color pipeline), "linearize" (input linearization), "display" (display transform).

Inputs: lut_file_path (required), target. Returns: result

set_ocio_colorspaceA

Set the OCIO input color space for a source.

Inserts an OCIOFile node into the source's linearize pipeline, converting from the specified color space to scene-linear.

Args: colorspace: Input color space name (e.g. "sRGB - Texture", "ACEScg"). source_node: Source group name (e.g. "sourceGroup000000"). If omitted, uses the first source.

Inputs: colorspace (required), source_node. Returns: result

set_ocio_displayB

Set the OCIO display transform.

Inserts an OCIODisplay node into the display pipeline.

Args: display: Display name (e.g. "sRGB - Display"). view: View name (e.g. "ACES 1.0 - SDR Video").

Inputs: display (required), view (required). Returns: result

set_ocio_lookA

Apply an OCIO look to a source.

Inserts an OCIOLook node into the source's look pipeline.

Args: look: Look name from the OCIO config. direction: "forward" or "inverse". source_node: Source group name. If omitted, uses the first source.

Inputs: look (required), direction, source_node. Returns: result

set_out_pointB

Set the out-point (end of playback range).

Args: frame: Frame number for the out-point.

Inputs: frame (required). Returns: result

set_playback_speedA

Set the playback increment (direction and speed).

Args: direction: Positive for forward, negative for reverse. 1 = normal forward, -1 = normal reverse, 2 = 2x forward, etc.

Inputs: direction. Returns: result

set_play_modeA

Set the playback loop mode.

Args: mode: One of "loop", "once", or "pingpong".

Inputs: mode. Returns: result

set_realtimeA

Enable or disable realtime playback mode.

When enabled, RV will skip frames to maintain the target FPS.

Args: enabled: True to enable realtime, False to play every frame.

Inputs: enabled. Returns: result

set_saturationB

Set saturation.

Args: value: Saturation value (1.0 = normal, 0.0 = desaturated).

Inputs: value (required). Returns: result

set_view_modeA

Switch RV's view mode.

Args: mode: One of "sequence" (play sources in order), "stack" (layer sources for comparison), "layout" (tile sources side by side).

Inputs: mode (required). Returns: result

step_backwardB

Step backward by N frames.

Args: count: Number of frames to step backward (default 1).

Inputs: count. Returns: result

step_forwardA

Step forward by N frames.

Args: count: Number of frames to step forward (default 1).

Inputs: count. Returns: result

stopA

Stop playback in RV.

Inputs: no named parameters. Returns: result

toggle_playbackA

Toggle play/stop in RV. Returns the new state.

Inputs: no named parameters. Returns: result

toggle_wipeA

Toggle wipe mode on/off for A/B comparison in stack view.

Automatically switches to stack view first.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 47 tools

    Disambiguation4/5

    Most tools have distinct purposes, with clear descriptions differentiating them. There is some potential confusion between similar 'clear' tools and frame-info tools, but overall an agent can distinguish well.

    Naming Consistency3/5

    Naming uses underscores consistently but verb style varies (clear_, get_, set_, load_, play, stop, toggle). The pattern is not strictly verb_noun throughout, e.g., 'execute_mu' and 'new_session' deviate. Still readable.

    Tool Count2/5

    With 47 tools, the server is quite heavy. While the domain (media playback and color correction) can justify many tools, this count feels excessive and could be streamlined.

    Completeness4/5

    The tool set covers most aspects of RV control: session management, source loading, playback, frame navigation, color correction (CDL, LUT, OCIO), display settings, and view modes. A notable gap is the lack of a tool to remove individual sources.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers