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 分

    请在仓库或注册中心条目中声明许可证。