KV

kush36agrawal/video_editor_mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

51 stars 13 forks 质量 53 趋势 13

kush36agrawal/video_editor_mcp 是一个从 https://github.com/kush36agrawal/video_editor_mcp. 导入的 MCP 服务器候选

概览

kush36agrawal/video_editor_mcp 是一个从 https://github.com/kush36agrawal/video_editor_mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

一个强大的视频编辑MCP服务器,利用FFmpeg通过自然语言命令执行视频编辑操作。

组成部分

工具

服务器实现了一个主要工具:

  • execute_ffmpeg:执行带有进度跟踪的FFmpeg命令
  • 输入命令字符串
  • 验证并执行FFmpeg操作
  • 报告处理过程中的实时进展
  • 处理错误并提供详细反馈
  • 支持所有FFmpeg操作,包括:
  • 修剪/切割
  • 视频合并
  • 格式转换
  • 调整速度
  • 添加音频轨道
  • 提取音频
  • 添加字幕
  • 基本滤镜(亮度、对比度等)

配置

先决条件

  1. FFmpeg 必须安装并访问在您的系统 PATH 中
  2. Python 3.9或更高版本
  3. 必备的 Python 包:

安装

  1. 如果还没安装FFmpeg,请安装:

  2. 安装视频编辑器包:

Claude桌面集成

在你的Claude Desktop配置文件中配置:

在 MacOS 上:~/Library/Application Support/Claude/claude_desktop_config.json Windows版:%APPDATA%/Claude/claude_desktop_config.json

发展

建设与出版

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Video Editor MCP Server

A powerful video editing MCP server that leverages FFmpeg to perform video editing operations through natural language commands.

Components

Tools

The server implements one main tool:

  • execute_ffmpeg: Executes FFmpeg commands with progress tracking
    • Takes a command string as input
    • Validates and executes FFmpeg operations
    • Reports real-time progress during processing
    • Handles errors and provides detailed feedback
    • Supports all FFmpeg operations including:
      • Trimming/cutting
      • Merging videos
      • Converting formats
      • Adjusting speed
      • Adding audio tracks
      • Extracting audio
      • Adding subtitles
      • Basic filters (brightness, contrast, etc.)

Configuration

Prerequisites

  1. FFmpeg must be installed and accessible in your system PATH
  2. Python 3.9 or higher
  3. Required Python packages:
    mcp
    httpx
    

Installation

  1. Install FFmpeg if not already installed:

    # On macOS with Homebrew
    brew install ffmpeg
    
    # On Windows with Chocolatey
    choco install ffmpeg
    
    # On Ubuntu/Debian
    sudo apt install ffmpeg
    
  2. Install the video editor package:

    uv add video-editor
    

Claude Desktop Integration

Configure in your Claude Desktop config file:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "video-editor": {
      "command": "uv",
      "args": ["run", "video-editor"]
    }
  }
}

Development

Building and Publishing

  1. Sync dependencies:

    uv sync
    
  2. Build package:

    uv build
    
  3. Publish to PyPI:

    uv publish
    

Note: Set PyPI credentials via:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

For the best debugging experience, use the MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /path/to/video_editor run video-editor

Example Usage

Once connected to Claude Desktop, you can make natural language requests like:

  1. “Trim video.mp4 from 1:30 to 2:45”
  2. “Convert input.mp4 to WebM format”
  3. “Speed up video.mp4 by 2x”
  4. “Merge video1.mp4 and video2.mp4”
  5. “Extract audio from video.mp4”
  6. “Add subtitles.srt to video.mp4”

The server will:

  1. Parse your request
  2. Generate the appropriate FFmpeg command
  3. Execute it with progress tracking
  4. Provide feedback on completion

Error Handling

The server includes robust error handling for:

  • Invalid input files
  • Malformed FFmpeg commands
  • Runtime execution errors
  • Progress tracking issues

All errors are reported back to the client with detailed messages for debugging.

Security Considerations

  • Only processes files in explicitly allowed directories
  • Validates FFmpeg commands before execution
在 GitHub 查看完整 README

安装

npx @modelcontextprotocol/inspector uv --directory /path/to/video_editor run video-editor
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "video-editor": { "command": "uv", "args": ["run", "video-editor"] } } }