Control Vivi from AI agents
vivi-mcp is a tiny Model Context Protocol server: ask Claude, Cursor
or any MCP client to play, search, queue, subtitle, bookmark, loop and inspect media in a running Vivi.
Example prompts
Things you can just say to your agent once vivi-mcp is connected. Click any prompt to copy it.
Hover to pause · the grey label is the tool the agent will call
Set up in two minutes
Enable remote control
Off by default. Turn on Settings → Controls → Remotes → Allow AI agents and scripts (General → Remote control before 0.15); since 0.16 it applies at once, before that restart Vivi. Or run VIVI_IPC=1 vivi once.
Get vivi-mcp
It ships with Vivi: Arch installs /usr/bin/vivi-mcp, Flatpak /app/bin/vivi-mcp, cargo build --release gives target/release/vivi-mcp.
Add it to your client
Use Add to Cursor or Add to VS Code above, or in Vivi Settings → Controls → Remotes → Connect to…. Or paste the config below and restart the client. vivi-mcp --help prints the socket path it uses.
Add it to your client
Every client runs the same command: /usr/bin/vivi-mcp (or the path from which vivi-mcp / target/release/vivi-mcp). GUI apps often have a minimal PATH, so an absolute path is safest.
~/.config/Claude/claude_desktop_config.json{
"mcpServers": {
"vivi": { "command": "/usr/bin/vivi-mcp" }
}
}Restart Claude Desktop; the vivi tools appear in the tools menu. Windows is not supported yet (Vivi's control socket is a Unix socket).
~/.cursor/mcp.json (global, Linux and macOS) or .cursor/mcp.json in a project
{
"mcpServers": {
"vivi": { "command": "/usr/bin/vivi-mcp" }
}
}One command, available in every session (add --scope project to share it via .mcp.json):
claude mcp add vivi -- /usr/bin/vivi-mcp.vscode/mcp.json in your workspace, or the user profile mcp.json
{
"servers": {
"vivi": { "type": "stdio", "command": "/usr/bin/vivi-mcp" }
}
}Windsurf, Zed, Continue, Cline, … any client that launches stdio servers works with the same command. If it does not inherit XDG_RUNTIME_DIR, pass the socket explicitly:
{
"mcpServers": {
"vivi": {
"command": "/usr/bin/vivi-mcp",
"env": { "VIVI_SOCKET": "/run/user/1000/vivi.sock" }
}
}
}Flatpak: run it through the sandbox instead:
{
"mcpServers": {
"vivi": {
"command": "flatpak",
"args": ["run", "--command=vivi-mcp", "io.github.loafer19.vivi"]
}
}
}How it works
A separate small binary that speaks MCP over stdio and forwards tool calls to Vivi through a private local socket. It depends on nothing but std and serde_json; there is no network listener and nothing leaves your machine.
JSON-RPC
JSON lines
Tools
Resources vivi://status and vivi://playlist (JSON) are also exposed. So are vivi://recent, vivi://lyrics and vivi://plugin-commands, with change notifications for all of them; there are also prompts (play_radio, fix_subtitles, …), tool annotations so clients ask before destructive calls, argument checks, pagination, and MCP 2026-07-28 next to the handshake versions.
| Tool | Arguments | What it does |
|---|---|---|
| Playback 10 | ||
get_status | – | Now playing: title, artist, album, path, position, duration, volume, mute, speed, playing, subtitles, tracks, queue position, chapter, repeat, shuffle, EQ preset |
play, pause, toggle_pause, stop | – | Transport (stop pauses and rewinds) |
seek | position or offset (s) | Absolute or relative seek |
set_volume | level, muted | Volume in % and/or mute |
set_speed | speed (0.1–4) | Playback speed |
set_repeat | mode (off/one/all) | Repeat the item or the whole queue |
set_shuffle | enabled | Shuffle the queue or restore its order |
| Find & open 5 | ||
open | target | Play a file path or URL now, replacing the queue (yt-dlp sites work when yt-dlp is installed) |
search_library | query, kind, limit | Words matched in title/artist/album/genre/path of the scanned library |
list_recent | query, kind | The Recent list from Home: files, folders, playlists, streams, radio, web video, Free Music |
open_network_stream | target, name, queue | Play (or queue) a stream URL: Internet radio, IPTV .m3u8/HLS, DASH, RTMP/RTSP/UDP, Icecast. name is shown while it loads |
search_streams | query, kind (radio/tv), limit | Search radio-browser.info, SomaFM, iptv-org TV, your Network Streams favorites and playlists; each item has a kind (radio / tv) and a url for open_network_stream |
| Queue & playlists 11 | ||
playlist_list | – | Queue entries with index, title and current flag |
playlist_add | target | Append to the queue |
playlist_play | index | Jump to a queue entry |
next, previous | – | Queue navigation |
playlist_move | from, to | Reorder the queue |
playlist_remove, playlist_clear | index / keep_current | Remove one entry or empty the queue (marked destructive, so clients ask first) |
list_saved_playlists, open_saved_playlist | name, queue | Saved playlists from Library → Playlists: list, play or append |
save_queue_as_playlist | name, overwrite | Save the queue as a playlist |
| Tracks & chapters 7 | ||
set_subtitles | enabled | Show/hide subtitles |
list_audio_tracks | – | Audio tracks: id, title (with language), selected |
set_audio_track | id (integer, auto or no) | Switch the audio track |
list_subtitle_tracks | – | Subtitle tracks (embedded and external) |
set_subtitle_track | id (integer, auto or no) | Switch subtitles; no turns them off |
get_chapters | – | current index and chapters (index, title, start s) |
seek_chapter | index or offset (+1/-1) | Jump to a chapter |
| Subtitles online 4 | ||
search_subtitles | query, languages, limit | OpenSubtitles results for the playing file: hash matches first, then by name or IMDb id (tt…); returns file_id, language, downloads, rating. Needs the API key in the Subtitle Search plugin |
load_subtitle | file_id, language | Download (one from the daily quota; cached copies are free) and show it; remembered for the file |
set_subtitle_offset | seconds / delta / reset | Subtitle timing (positive = later), saved per file |
sync_subtitles | – | Align subtitles to the audio (Subtitle Auto-Sync plugin) |
| Bookmarks & A-B loop 7 | ||
list_bookmarks | – | Bookmarks of the playing file by time: time (s), label, note, saved frame, created; 0-based indexes |
add_bookmark | label, note | Bookmark the playing position, like Ctrl B; added is false when one exists within half a second |
remove_bookmark | index | Delete a bookmark and its saved frame (marked destructive, so clients ask first) |
jump_to_bookmark | index | Seek to a bookmark |
export_bookmarks_as_chapters | to (player/file), path | Add the bookmarks to the chapter list until the file closes, or write an FFmpeg metadata chapters file (default <video>.ffmetadata) for mpv --chapters-file or ffmpeg -map_metadata |
get_ab_loop | – | Points a and b in seconds (null = unset) and whether the loop is active |
set_ab_loop | set (a/b) or a, b (s) or clear | Set a point at the playhead, give times (null clears one) or clear the loop; the seek bar, side panel and top-bar chip follow |
| Sleep timer 3 | ||
get_sleep_timer | – | Mode (off, min:<n>, eof, chapter, items:<n>), time or items left and the fade-out length |
set_sleep_timer | minutes (1–1440) or timer | Pause later: after some minutes, at the end of the file or chapter, or after n queue items; the volume fades out first |
cancel_sleep_timer | – | Turn the timer off (the volume comes back if it was fading) |
| Audio, lyrics & screenshots 7 | ||
list_eq_presets | – | Built-in and custom EQ presets, current one |
set_eq_preset | name | Select a preset, or Off to disable the equalizer |
get_lyrics | – | Lines shown by the Lyrics plugin, synced, current_line, source, offset_seconds, karaoke |
set_lyrics_offset | seconds / delta / reset | Synced-lyrics timing (±30 s), saved per track |
set_karaoke | enabled | Open or close the karaoke view |
set_visualizer | mode (name, next/prev), optional style | Music Visualizer mode for music and radio without video (eight modes; Spectrum styles Bars / LED / Mountain / Dots, Radial styles Rays / Cover; old names still work); without mode or style it only reports. Returns the mode, style, the lists and whether it is showing |
screenshot | path, mode (subtitles/video/window) | Saves the current frame and returns its path and the image itself, so the agent can see the frame; save: false keeps no file |
| Plugins 4 | ||
list_plugins | – | Plugins: id, name, version, kind, enabled |
plugin_info | id | Description, author, version and setting keys/titles (no values) |
list_plugin_commands, run_plugin_command | plugin, command, target | Commands plugins add to the command palette, menus, tray and control bar, and running them |
plugin_<id>_<command> | – | Every plugin command is also a tool of its own: install a plugin and the agent gets its commands |
IPTV and radio: open also plays URLs, but open_network_stream validates the URL, can queue instead of
replacing, and shows a station name. A whole .m3u playlist URL can be passed to open (mpv expands it into the queue).
Security
Off by default. Nothing listens until you turn on Allow AI agents and scripts.
Local only. The socket is $XDG_RUNTIME_DIR/vivi.sock (fallback ~/.cache/vivi/vivi.sock,
override with VIVI_SOCKET), created with mode 0600, so only your user can connect. There is no TCP or HTTP listener.
Limited reach. Agents can control playback and read what is playing; plugin settings cannot be read or changed
(agents can run the commands plugins add to menus; clients ask first, since those tools are marked destructive). Anything an agent opens plays with your user's permissions, so keep the usual care with untrusted URLs.
Troubleshooting
- “Vivi is not running” or connection refused
- Start Vivi with Allow AI agents and scripts on (Settings → Controls → Remotes; it applies at once since 0.16, older versions need a restart) or run
VIVI_IPC=1 vivi. Only one Vivi instance owns the socket. - The client cannot find the socket
- Some clients do not inherit
XDG_RUNTIME_DIR. Pass it explicitly:"env": { "VIVI_SOCKET": "/run/user/1000/vivi.sock" }(check the path withvivi-mcp --help). - “command not found: vivi-mcp”
- Use the absolute path (
/usr/bin/vivi-mcportarget/release/vivi-mcp); GUI clients often have a minimalPATH. - Test without an AI client
npx @modelcontextprotocol/inspector vivi-mcp, or by hand:printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_status","arguments":{}}}' | vivi-mcp echo '{"cmd":"status"}' | socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/vivi.sock- search_streams is slow or empty
- It queries radio-browser.info and iptv-org over the network and can take a few seconds.
- Windows
- Not supported yet: the control socket is a Unix socket (Linux and macOS). Only the stdio transport is available.
Full reference: docs/mcp.md.