Skip to content
RAVDocumentation

MCP Integration

RAV includes a bundled native MCP (Model Context Protocol) sidecar that lets Claude Code, Claude Desktop, Codex, or any MCP client control the viewer remotely.

How it works

MCP Client <-(stdio)-> rav-mcp sidecar <-(WebSocket)-> RAV App

The sidecar starts automatically with the app. The runtime strip MCP indicator reports bridge health and turns blue for 30 seconds after an agent command arrives.

Ready — green, the bridge is healthy and available

Recent command — blue for 30 seconds after MCP activity

Connecting — yellow while the bridge starts or reconnects

Error — red after a bridge failure while retrying

Off — muted and crossed out when MCP is disabled

Setup

MCP Setup dialog showing status, client detection, and copy snippets

Open the MCP Setup dialog from the toolbar cable icon. It provides:

  • Status row — MCP ready or disabled
  • Script Access — safety gate for JS execution tools
  • MCP Port — editable bridge port with immediate snippet regeneration
  • Client detection — checks Claude Code, Claude Desktop, and Codex
  • Install actions — ADD, REINSTALL, or REMOVE based on detected state
  • Manual snippets — copy-paste configurations for any MCP client

Available Tools (56)

The bundled native sidecar advertises 56 unique tools. Root ViewModel paths use the regular rav_vm_* tools; global ViewModels use a separate global name plus property path. Eight desktop media tools expose the same export and recording service as the EXPORT menu.

ToolDescription
rav_statusApp status: file, runtime, playback, canvas sizing, ViewModel summary
rav_entitlement_statusMachine id and activation state; pass an activation key once to activate optional capabilities
rav_set_anonymous_usageEnable or disable Anonymous Usage reporting
rav_open_fileOpen a .riv file by absolute path
rav_play / rav_pause / rav_resetPlayback controls
rav_get_artboardsList artboard names
rav_get_state_machinesList state machine names
rav_switch_artboard / rav_reset_artboardSwitch artboard/playback or reset to default
rav_switch_vm_instanceSwitch the active artboard-bound ViewModel instance
rav_get_vm_treeCurrent live root ViewModel hierarchy with paths, types, values, and dynamic list bounds
rav_vm_getRead a root ViewModel property, including zero-based list paths such as rows/0/name
rav_vm_setWrite a root ViewModel property
rav_vm_set_imageSet a root ViewModel image property
rav_vm_clear_imageClear a root ViewModel image property
rav_vm_fireFire a root ViewModel trigger property
rav_get_global_vm_treeList named global ViewModels and their independent live trees
rav_global_vm_getRead a property from a named global ViewModel
rav_global_vm_setWrite a property on a named global ViewModel
rav_global_vm_set_imageSet an image property on a named global ViewModel
rav_global_vm_clear_imageClear an image property on a named global ViewModel
rav_global_vm_fireFire a trigger property on a named global ViewModel
rav_get_event_logRecent event log entries (filterable by source)
rav_get_editor_code / rav_set_editor_codeRead and write the script editor
rav_apply_codeApply editor code and reload (Script Access required)
rav_set_runtimeSwitch runtime (webgl2 or canvas)
rav_set_layoutSet layout fit mode
rav_set_alignmentSet art alignment within the canvas
rav_set_canvas_colorSet background color
rav_set_canvas_sizeSet canvas sizing mode, dimensions, and aspect lock
rav_capture_canvasCapture the currently rendered RAV canvas as PNG image content
rav_media_capabilitiesInspect verified encoders, formats, alpha support, limits, and production distribution state
rav_export_mediaStart an asynchronous whole/segment timeline export or current/timed still capture
rav_record_startStart live state-machine recording, optionally timed, with a clock: "live" | "offline" option and recording-clock interactions
rav_record_stopSeal a manual recording and begin finalization; continue polling its job
rav_media_statusRead capture, encoding, verification, warnings, resolved settings, and output details
rav_media_cancelCancel an active media job and clean that job's temporary capture
rav_step_framesAdvance and draw an exact number of frames while not recording
rav_pointerSend normalized mouse down, move, up, or exit input to the live canvas
rav_open_isolated_playbackOpen playback in an isolated surface
rav_export_demoExport standalone HTML demo (programmatic, no dialog)
rav_export_demo_visualVisibly orchestrate the export dialog (selection, package, snippet mode) and save — for screen recordings or non-default selections
generate_web_instantiation_codeGenerate canonical web snippet with helpers and control values
rav_toggle_instantiation_controls_dialogOpen/close the export controls dialog
rav_configure_workspaceSet sidebar visibility, live source mode, and VM Explorer state
rav_evalEvaluate JS in browser context (Script Access required)
rav_console_openOpen the bottom console panel, optionally setting mode, level, sources, and search
rav_console_closeClose the bottom console panel
rav_console_set_modeFlip between Event Console, JS REPL, or closed without re-opening
rav_console_set_filterDrive the on-screen filter toggles: level for JS, sources for Events, plus search on either
rav_console_clearClear the visible transcript of the active mode (or a specified mode); panel stays open
rav_console_read / rav_console_execRead console output or run REPL code (exec requires Script Access)

Media automation

Media tools are desktop-only and asynchronous. Call rav_media_capabilitiesbefore selecting a codec, then poll rav_media_status until the returned job is completed, failed, or cancelled. Omitting output_path opens the native Save dialog; unattended agents should supply an absolute path with the matching extension.

rav_record_start accepts scheduled typed ViewModel sets, trigger fires, image changes, and normalized pointer events. Operations run on the recording clock before the corresponding frame is drawn, and completion reports requested and applied times. Existing ViewModel and global-ViewModel tools can also be used interactively while a manual recording is active. Offline recording requires an explicit duration. rav_record_start also accepts clock: "live" | "offline"; offline is the default when a duration and scheduled interactions are both supplied, otherwise live.

rav_export_media and rav_record_start also accept prores (Apple ProRes 4444 in a .mov container, with or without alpha) and png-sequence / jpg-sequence (one file per frame). Sequence output_path values are directory paths. A non-empty destination is refused unless the caller explicitly sets overwrite: true; MCP does not open an overwrite prompt. H.264, H.265, JPG, and JPG sequences reject alpha requests. Sequence formats take a directory as output_path instead of a single file. See Media Export & Recording for formats, settings, GIF size controls, and recording behavior.

GLOBAL VM in RAV

When a file provides globals, the sidebar labels their collection GLOBAL VM above ROOT VM. GLOBAL VM starts collapsed, and each named global has its own independent expandable tree; opening one does not expand another.

Script Access

By default, MCP can read state and drive safe control operations. Enable Script Access in the MCP Setup dialog to unlock rav_eval,rav_console_exec, and rav_apply_code.