{"slug": "build-an-ai-video-editing-agent-with-claude-and-ffmpeg-micro-mcp", "title": "Build an AI Video Editing Agent with Claude and FFmpeg Micro MCP", "summary": "A developer built an AI video editing agent using Claude and the FFmpeg Micro MCP server that translates natural language instructions into FFmpeg commands. The agent can perform operations like transcoding, trimming, and concatenating videos without manual terminal intervention. The system uses six MCP tools, with transcode_and_wait being the primary tool for agent workflows.", "body_md": "*Originally published at ffmpeg-micro.com*\n\nMost developers using AI for video editing are still doing it manually. They prompt Claude or ChatGPT to generate an FFmpeg command, copy it, paste it into a terminal, debug the errors, and repeat. That works for one-off jobs. But if you're building a product or workflow where users describe video edits in plain English and get results back automatically, you need something different.\n\nYou need an agent. An AI agent that understands video operations, calls the right API, and returns the finished video without anyone touching a terminal.\n\nThis tutorial builds exactly that using Claude and the FFmpeg Micro MCP server. By the end, you'll have a working agent that takes natural language instructions like \"trim this video to the first 30 seconds and convert it to 720p\" and executes the entire job.\n\nThe flow looks like this:\n\nNo local FFmpeg installation. No shell commands. No manual intervention after the initial prompt.\n\nYou need three things:\n\nAdd this to your MCP configuration file:\n\n```\n{\n  \"mcpServers\": {\n    \"ffmpeg-micro\": {\n      \"type\": \"http\",\n      \"url\": \"https://mcp.ffmpeg-micro.com\"\n    }\n  }\n}\n```\n\nThe first time you use it, your browser opens for OAuth sign-in. After that, the token is cached.\n\n**Config file locations:**\n\n`~/Library/Application Support/Claude/claude_desktop_config.json`\n\n(Mac)`.mcp.json`\n\nor `~/.claude.json`\n\nIf your tool doesn't support HTTP MCP yet, use the stdio transport instead:\n\n```\n{\n  \"mcpServers\": {\n    \"ffmpeg-micro\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@ffmpeg-micro/mcp-server\"],\n      \"env\": {\n        \"FFMPEG_MICRO_API_KEY\": \"your_api_key_here\"\n      }\n    }\n  }\n}\n```\n\nOnce connected, Claude can call six MCP tools:\n\n| Tool | What It Does |\n|---|---|\n`transcode_video` |\nCreates a transcode job (returns immediately) |\n`transcode_and_wait` |\nCreates a job and polls until it finishes |\n`get_transcode` |\nChecks the status of a specific job |\n`list_transcodes` |\nLists recent jobs with optional filters |\n`get_download_url` |\nGenerates a signed download link |\n`cancel_transcode` |\nCancels a queued or in-progress job |\n\nFor most agent workflows, `transcode_and_wait`\n\nis the one you want. It creates the job and blocks until the video is ready, so the agent can return the download link in a single turn.\n\nOpen Claude (or whichever tool you connected) and try this:\n\n```\nTake this video and convert it to 720p MP4 with medium quality:\nhttps://www.ffmpeg-micro.com/samples/quickstart-sample.mp4\n```\n\nClaude reads your request, picks the right tool (`transcode_and_wait`\n\n), constructs the API call with the correct parameters, and waits for the result. You get back a download URL for the processed video.\n\nBehind the scenes, the MCP call looks like this:\n\n```\n{\n  \"inputs\": [\n    { \"url\": \"https://www.ffmpeg-micro.com/samples/quickstart-sample.mp4\" }\n  ],\n  \"outputFormat\": \"mp4\",\n  \"preset\": {\n    \"quality\": \"medium\",\n    \"resolution\": \"720p\"\n  }\n}\n```\n\nYou didn't write that JSON. Claude figured it out from your plain English instruction.\n\nThe agent handles more than basic transcoding. Try these:\n\n**Extract audio from a video:**\n\n```\nExtract the audio from this video as an MP3:\nhttps://www.ffmpeg-micro.com/samples/quickstart-sample.mp4\n```\n\n**Compress for web delivery:**\n\n```\nCompress this video for web. Target quality CRF 28, use H.265 encoding:\nhttps://www.ffmpeg-micro.com/samples/quickstart-sample.mp4\n```\n\nClaude translates that into the right FFmpeg options:\n\n```\n{\n  \"inputs\": [\n    { \"url\": \"https://www.ffmpeg-micro.com/samples/quickstart-sample.mp4\" }\n  ],\n  \"outputFormat\": \"mp4\",\n  \"options\": [\n    { \"option\": \"-c:v\", \"argument\": \"libx265\" },\n    { \"option\": \"-crf\", \"argument\": \"28\" },\n    { \"option\": \"-preset\", \"argument\": \"medium\" }\n  ]\n}\n```\n\n**Trim a section:**\n\n```\nTrim this video from 5 seconds to 15 seconds:\nhttps://www.ffmpeg-micro.com/samples/quickstart-sample.mp4\n```\n\n**Stitch multiple videos together:**\n\n```\nConcatenate these two videos into one MP4:\n1. https://www.ffmpeg-micro.com/samples/quickstart-sample.mp4\n2. https://www.ffmpeg-micro.com/samples/quickstart-sample.mp4\n```\n\nEvery operation goes through the same flow: natural language in, processed video out.\n\nIf you're building this into a product, give Claude a system prompt that constrains the agent to video operations:\n\n```\nYou are a video editing assistant. You have access to the FFmpeg Micro\nMCP server for video processing. When a user describes a video edit:\n\n1. Identify the operation (transcode, trim, compress, extract audio, etc.)\n2. Use the transcode_and_wait tool with the correct parameters\n3. Return the download URL to the user\n4. If the job fails, explain what went wrong\n\nAlways use preset mode for simple operations (quality + resolution).\nUse options mode for specific codecs, filters, or advanced FFmpeg flags.\nNever ask the user for technical parameters — infer them from the request.\n```\n\nThis turns Claude from a general-purpose assistant into a focused video editing agent that handles the technical details automatically.\n\n**Using a non-public video URL.** The FFmpeg Micro API needs to fetch your video. If the URL requires authentication or is behind a firewall, the job will fail. For private files, use the upload flow first (presigned URL, PUT, confirm) to get a cloud storage URL.\n\n**Forgetting to check job status.** If you use `transcode_video`\n\ninstead of `transcode_and_wait`\n\n, the job runs asynchronously. You'll need to call `get_transcode`\n\nto check when it's done. For agent workflows, `transcode_and_wait`\n\navoids this entirely.\n\n**Asking for unsupported output formats.** The API supports mp4, webm, avi, mov, mkv, gif, mp3, wav, and more. But if you ask Claude to output a format that FFmpeg doesn't support for your input, the job will fail with a clear error message.\n\nThe traditional way to automate video editing with AI is prompting for FFmpeg commands, then running them locally. That works, but it has problems:\n\nWith the MCP agent approach, Claude handles the complexity and FFmpeg Micro handles the infrastructure. Your code (or your users) just describes what they want in plain English.\n\nFFmpeg Micro processes over 50,000 API calls per month. A 1-minute video transcode takes about 3 seconds. Pricing starts with a free tier, so you can prototype without spending anything.\n\nThe MCP protocol is currently supported by Claude Desktop, Claude Code, Cursor, Windsurf, and other MCP-compatible tools. For OpenAI or other providers, you'd call the FFmpeg Micro REST API directly instead of going through MCP. The API itself works with any HTTP client.\n\nNo. That's the point. The agent translates natural language to the right API calls. You say \"compress this video\" and Claude figures out the codec, CRF, and preset. If you do know FFmpeg, you can be more specific (\"use libx265 with CRF 24\"), and the agent will use those exact settings.\n\nFFmpeg Micro supports files up to 2GB. For larger files, you'll need to split them first. The free tier has usage limits. Check [ffmpeg-micro.com/pricing](https://www.ffmpeg-micro.com/pricing) for details on each plan.\n\nEach API call handles one operation. But the agent can chain them automatically. Ask Claude \"trim this video to 30 seconds, then convert to 720p WebM\" and it will run two sequential transcode jobs, using the output of the first as the input for the second.\n\nYes. The FFmpeg Micro MCP server is published as `@ffmpeg-micro/mcp-server`\n\non npm. You can inspect the source, fork it, or contribute.", "url": "https://wpnews.pro/news/build-an-ai-video-editing-agent-with-claude-and-ffmpeg-micro-mcp", "canonical_source": "https://dev.to/javidjamae/build-an-ai-video-editing-agent-with-claude-and-ffmpeg-micro-mcp-4915", "published_at": "2026-06-19 10:15:23+00:00", "updated_at": "2026-06-19 10:37:06.553748+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "developer-tools"], "entities": ["Claude", "FFmpeg Micro MCP", "FFmpeg", "MCP"], "alternates": {"html": "https://wpnews.pro/news/build-an-ai-video-editing-agent-with-claude-and-ffmpeg-micro-mcp", "markdown": "https://wpnews.pro/news/build-an-ai-video-editing-agent-with-claude-and-ffmpeg-micro-mcp.md", "text": "https://wpnews.pro/news/build-an-ai-video-editing-agent-with-claude-and-ffmpeg-micro-mcp.txt", "jsonld": "https://wpnews.pro/news/build-an-ai-video-editing-agent-with-claude-and-ffmpeg-micro-mcp.jsonld"}}