Skip to main content

A Model Context Protocol server for FFmpeg media processing

Project description

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).
  • Caching — Same inputs produce the same job ID; completed jobs are reused unless force_run is used.

Requirements

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

Installation

From the project root:

# With uv
uv sync

# Or with pip
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)

# From project root (with src on PYTHONPATH)
uv run python -m MCP_ffmpeg.main

# Or after pip install
python -m MCP_ffmpeg.main

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.

MCP server (stdio)

For MCP clients (e.g. Claude Desktop) that talk over stdio:

uv run python -m MCP_ffmpeg.mcp_server

Or point your MCP config to the mcp-ffmpeg package and the mcp_server module as needed by your client.

Dummy claude_desktop_config.json file

{
  "mcpServers": {
    "mcp-ffmpeg": {
      "command": "MCP-FFMPEG\\.venv\\Scripts\\python.exe",
      "args": [
        "-m",
        "MCP_ffmpeg.mcp_server"
      ],
      "env": {
        "FFMPEG_PATH": "C:\\ffmpeg\\bin\\ffmpeg.exe"
      }
    }
  },
  "preferences": {
    "coworkWebSearchEnabled": true,
    "sidebarMode": "chat",
    "coworkScheduledTasksEnabled": false
  }
}

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_ffmpeg-0.1.2.tar.gz (64.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_ffmpeg-0.1.2-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file mcp_ffmpeg-0.1.2.tar.gz.

File metadata

  • Download URL: mcp_ffmpeg-0.1.2.tar.gz
  • Upload date:
  • Size: 64.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_ffmpeg-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d1348d64ea532df01ce87ad5c2e7c9688013b1913118ccf14679ec25ff133eb6
MD5 1701608fe36fe62a2ecf599d6ba0a118
BLAKE2b-256 4d62e068f4eb1d0f51327efb99d3e7181c8893c0f30d83eeb994757d2aa45b0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_ffmpeg-0.1.2.tar.gz:

Publisher: publish.yml on priyanshum143/MCP-FFMPEG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcp_ffmpeg-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mcp_ffmpeg-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mcp_ffmpeg-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 68f5307099e4792ab4ed35a47e68e0033dbba0af2dbc2e25e139f40d196f2471
MD5 c3657dc6bedaa4515329eaa0fe497be5
BLAKE2b-256 959b4ead3a333ed2ad90778d738804da93921d46d2180f7b7386e8c7e13fecb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcp_ffmpeg-0.1.2-py3-none-any.whl:

Publisher: publish.yml on priyanshum143/MCP-FFMPEG

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page