FFmpeg-MCP Server
FFmpeg-MCP
利用ffmpeg命令行实现一个mcp服务器,可以很方便的,通过对话方式实现本地视频的搜索、裁剪、拼接、播放等功能
支持工具
该服务器实现了以下工具:
find_video_path参数为目录和文件名,文件名可以是完整的,也可以不带后缀,在目录中递归搜索,返回完整路径get_video_info参数为视频路径,返回视频信息,包括时长/fps/codec/宽度/高度。clip_video参数为文件路径、开始时间、结束时间或时长,返回修剪后的文件路径concat_videos参数为文件列表、输出路径,如果文件列表中的视频元素,如宽、高、帧率等一致,则自动使用快速模式合成play_video使用ffplay播放视频/音频,支持多种格式,如mov/mp4/avi/mkv/3gp,video_path:视频路径 speed:播放速率 loop:播放次数overlay_video两个视频叠加。 background_video:背景视频路径 overlay_video:前置视频路径 output_path:输出视频路径 location:相对位置 dx:x 偏移 dy:y 偏移scale_video视频比例。video_path:输入视频路径宽度:输出视频宽度,-2 保持宽高高度:输出视频高度,-2 保持宽高输出_path:输出视频路径
更多功能即将推出
Related MCP server: mcp-video
安装过程
下载项目
git clone https://github.com/video-creator/ffmpeg-mcp.git
cd ffmpeg-mcp
uv syncCline 中的配置
{
"mcpServers": {
"ffmpeg-mcp": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"command": "uv",
"args": [
"--directory",
"/Users/xxx/Downloads/ffmpeg-mcp",
"run",
"ffmpeg-mcp"
],
"transportType": "stdio"
}
}
}注意:args中的值: /Users/XXX/Downloads/ffmpeg需要替换为实际下载的ffmpeg-mcp目录
支持的平台
目前仅支持macos平台,包括ARM64或x86_64
Available Tools
8 toolsclip_videoB
智能视频剪辑函数
参数:
video_path : str - 源视频文件路径
start : int/float/str - 开始时间(支持秒数、MM:SS、HH:MM:SS格式,默认为视频开头,如果不传该参数,或者该参数为负数,从视频结尾往前剪辑)
end : int/float/str - 结束时间(同上,默认为视频结尾)
duration: int/float/str - 裁剪时长,end和duration必须有一个
output_path: str - 裁剪后视频输出路径,如果不传入,会有一个默认的输出路径
time_out: int - 命令行执行超时时间,默认为300s
返回:
error - 错误码
str - ffmpeg执行过程中所有日志
str - 生成的剪辑文件路径
示例:
clip_video("input.mp4", "00:01:30", "02:30")
Inputs: video_path (required), duration, end, output_path, +2 more.
concat_videosA
使用FFmpeg拼接多个视频文件
参数:
input_files (List[str]): 输入视频文件路径列表
output_path (str): 合并后的输出文件路径,如果不传入,会一个默认的输出路径
fast (bool): 拼接方法,可选值:"True"(默认,要求所有视频必须具有相同的编码格式、分辨率、帧率等参数)| "False(当不确定合并的视频编码格式、分辨率、帧率等参数是否相同的情况下,这个参数应该是False)"
返回:
执行日志
注意:
1. 当fast=True时,要求所有视频必须具有相同的编码格式、分辨率、帧率等参数
2. 推荐视频文件使用相同编码参数,避免拼接失败
3. 输出文件格式由output_path后缀决定(如.mp4/.mkv)
Inputs: input_files (required), fast, output_path.
extract_frames_from_videoB
提取视频中的图像。
参数:
video_path(str) - 视频路径。
fps(int) - 每多少秒抽一帧,如果传0,代表全部都抽,传1,代表每一秒抽1帧。
output_folder(str) - 把图片输出到哪个目录
format(int) - 抽取的图片格式,0:代表png 1:jpg 2:webp
total_frames(int) - 最多抽取多少张,0代表不限制
Inputs: video_path (required), format, fps, output_folder, +1 more.
find_video_pathB
可以查找视频文件路径,查找文件路径,递归查找精确匹配文件名的视频文件路径(支持带或不带扩展名)
参数:
root_path - 要搜索的根目录
video_name - 视频文件名(可以带扩展名,但会忽略扩展名匹配)
返回:
首个匹配的视频文件完整路径,找不到时返回空字符串
Inputs: root_path (required), video_name (required).
get_video_infoC
获取视频信息,包括时长,帧率,codec等
参数:
video_path (str): 输入视频文件路径
返回:
视频详细信息
Inputs: video_path (required).
overlay_videoB
两个视频叠加,注意不是拼接长度,而是画中画效果
参数:
background_video(str) - 背景视频文件的路径。
overlay_video(str) - 前景视频文件路径。
output_path(str) - 输出路径
position(enum) - 相对位置,TopLeft=1: 左上角,TopCenter=2: 上居中, TopRight=3: 右上角 RightCenter=4: 右居中 BottomRight=5: 右下角 BottomCenter=6: 下居中 BottomLeft=7: 左下角 LeftCenter=8: 左居中 Center=9: 居中
dx(int) - 整形,前景视频坐标x偏移值
dy(int) - 整形,前景视频坐标y偏移值
Inputs: background_video (required), overlay_video (required), dx, dy, +2 more.
play_videoB
使用 ffplay 播放视频文件,支持mkv,mp4,mov,avi,3gp等等
参数:
video_path(str) - 视频文件的路径。
speed(float) - 浮点型,播放速率,建议0.5-2之间。
loop(int) - 整形,是否循环播放,1:不循环,播放后就退出,0: 循环播放。
Inputs: video_path (required), loop, speed.
scale_videoC
视频缩放
参数:
width(int) - 目标宽度。
height(int) - 目标高度。
output_path(str) - 输出路径
Inputs: height (required), video_path (required), width (required), output_path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools have distinct purposes (clipping, concatenating, extracting frames, finding files, getting info, overlaying, playing, scaling), but 'clip_video' and 'scale_video' could be confused as both modify video dimensions, though 'clip_video' focuses on time-based trimming while 'scale_video' adjusts resolution. The descriptions clarify this difference, but some overlap exists in the general 'video modification' category.
The naming follows a consistent verb_noun pattern (e.g., clip_video, concat_videos, extract_frames_from_video), with all tools using snake_case. However, 'find_video_path' slightly deviates by including 'path' in the noun, while others use more generic terms like 'video' or 'frames', but this is minor and doesn't break readability.
With 8 tools, the count is well-scoped for an FFmpeg server, covering core video processing tasks like editing, merging, extracting, overlaying, scaling, and playback. Each tool serves a clear function without redundancy, making it a manageable and comprehensive set for typical video manipulation workflows.
The toolset covers essential FFmpeg operations including trimming, merging, frame extraction, file finding, info retrieval, overlaying, playback, and scaling. Minor gaps exist, such as no direct tools for audio extraction or format conversion, but these can be worked around with existing tools (e.g., using clip_video or overlay_video creatively). The core video editing lifecycle is well-represented.
Maintenance
Related MCP Connectors
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
Hosted MCP tools for FFmpeg-style video and audio processing through FFMPEG API.
FFmpeg processing for video, audio and images via MCP with OAuth and shared account allowance.
MCP server for Wan AI video generation
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server for programmatic video editing using ffmpeg, enabling draft creation and refinement via natural language.-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables LLMs to analyze video content by extracting frames as base64 images and retrieving video metadata using ffmpeg.5 npmMIT
- AlicenseAqualityDmaintenanceEnables LLMs to perform FFmpeg operations like clipping, merging, extracting audio, adding subtitles, and transcoding videos via a set of tools exposed as an MCP server.58MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables natural language video editing using FFmpeg, supporting operations like trimming, merging, format conversion, and more with real-time progress tracking.-