Mpv Mcp Server

io.github.arijit-gogoi由 GitHub 帳號 arijit-gogoi 發布v1.2.0更新於 Oct 24, 2026

Control mpv media player — playback, playlists, YouTube streaming, and downloads.

已驗證STDIO僅桌面檔案與儲存媒體與設計

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理控制 mpv 播放器:瀏覽媒體庫、管理播放清單、調整播放、串流 YouTube 並下載曲目。

可以做什麼
控制播放:依路徑或搜尋詞播放、暫停、繼續、停止、跳轉,以及取得或設定音量與播放狀態。瀏覽與管理媒體庫:列出和搜尋媒體檔案、查看目前播放清單、加入曲目、載入播放清單檔案、切換上一首或下一首。從 YouTube 串流與下載,支援附加模式和音訊或影片下載。讀取並寫入曲目中繼資料,例如演出者、標題、專輯、曲風和日期。
適用情境
適合讓助理免手動地操作桌面音樂或影片播放:排入曲目、調整音量、查看目前播放內容,或把 YouTube 音訊下載到本機媒體庫。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 22+,以及位於 PATH 或由 MPV_PATH 指定的 mpv 播放器。YouTube 工具需要 yt-dlp;音訊下載和中繼資料工具需要 ffmpeg。選用環境變數可設定 IPC 通訊端路徑、媒體目錄和下載目錄。僅在 Windows 上開發與測試,macOS 與 Linux 支援尚未測試。
安裝前請注意
伺服器可自行啟動 mpv,且播放器在伺服器結束後仍會繼續執行。YouTube 串流與下載依賴 yt-dlp,可能與平台條款衝突。標籤工具會將中繼資料寫入媒體檔案,下載會把檔案寫入設定的下載目錄。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mpv Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mpv-mcp-server

MCP server for controlling mpv media player. Browse your music library, control playback, stream from YouTube, and download tracks — all from inside an MCP client like Claude Code.

Prerequisites

  • mpv — media player (must be on your PATH, or set MPV_PATH)
  • Node.js 22+
  • yt-dlp (optional) — required for YouTube streaming and downloading
  • ffmpeg (optional) — required for audio extraction, metadata reading (ffprobe), and tagging

Quick Start

Claude Code

Add to your project's .mcp.json:

json
{  "mcpServers": {    "mpv": {      "command": "npx",      "args": ["-y", "mpv-mcp-server"]    }  }}

Or add at user scope (available in all projects):

bash
claude mcp add mpv --scope user -- npx -y mpv-mcp-server

Claude Desktop

Add to your Claude Desktop config:

json
{  "mcpServers": {    "mpv": {      "command": "npx",      "args": ["-y", "mpv-mcp-server"]    }  }}

With environment overrides

json
{  "mcpServers": {    "mpv": {      "command": "npx",      "args": ["-y", "mpv-mcp-server"],      "env": {        "MPV_PATH": "/usr/local/bin/mpv",        "MPV_MEDIA_DIRS": "/home/user/Music,/home/user/Podcasts",        "MPV_DOWNLOAD_DIR": "/home/user/Music"      }    }  }}

Configuration

All configuration is via environment variables. Everything has sensible defaults.

VariableDefaultDescription
MPV_PATHmpvPath to mpv executable
MPV_IPC_PATH\\.\pipe\mpvpipe (Windows) or /tmp/mpv-ipc.sock (Unix)IPC socket path
MPV_MEDIA_DIRS~/Music,~/VideosComma-separated media directories to scan
MPV_DOWNLOAD_DIR~/DownloadsWhere downloaded files are saved

Tools

Playback

ToolDescription
mpv_playPlay a file by path or search term
mpv_pausePause playback
mpv_resumeResume playback
mpv_stopStop playback
mpv_statusGet current playback status
mpv_seekSeek to position ("90", "1:30", "+10", "-30")
mpv_volumeGet or set volume (0-150)

Library

ToolDescription
mpv_browseList and search available media files
mpv_playlistShow current playlist
mpv_addAdd a track to the playlist
mpv_load_playlistLoad a playlist file (.m3u, .pls, .txt)
mpv_nextSkip to next track
mpv_prevGo to previous track

YouTube

ToolDescription
mpv_youtubeSearch YouTube and stream through mpv (supports append mode)
mpv_downloadDownload from YouTube (audio or video)

YouTube tools require yt-dlp on your PATH. Audio downloads also require ffmpeg.

Metadata

ToolDescription
mpv_infoGet metadata for the current track or any file by search term
mpv_tagWrite metadata tags (artist, title, album, genre, date, comment) to a file

Both tools infer artist/title from the "Artist - Title" filename pattern. Requires ffmpeg (includes ffprobe).

How It Works

The server communicates with mpv via its JSON IPC protocol. On Windows this uses a named pipe, on macOS/Linux a Unix domain socket. If mpv isn't running, the server spawns it automatically in idle mode. The mpv process is detached, so it keeps playing even if the MCP server exits.

Platform Support

Developed and tested on Windows. macOS/Linux support is implemented but untested — issues and PRs welcome!

License

MIT

來源:README.md,提交 3ca7cd7

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.2.0最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。