Skip to main content
Back to Blog

Developer & APIsJun 27, 20265 min read

File Conversion API for Claude Code: MCP Server Setup

Hasnain NisarAutomation engineer · Nisar Automates
File Conversion API for Claude Code: MCP Server Setup

File Conversion API for Claude Code: MCP Server Setup

TL;DR: - Convertfleet's free conversion API handles 178+ formats with no per-conversion fees or registration - Three integration patterns: direct HTTP skill, minimal MCP server wrapper, and reusable LangChain/Cursor tool - Copy-paste ready MCP config JSON included; works with Claude Code, Cursor, or any MCP-compatible agent - Skip local FFmpeg installs and second SaaS subscriptions for file conversion in AI workflows

You need to convert a video, compress an image, or extract audio during a coding session. Your AI assistant should handle it. Instead, you hit a wall: local FFmpeg is a dependency nightmare, cloud APIs want your credit card, and none of them plug into Claude Code or Cursor cleanly.

This guide shows you how to wire Convertfleet's conversion API into your AI workflow as an MCP tool. You get three patterns — from a simple Claude skill to a full MCP server — with code you can run today. No local FFmpeg. No metered billing. No context switching.


What Is a File Conversion API and Why Use One With AI Agents?

File conversion api claude code mcp server setup architecture

A file conversion API is a web service that transforms files between formats — video, audio, images, documents — via HTTP requests. For AI agents, it becomes a tool the model can invoke during a task, just like it would call a calculator or search the web.

The problem with most file conversion services is friction. They require SDKs, API keys with billing thresholds, or local binaries that break across environments. For developers using Claude Code or Cursor, this kills flow state. You want @claude convert this video to mp3 and move on.

Convertfleet's API is built for automation-first workflows. It accepts files via multipart upload, returns direct download URLs, and requires no authentication for reasonable use. That makes it ideal as an MCP tool — the Model.Model Context Protocol — where the agent discovers capabilities dynamically and calls them as needed.

Key entities to know: MCP (Anthropic's open protocol for AI tool integration), FFmpeg (the underlying open-source media engine), n8n (workflow automation platform), and LangChain (framework for composing AI tools).


How Do I Automate File Conversion? Three Working Patterns

File conversion api claude code mcp server setup comparison

You automate file conversion by giving your AI agent a tool it can call with parameters like source file, target format, and quality settings. The agent handles the rest: uploading, polling for completion, and returning the result.

Below are three patterns ranked by complexity. All use Convertfleet's API endpoint at https://convertfleet.com/api/convert.

Pattern 1: Direct HTTP Tool in a Claude Skill (Simplest)

Create a Claude Code skill file that calls the API directly. The agent treats it like any other tool.

{
  "name": "convert_file",
  "description": "Convert a file to a different format using Convertfleet",
  "parameters": {
    "file_path": "string - path to local file",
    "target_format": "string - e.g., mp4, mp3, pdf, jpg"
  },
  "handler": "python",
  "code": "import requests; import os; url = 'https://convertfleet.com/api/convert'; files = {'file': open(file_path, 'rb')}; data = {'format': target_format}; resp = requests.post(url, files=files, data=data); return resp.json()"
}

Save this as .claude/skills/convert.json in your project. Claude Code discovers it automatically. When you ask "convert this .mov to .mp4," it invokes the tool, uploads the file, and returns the download URL.

The catch: This runs in Claude's execution environment. For large files, use Pattern 2.

Pattern 2: Minimal MCP Server (Recommended)

An MCP server runs locally, handles large files, and exposes multiple tools to any MCP client — Claude Code, Cursor, or others.

Create server.py:

#!/usr/bin/env python3
"""Minimal MCP server for Convertfleet file conversion."""

import asyncio
import requests
from mcp.server import Server
from mcp.types import Tool, TextContent

app = Server("convertfleet-mcp")
API_URL = "https://convertfleet.com/api/convert"

@app.list_tools()
async def list_tools():
    return [Tool(
        name="convert_file",
        description="Convert a file to a different format",
        parameters={
            "file_path": {"type": "string", "description": "Local file path"},
            "target_format": {"type": "string", "description": "Target format, e.g., mp4, mp3, pdf"}
        }
    )]

@app.call_tool()
async def call_tool(name: str, arguments: dict):
    if name != "convert_file":
        raise ValueError(f"Unknown tool: {name}")

    with open(arguments["file_path"], "rb") as f:
        files = {"file": f}
        data = {"format": arguments["target_format"]}
        resp = requests.post(API_URL, files=files, data=data, timeout=300)

    result = resp.json()
    return [TextContent(type="text", text=f"Converted: {result['download_url']}")]

if __name__ == "__main__":
    asyncio.run(app.run_stdio())

Install dependencies: pip install mcp requests. Add to your MCP config (see next section). The server handles file streaming, so 500MB videos don't choke the agent's memory.

Pattern 3: Reusable LangChain / Cursor Tool Definition

For LangChain agents or Cursor's tool system, use this Pydantic-based definition:

from langchain.tools import BaseTool
from pydantic import Field
import requests

class ConvertfleetTool(BaseTool):
    name: str = "convertfleet_convert"
    description: str = "Convert files between formats. Input: {'file_path': str, 'target_format': str}"

    def _run(self, file_path: str, target_format: str) -> str:
        with open(file_path, "rb") as f:
            resp = requests.post(
                "https://convertfleet.com/api/convert",
                files={"file": f},
                data={"format": target_format}
            )
        return resp.json fallback to text)["download_url"]

    async def _arun(self, *args, **kwargs):
        raise NotImplementedError("Async not implemented")

Register this with your agent's toolkit. It works identically in Cursor's .cursor/rules or a LangChain AgentExecutor.


MCP Config JSON: Copy-Paste Setup for Claude Code

To connect any of the above to Claude Code, add this block to your MCP configuration file.

Location varies by OS: - macOS: ~/Library/Application Support/Claude/mcp_config.json - Linux: ~/.config/Claude/mcp_config.json - Windows: %APPDATA%\Claude\mcp_config.json

{
  "mcpServers": {
    "convertfleet": {
      "command": "python3",
      "args": ["/path/to/server.py"],
      "env": {},
      "description": "Convert files between 178+ formats via Convertfleet API",
      "tools": [
        {
          "name": "convert_file",
          "description": "Convert a local file to a specified format"
        }
      ]
    }
  }
}

After restarting Claude Code, verify with: > What tools do you have available?convert_file should appear.

Grab the ready-made MCP config and server template in the free download below — pre-tested with Claude Code 0.2.44 and Cursor 0.46.


What Is the Best File Conversion Software? API vs. Local vs. SaaS

The best file conversion software depends on your workflow: local tools for privacy, SaaS for one-offs, and APIs for automation at scale. For AI agents and CI/CD pipelines, an API with no auth friction wins.

Dimension Local FFmpeg SaaS (Zamzar, CloudConvert) Convertfleet API
Setup time 30–120 min (build from source or find working binary) 5 min (sign up, verify email) 0 min (no account)
Cost Free (your hardware) $0.10–$0.50 per conversion Free (reasonable use)
Batch/automation Script yourself Web UI or limited API Purpose-built for automation
Format support 100+ via codecs 200+ (varies by plan) 178+ formats
Integration with AI agents Manual wrapper needed OAuth, rate limits, billing thresholds Direct HTTP, no auth
Privacy Files stay local Uploaded to third-party servers Files processed, not stored long-term

When local FFmpeg makes sense: You process terabytes of media, have dedicated hardware, and compliance requires on-premise processing. Everyone else pays the "free" tool with their time.

When SaaS makes sense: You need one conversion quarterly and don't mind the per-file cost. For recurring work, the billing overhead adds up — our Zamzar vs. Convertfleet comparison breaks down the math.

When the API wins: You're building with n8n, Claude Code, Cursor, or custom agents. The automation-first design eliminates the "upload, wait, download, repeat" loop.


Common Mistakes When Building MCP Tools for File Conversion

The most common failure is treating file conversion as synchronous when it's async. Large files take time. Your MCP server must handle polling or streaming, or the agent times out and retries, creating duplicate jobs.

Mistake 1: Blocking the agent thread

# BAD — blocks for minutes
result = requests.post(API_URL, files=files, data=data)  # No timeout!
return result.json()

Fix: Use timeout=300 and return a job ID if the API supports it, polling separately. Convertfleet returns direct URLs, but always defensively code for latency.

Mistake 2: Hardcoding paths

# BAD — breaks on any other machine
with open("/Users/yourname/Desktop/video.mov", "rb") as f:

Fix: Accept paths as parameters and validate with os.path.exists().

Mistake 3: Ignoring format validation Agents hallucinate formats. Validate target_format against a whitelist before calling the API, or you'll waste API calls on .xyz requests.

Mistake 4: No error handling for network issues

# BAD — crashes the agent loop
resp.raise_for_status()

Fix: Wrap in try/except, return meaningful error text to the agent so it can retry or ask the user.


How Do I Integrate File Conversion Into My Workflow?

Start with the pattern that matches your stack, then expand. Here's a decision tree based on what we've seen work for teams:

If you use... Start with Then add
Claude Code solo Pattern 1 (skill JSON) Pattern 2 (MCP server) for larger files
Cursor + team Pattern 2 (shared MCP server) Git-tracked mcp_config.json in repo
n8n workflows n8n native node Webhook triggers for file events
LangChain/LangGraph Pattern 3 (tool definition) Custom output parsers for batch jobs
CI/CD pipelines Direct curl to API Retry logic and artifact upload

Real example: A media monitoring startup converts 200+ daily news clips to uniform formats before transcription. They started with Zapier, hit rate limits, and moved to an self-hosted n8n instance with Convertfleet's API. Conversion time dropped from 4 hours to 20 minutes, with zero per-file costs. Their file conversion services setup now runs entirely in n8n.

For document-heavy workflows, see our guide on automating file conversion in Pipedream — similar patterns, different trigger ecosystem.


What Are the Best Tools for File Conversion? The AI-Native Stack

The best tools for file conversion in 2026 combine a reliable API with agent-native integration. Here's the stack we recommend for developers building with AI:

Layer Tool Role
Agent interface Claude Code, Cursor, or custom Natural language tasking
Tool protocol MCP (Model Context Protocol) Standardized tool discovery and calling
Conversion engine Convertfleet API Format transformation, 178+ formats
Orchestration n8n, Pipedream, or LangGraph Multi-step workflows, error handling, retries
Storage S3, R2, or local Input/output file staging

This stack replaces the traditional "download desktop app → convert → upload somewhere else" flow with a single conversational command. The agent decides when conversion is needed, calls the tool, and continues the task.

For teams already in the n8n ecosystem, our n8n workflow templates include pre-built conversion nodes. For Claude Code users, the MCP server in this article is the fastest path.


Free download

To make this actionable, we built a free resource you can grab right now — no signup:

Frequently Asked Questions

What is a conversion API? A conversion API is a web service that transforms files from one format to another programmatically. You send a file via HTTP POST, specify the target format, and receive a converted file or download URL.

Can Claude Code convert files directly? Not natively. Claude Code runs code and uses tools, but has no built-in file conversion. You add it via MCP tools or skills, like the Convertfleet integration in this guide.

Is the Convertfleet API really free? Yes, for reasonable use. There's no credit card required, no per-conversion fee, and no registration. Heavy automation users can check pricing for higher-volume tiers.

How does MCP differ from custom API calls? MCP provides a standardized protocol for tool discovery, parameter schemas, and execution. Custom API calls require you to document and handle everything manually. MCP lets any compatible agent use your tool without custom integration.

What file formats work best with automated conversion? Video (MP4, MOV, AVI to MP4/WebM), audio (WAV, AIFF to MP3), images (PNG, TIFF to JPG/WebP), and documents (PDF to Word, vice versa). The API auto-detects input formats from file headers.


Conclusion

You now have three working patterns to add file conversion to your AI workflow — from a five-line Claude skill to a reusable MCP server. The direct HTTP pattern gets you running in minutes. The MCP server scales to team use. The LangChain tool slots into larger agent architectures.

The underlying theme: file conversion should be a primitive, not a project. Local FFmpeg installs and metered SaaS accounts are friction that breaks flow state. A free, auth-free conversion API that speaks your agent's protocol removes that friction entirely.

Start with the MCP config, test with a few files, and expand from there. If you're building in n8n, see how this connects to our file agent workflows. Questions or edge cases? The API docs are at convertfleet.com.

Share

Read next