Skip to main content
Glama

MCP-FFMPEG

An MCP (Model Context Protocol) server and CLI for running FFmpeg jobs via a job queue with configurable parallel workers.

Features

  • Job queue — Enqueue video jobs; workers process them in the background.

  • Parallel workers — Run multiple jobs at once (number set in config).

  • Two interfaces

    • CLI — Interactive menu to pick an action and enter parameters.

    • MCP server — Tools for AI assistants (e.g. Claude Desktop) to enqueue and check jobs.

  • Actions

    • Trim — Cut a segment from a video (start time + duration).

    • Change video format — Convert to another container (e.g. mp4 → mkv) without re-encoding.

    • Change resolution — Convert to another resolution, height and width provided by user.

    • Change Subtitle format — Convert to another subtitle format (e.g. srt -> vtt).

    • Extract Audio - Extract audio from an input video file

    • Extract video transcript - Extracts the transcript of a video file

  • Caching — Same inputs produce the same job ID; completed jobs are reused unless force_run is used.

Related MCP server: MCP FFmpeg Helper

Requirements

  • Python 3.13+

  • FFmpeg — Must be on your system PATH or set via FFMPEG_PATH (see Configuration).

Installation

Choose one of the following:

Option 1: Install from PyPI

pip install mcp-ffmpeg

Or with uv:

uv add mcp-ffmpeg

Option 2: Clone the repository

git clone https://github.com/priyanshum143/MCP-FFMPEG.git
cd MCP-FFMPEG

Then install from the project root:

# With uv
uv sync

# Or with pip (editable install)
pip install -e .

Configuration

  • FFmpeg path

    • Default: use ffmpeg from system PATH.

    • Optional: set env var FFMPEG_PATH to the full path of the FFmpeg executable (e.g. for Claude Desktop).

  • Worker and paths
    Edit src/MCP_ffmpeg/utils/variables.py (class CommonVariables):

    • PARALLEL_EXECUTIONS_ALLOWED — Number of jobs that can run at once (default: 3).

    • WORKER_RE_RUN_TIME — Seconds to wait between queue checks (default: 10).

    • OUTPUT_DIR / LOGS_DIR — Where job outputs and logs are stored (default: outputs/ and logs/ under project root).

Running

CLI (interactive)

You get a menu: choose an action, enter the requested parameters. Jobs are enqueued and processed by background workers. Logs show which worker picked which job.

If you installed from PyPI:

mcp-ffmpeg-cli

If you cloned the repo:

# With uv (from project root)
uv run python -m MCP_ffmpeg.main

# Or after pip install -e .
mcp-ffmpeg-cli

MCP server (e.g. Claude Desktop)

Use the mcp-ffmpeg command so the MCP server runs over stdio.

If you installed from PyPI: use mcp-ffmpeg in your MCP config.

If you cloned the repo: after pip install -e ., use mcp-ffmpeg the same way. If you used uv sync, use uv run mcp-ffmpeg in the terminal, or in your MCP config use the path to your venv’s mcp-ffmpeg script so the server runs in that environment.

Add this to your %APPDATA%\Claude\claude_desktop_config.json (Windows) or the equivalent config for your MCP client:

{
  "mcpServers": {
    "mcp-ffmpeg": {
      "command": "mcp-ffmpeg",
      "env": {
        "FFMPEG_PATH": "C:\\path\\to\\your\\ffmpeg.exe"
      }
    }
  }
}

On macOS/Linux, use your normal config path and set FFMPEG_PATH to the path of your ffmpeg binary if needed.

Project layout

src/MCP_ffmpeg/
├── main.py           # CLI entrypoint
├── mcp_server.py     # MCP server entrypoint + tool definitions
├── actions/          # FFmpeg actions (trim, change format)
├── jobs/             # Job queue, manager, worker
└── utils/            # Logging, paths, CLI helpers
  • outputs/ — One folder per job (by job ID), containing job_details.json, output file, and optional ffmpeg_logs.log.

  • logs/ — Application logs.

License

No license required, Clone/Fork the repo and enjoy.

Author

Priyanshu CSE 2025 Graduate | Software Engineer at Amagi Media Labs

Feel free to reach out for collaborations or if you encounter any issues!

Available Tools

8 tools
get_job_resultA

Retrieve the final output of a completed job.

This tool should only be called after the job status is 'success'. If the job is still 'queued' or 'running', this will return the current status. If the job has 'failed', it will return the error details.

Inputs: job_id (required). Returns: result

get_job_statusB

Get the latest status for a job_id.

Inputs: job_id (required). Returns: result

start_audio_extractionA

Enqueue a EXTRACT_AUDIO job. Extract the audio from a given video and in the format requested by user Returns immediately with job_id + status.

input_file: path to input video file (must exist) target_format: target audio format (defaults to mp3) force_run: if True, run even when a cached result exists for the same inputs

Inputs: input_file (required), target_format, force_run. Returns: result

start_change_formatA

Enqueue a CHANGE_FORMAT job. Converts video to another container (e.g. mp4, mkv, avi) without re-encoding. Returns immediately with job_id + status.

input_file: path to input video file (must exist) output_format: desired output format (e.g., mp4, mkv, avi); dot is optional force_run: if True, run even when a cached result exists for the same inputs

Inputs: input_file (required), output_format (required), force_run. Returns: result

start_change_resolutionA

Enqueue a CHANGE_RESOLUTION job. Converts the video resolution according to the user's provided height and width. Returns immediately with job_id + status.

input_file: path to input video file (must exist) height: desired height of the video width: desired width of the video force_run: if True, run even when a cached result exists for the same inputs

Inputs: input_file (required), height (required), width (required), force_run. Returns: result

start_subtitle_format_changeA

Enqueue a CHANGE_SUBTITLE_FORMAT job. Converts the subtitle format according to the user's provided details. Returns immediately with job_id + status.

input_file: path to input video file (must exist) target_format: target subtitle format force_run: if True, run even when a cached result exists for the same inputs

Inputs: input_file (required), target_format (required), force_run. Returns: result

start_trimA

Enqueue a TRIM job. Returns immediately with job_id + status.

input_file: path to input video file (must exist) start_time: seconds (float) duration: seconds (float) force_run: if we need to force run a job or not ignoring cache

Inputs: input_file (required), start_time (required), duration (required), force_run. Returns: result

start_video_transcriptionA

Enqueue a transcript job using Whisper on a video or audio file. Returns immediately with job_id + status.

input_file: path to input media file (must exist) model: Whisper model name (tiny, base, small, medium, large, turbo) language: language code (e.g. en, hi) output_format: transcript format (txt, srt, vtt, json, tsv) force_run: if True, run even when a cached result exists for the same inputs

Inputs: input_file (required), model, language, output_format, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: status retrieval, result retrieval, and separate processing jobs for audio extraction, format change, resolution change, subtitle format change, trimming, and transcription. No overlap in functionality.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern: get_ for retrieval and start_ for job enqueuing. Underscores are used uniformly, making the naming predictable.

    Tool Count5/5

    With 8 tools, the server covers a reasonable set of common FFmpeg operations without being overwhelming. The count is well-scoped for a media processing server.

    Completeness4/5

    The tool set covers core operations like status check, result retrieval, audio extraction, format conversion, resolution change, subtitle conversion, trimming, and transcription. Missing tools for video compression, frame extraction, or concatenation, but these are minor gaps given the common use cases.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A lightweight server that exposes FFmpeg's video processing capabilities to AI assistants through the Model Context Protocol (MCP), supporting operations like video format conversion, audio extraction, and adding watermarks.
      8
      53 npm
      25
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      Provides powerful video and audio editing capabilities through FFmpeg, enabling AI assistants to perform professional-grade operations including format conversion, trimming, overlays, transitions, and advanced audio processing.
      27
      90
      MIT