README.md•6.65 kB
# Rendi MCP Server
A Model Context Protocol (MCP) server that provides cloud-based FFmpeg processing capabilities through the [Rendi API](https://rendi.dev). This server enables AI assistants to run FFmpeg commands in the cloud without local installation or infrastructure.
## Features
This MCP server provides four powerful tools for cloud-based video and audio processing:
### 🎬 Run FFmpeg Command
Execute a single FFmpeg command in the cloud with automatic file handling and processing. Perfect for simple video conversions, resizing, format changes, and basic editing tasks.
### ⛓️ Run Chained FFmpeg Commands
Submit multiple sequential FFmpeg commands where outputs from earlier commands can be used as inputs in later ones. This is ideal for complex workflows like:
- Convert video → Extract thumbnail → Apply watermark
- Trim video → Resize → Extract audio → Convert to MP3
Chained commands are more efficient than running commands separately as they share system resources.
### 📊 Poll FFmpeg Command
Check the status of submitted commands and retrieve results including:
- Processing status (queued, processing, success, failed)
- Execution time and performance metrics
- Output file metadata (resolution, duration, bitrate, codec, etc.)
- Direct download URLs for processed files
### 🗑️ Delete Command Files
Clean up output files from Rendi's storage when you're done with them. This helps manage storage space and keeps your workspace organized.
## What is Rendi?
[Rendi](https://rendi.dev) is a cloud-based FFmpeg API service that allows you to run FFmpeg commands without installing FFmpeg locally. It provides:
- ☁️ Cloud-based processing infrastructure
- 🚀 Scalable vCPU allocation (up to your account limit)
- 📦 Automatic file storage and management
- 🔒 Secure API key authentication
- ⚡ Fast processing with configurable resources
## Prerequisites
- A Rendi API key (get one at [rendi.dev](https://rendi.dev))
- An MCP-compatible client (Claude Desktop, Cline, etc.)
## Installation
### Via Smithery
The easiest way to install this server is through [Smithery](https://smithery.ai):
```bash
npx @smithery/cli install rendi-mcp-server
```
You'll be prompted to enter your Rendi API key during installation.
### Manual Installation
1. Clone this repository:
```bash
git clone https://github.com/ctaylor86/rendi-mcp-server.git
cd rendi-mcp-server
```
2. Install dependencies:
```bash
npm install
```
3. Build the project:
```bash
npm run build
```
4. Configure your MCP client to use this server with your Rendi API key.
## Configuration
This server requires one configuration parameter:
- **rendiApiKey** (required): Your Rendi API key for authentication
### Example Configuration for Claude Desktop
Add this to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"rendi": {
"command": "node",
"args": ["/path/to/rendi-mcp-server/dist/index.js"],
"env": {
"RENDI_API_KEY": "your-rendi-api-key-here"
}
}
}
}
```
## Usage Examples
### Simple Video Conversion
```
Use the run_ffmpeg_command tool to convert a video to MP4:
- Command: "-i {{in_1}} -c:v libx264 -c:a aac {{out_1}}"
- Input files: {"in_1": "https://example.com/video.avi"}
- Output files: {"out_1": "converted.mp4"}
```
### Extract Thumbnail from Video
```
Use the run_ffmpeg_command tool to extract a thumbnail:
- Command: "-i {{in_1}} -ss 00:00:05 -vframes 1 {{out_1}}"
- Input files: {"in_1": "https://example.com/video.mp4"}
- Output files: {"out_1": "thumbnail.jpg"}
```
### Complex Workflow with Chained Commands
```
Use the run_chained_ffmpeg_commands tool for a multi-step workflow:
1. Concatenate two videos
2. Extract a thumbnail from the result
Commands:
[
"-i {{in_1}} -i {{in_2}} -filter_complex \"[0:v][1:v]concat=n=2:v=1:a=0[v]\" -map [v] {{out_1}}",
"-i {{out_1}} -ss 00:00:10 -vframes 1 {{out_2}}"
]
Input files: {
"in_1": "https://example.com/part1.mp4",
"in_2": "https://example.com/part2.mp4"
}
Output files: {
"out_1": "concatenated.mp4",
"out_2": "thumbnail.jpg"
}
```
### Check Command Status
```
After submitting a command, use poll_ffmpeg_command with the returned command_id to check status and get results.
```
### Clean Up Files
```
When you're done with the output files, use delete_command_files with the command_id to free up storage.
```
## Important Notes
### File Naming Convention
Rendi uses a specific aliasing system for files:
- **Input files**: Must use keys starting with `in_` (e.g., `in_1`, `in_video`, `in_audio`)
- **Output files**: Must use keys starting with `out_` (e.g., `out_1`, `out_result`, `out_thumbnail`)
- **In commands**: Reference files using `{{alias}}` format (e.g., `{{in_1}}`, `{{out_1}}`)
### Input File Requirements
- Input files must be publicly accessible URLs
- Supported sources: Direct URLs, Google Drive, Dropbox, S3, Rendi storage, etc.
- The filename should appear at the end of the URL
### Output File Storage
- Output files are stored indefinitely on Rendi's servers until you delete them
- Each output file includes a direct download URL
- Use the delete_command_files tool to clean up when done
### Processing Limits
- Maximum 10 commands per chain
- Default timeout: 300 seconds per command (configurable)
- Default vCPUs: 8 (configurable up to your account limit)
## Development
### Run in Development Mode
```bash
npm run dev
```
### Build
```bash
npm run build
```
### Start Production Server
```bash
npm start
```
## Architecture
This server is built using:
- **TypeScript** for type-safe development
- **Express** for HTTP server functionality
- **@modelcontextprotocol/sdk** for MCP protocol implementation
- **@smithery/sdk** for Smithery integration
- **Zod** for schema validation
- **Docker** for containerized deployment
## API Reference
For detailed information about the Rendi API, visit:
- [API Introduction](https://docs.rendi.dev/api-reference/introduction)
- [Run FFmpeg Command](https://docs.rendi.dev/api-reference/endpoint/run-ffmpeg-command)
- [Run Chained Commands](https://docs.rendi.dev/api-reference/endpoint/run-chained-ffmpeg-commands)
- [Poll Command](https://docs.rendi.dev/api-reference/endpoint/poll-command)
- [Delete Files](https://docs.rendi.dev/api-reference/endpoint/delete-command-files)
## License
MIT
## Support
For issues with this MCP server, please open an issue on GitHub.
For Rendi API support, visit [rendi.dev](https://rendi.dev) or check their [documentation](https://docs.rendi.dev).
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.