How sworddut/mcp-ffmpeg-helper works
Project type and purpose
• This is a lightweight MCP (Model Context Protocol) microservice written in Node.js/TypeScript.
• It exposes FFmpeg video/audio processing functionality (format conversion, trimming, watermarking, frame extraction, etc.) over the MCP protocol to AI assistants (e.g., Windsurf).
File structure
• Top‑level:
• package.json / tsconfig.json → Node.js/TypeScript project setup
• src/index.ts → Entry point that bootstraps the MCP server
• src/tools/definitions.ts → Tool definitions (API contracts for each FFmpeg operation)
• src/tools/handlers.ts → Implementations of each tool (mapping definitions to handler functions)
• src/utils/ffmpeg.ts → Low‑level wrappers around the FFmpeg CLI
• src/utils/file.ts → File‑system utilities (path normalization, existence checks)
• No frontend; purely a back‑end microservice
• Build artifacts under /build when compiled
Key insights from README
• The service communicates via standard input/output over the MCP protocol
• It registers multiple “tools” (get_video_info, convert_video, extract_audio, etc.) with MCP
• On each incoming MCP request, index.ts routes to the appropriate handler in src/tools/handlers.ts, which in turn calls utilities in src/utils