media-agent
Allows downloading videos from Bilibili, including extracting video info, listing formats, and downloading at specified quality.
Allows downloading videos from Facebook, including extracting video info, listing formats, and downloading at specified quality.
Allows downloading videos from Instagram, including extracting video info, listing formats, and downloading at specified quality.
Allows downloading videos from TikTok, including extracting video info, listing formats, and downloading at specified quality.
Allows downloading videos from Twitch, including extracting video info, listing formats, and downloading at specified quality.
Allows downloading videos from Vimeo, including extracting video info, listing formats, and downloading at specified quality.
Allows downloading videos from YouTube, including extracting video info, listing formats, and downloading at specified quality.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@media-agentDownload this video to D:/downloads at 720p: https://www.youtube.com/watch?v=jNQXAC9IVRw"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MEDIA-AGENT A MCP video-download agent for WorkBuddy, Cursor, and other hosts
media-agent 让 AI 智能体真正去下载视频:你在 WorkBuddy / Cursor / Claude Desktop 里丢一条链接,Agent 会先解析标题和时长,再把文件存到你指定的目录。
目录
Related MCP server: video-toolkit-mcp
它是什么
一层专门给大模型调用的 MCP / CLI 接口。人不用记一长串下载参数;Agent 只看到三个固定工具,返回 JSON。
适合 | 不适合 |
WorkBuddy / Cursor 里说「把这个视频存到 D 盘」 | 网页版通义千问直接挂本地工具 |
命令行解析、下载单条链接 | 整份播放列表、整频道扒取 |
B站 / 抖音 / YouTube / 小红书等公开视频 | 会员、DRM、付费课破解 |
安装
Release 包
到 Releases 下载最新 wheel:
pip install media_agent-0.1.3-py3-none-any.whl
pip install mcp从源码
git clone https://github.com/leohux/media-agent.git
cd media-agent
pip install -e ".[default,agent]"自检:
python -m media_agent --help
python -m media_agent extract "https://www.youtube.com/watch?v=jNQXAC9IVRw"ok 为 true 即解析成功。
依赖
Python ≥ 3.10
建议安装 ffmpeg(合并音视频 / 抽音频)。没装也能下,会自动改用单文件格式
给 Agent 用:
pip install mcp
接到 AI 工具(MCP)
本项目是 MCP stdio 服务。谁能配自定义 MCP,谁就能用。完整示例见 mcp.example.json。
把 python 换成你机器上的解释器路径。
{
"mcpServers": {
"media-agent": {
"command": "python",
"args": ["-m", "media_agent"],
"env": {
"MEDIA_AGENT_OUTPUT_DIR": "D:/downloads",
"MEDIA_AGENT_ALLOWED_ROOT": "D:/downloads",
"MEDIA_AGENT_COOKIES_FROM_BROWSER": "chrome"
}
}
}
}WorkBuddy / Cursor / Claude
产品 | 配置位置 |
WorkBuddy |
|
Cursor | MCP 设置页,或 |
Claude Desktop |
|
配好后直接说:
解析这个视频,确认标题后再下到 D:/downloads,清晰度 720p。 https://www.bilibili.com/video/BV...
千问
能:把千问放进 WorkBuddy / Qwen-Agent 当模型
不能:通义千问网页版、阿里云百炼远程 SSE(本项目是本地 stdio)
三个工具
Agent 只能调这三项,不会直接拼下载命令。
工具 | 作用 | 何时用 |
| 只解析,不下文件 | 先确认标题、时长、UP 主 |
| 列出清晰度 | 用户指定了 720p / 只下音频 |
| 下载一条视频 | 用户明确要保存文件 |
三个工具都接受 cookies_from_browser / cookiefile。抖音等站点通常需要先在浏览器打开过该页。
download_video 参数
参数 | 说明 |
| 必须是 |
| 保存目录,可省略 |
|
|
|
|
| 从浏览器读 cookie,如 |
| Netscape 格式 cookie 文件路径 |
解析成功时大致返回:
{
"ok": true,
"error": null,
"id": "jNQXAC9IVRw",
"title": "Me at the zoo",
"duration": 19,
"uploader": "jawed",
"webpage_url": "https://www.youtube.com/watch?v=jNQXAC9IVRw",
"ext": "mp4",
"extractor": "Youtube"
}失败则 ok 为 false,原因在 error 里。
命令行
python -m media_agent extract "https://www.bilibili.com/video/BVxxxx"
python -m media_agent formats "https://www.youtube.com/watch?v=..."
python -m media_agent download "https://www.youtube.com/watch?v=..." --output-dir D:/downloads --quality 720p
python -m media_agent download "https://..." --output-dir D:/downloads --audio-only
python -m media_agent extract --cookies-from-browser chrome "https://www.douyin.com/video/..."
python -m media_agent # 启动 MCP,给 Agent 用支持哪些网站
与上游内核相同,约一千多个提取器。常见:
国内:B站、抖音、小红书、微博、优酷、爱奇艺、腾讯视频、芒果 TV、西瓜视频、AcFun、央视网、网易云、QQ 音乐
国外:YouTube、TikTok、Twitter/X、Instagram、Facebook、Twitch、Vimeo
完整名单:supportedsites.md
网站改版后个别站点可能失效。快手没有独立提取器。会员内容经常下不了。
安全限制
限制 | 行为 |
协议 | 只接受 |
播放列表 | 拒绝,请传单条视频链接 |
目录 |
|
覆盖 | 默认不覆盖已有文件 |
环境变量 | 作用 |
| 默认保存目录 |
| 路径白名单根目录 |
| 默认从哪个浏览器读 cookie( |
| Netscape cookie 文件路径 |
常见问题
WorkBuddy 配了但不调用?
确认 command 能执行 python -m media_agent --help,并且已安装 mcp。
解析成功,YouTube 下载 403?
站点风控常见。可换其他平台或直链,或加上 --cookies-from-browser chrome(需已在该浏览器登录)。
抖音提示 Fresh cookies are needed?
先在 Chrome / Edge 打开过该视频页,再传 --cookies-from-browser chrome 或 edge。浏览器开着时 Windows 上有时读不到 cookie,可先关掉浏览器再试。也可导出 Netscape cookie 文件后用 --cookies 路径。
提示要 ffmpeg?
没装也会下(单文件格式)。要高清画质+音轨合并,请安装 ffmpeg。
能下播放列表吗?
不能。打开列表里的单集再传链接。
和 yt-dlp 什么关系?
内核在 yt_dlp/,产品名是 media-agent。不要对这个仓库跑上游自动更新。
开发
media_agent/ 对外入口:python -m media_agent
yt_dlp/agent/ 三个工具 + MCP 服务
yt_dlp/ 下载内核
test/test_agent_tools.py
mcp.example.json
docs/banner.svg
docs/hero.png
docs/architecture.pngpython -m unittest test.test_agent_tools -vAgent / MCP / 文档问题请在 本仓库 开 Issue。网站解析坏了请到 yt-dlp/yt-dlp。
致谢与许可
下载能力来自 yt-dlp/yt-dlp,与官方无隶属关系。详见 NOTICE。
许可证:Unlicense
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Hailuo (MiniMax) AI video generation
MCP server for Wan AI video generation
An MCP server that gives any LLM or agent clean YouTube transcripts on demand: a single video, a whole channel, or a playlist, plus AI cleanup of auto-generated captions. API-key auth, credit-based, same backend as the public v1 API. Get a free API key with 25 free credits at youtubetranscriptdownload.com/account.
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
Related MCP Servers
- -licenseAqualityNot gradedmaintenanceEnables downloading videos from 1000+ platforms including YouTube, Bilibili, TikTok, and Twitter using yt-dlp. Supports both MCP protocol and REST API modes with real-time progress tracking, multiple formats, and subtitle downloads.5141-
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server that provides comprehensive video tools: transcript retrieval, video downloading, and automatic subtitle generation using AI speech-to-text. Works with YouTube, Bilibili, Vimeo, and any platform supported by yt-dlp.11MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for downloading videos and audio from YouTube and hundreds of other sites using yt-dlp.MIT
- FlicenseNot gradedqualityBmaintenanceMCP server enabling AI agents to generate AI videos and images, analyze video content, and download videos from Douyin and Xiaohongshu.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/leohux/media-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server