mcp-media-processor
by: maoxiaoke
A Node.js server implementing Model Context Protocol (MCP) for media processing operations, providing powerful video and image manipulation capabilities.
📌Overview
Purpose: To provide a Node.js server that implements the Model Context Protocol for powerful media processing operations, including video and image manipulation.
Overview: The MCP Media Processing Server delivers robust capabilities for handling various media processing tasks, allowing users to efficiently manipulate videos and images using FFmpeg and ImageMagick. This framework supports a wide range of operations conducive to enhancing media quality and compatibility.
Key Features:
-
Video Processing and Conversion: Facilitates conversion between different video formats, along with trimming and editing functionalities to tailor videos as per requirements.
-
Image Processing and Manipulation: Offers multiple options for image editing, including resizing, rotating, adding effects, and watermarking, enhancing the usability and aesthetics of image assets.
MCP Media Processing Server
A Node.js server implementing Model Context Protocol (MCP) for media processing operations, providing powerful video and image manipulation capabilities.
Features
- Video processing and conversion
- Image processing and manipulation
- Media compression
- Video trimming and editing
- Image effects and watermarking
Prerequisites
Before using this server, ensure the following dependencies are installed:
- FFmpeg (required for video processing)
- macOS:
brew install ffmpeg
- Ubuntu/Debian:
sudo apt-get install ffmpeg
- Windows: Download from FFmpeg official website
- macOS:
- ImageMagick (required for image processing)
- macOS:
brew install imagemagick
- Ubuntu/Debian:
sudo apt-get install imagemagick
- Windows: Download from ImageMagick official website
- macOS:
How to Use
Add the following to your claude_desktop_config.json
:
NPX
{
"mcpServers": {
"mediaProcessor": {
"command": "npx",
"args": [
"-y",
"mcp-media-processor@latest"
]
}
}
}
API
Tools
Video Operations
-
execute-ffmpeg
Execute any FFmpeg command with custom options
Inputs:inputPath
(string): Absolute path to input video fileoptions
(string[]): Array of FFmpeg command optionsoutputPath
(string, optional)outputFilename
(string, optional)
-
convert-video
Convert video to a different format
Inputs:inputPath
(string)outputFormat
(string) (e.g., mp4, mkv, avi)outputPath
(string, optional)outputFilename
(string, optional)
-
compress-video
Compress video file
Inputs:inputPath
(string)quality
(number, optional, 1-51, lower is better)outputPath
(string, optional)outputFilename
(string, optional)
-
trim-video
Trim video to specified duration
Inputs:inputPath
(string)startTime
(string) (HH:MM:SS)duration
(string) (HH:MM:SS)outputPath
(string, optional)outputFilename
(string, optional)
Image Operations
-
compress-image
Compress PNG image using ImageMagick
Inputs:inputPath
(string)quality
(number, optional, 1-100)outputPath
(string, optional)outputFilename
(string, optional)
-
convert-image
Convert image to different format
Inputs:inputPath
(string)outputFormat
(string) (e.g., jpg, png, webp, gif)outputPath
(string, optional)outputFilename
(string, optional)
-
resize-image
Resize image to specified dimensions
Inputs:inputPath
(string)width
(number, optional)height
(number, optional)maintainAspectRatio
(boolean, optional)outputPath
(string, optional)outputFilename
(string, optional)
-
rotate-image
Rotate image by specified degrees
Inputs:inputPath
(string)degrees
(number)outputPath
(string, optional)outputFilename
(string, optional)
-
add-watermark
Add watermark to image
Inputs:inputPath
(string)watermarkPath
(string)position
(string, optional, default: "southeast")opacity
(number, optional, 0-100)outputPath
(string, optional)outputFilename
(string, optional)
-
apply-effect
Apply visual effect to image
Inputs:inputPath
(string)effect
(string) (blur, sharpen, edge, emboss, grayscale, sepia, negate)intensity
(number, optional, 0-100)outputPath
(string, optional)outputFilename
(string, optional)
License
This MCP server is licensed under the MIT License. You are free to use, modify, and distribute the software under the terms of the MIT License. See the LICENSE file in the project repository for details.