Skip to main content
Back to Blog

Automation & WorkflowsJun 25, 20265 min read

Automate File Conversion: Build an MCP Server for Claude, Cursor & n8n

Hasnain NisarAutomation engineer · Nisar Automates
Automate File Conversion: Build an MCP Server for Claude, Cursor & n8n

Automate File Conversion: Build an MCP Server for Claude, Cursor & n8n

TL;DR: - Build a Model Context Protocol (MCP) server that exposes ConvertFleet's file conversion API as a tool that Claude Code, Cursor 3, and other AI agents can call directly - MCP servers are the fastest-growing integration layer for AI agents, with over 9,400 public servers now registered and OAuth 2.1 support landing in 2026 - This tutorial gives you the complete server code, n8n workflow node, and configuration for Cursor/Claude — no FFmpeg installation required - Automate file conversion in your AI agent workflows without ever leaving your coding environment

You need to convert a video, compress a PDF, or extract audio from a file — but you're deep in a Claude Code session building a feature, or running a Cursor 3 agent loop, or orchestrating an n8n workflow. Stopping to find a conversion tool, upload a file, download the result, and feed it back into your pipeline kills momentum.

The Model Context Protocol fixes this. MCP lets you expose any API as a tool that AI agents discover and call automatically. Instead of breaking flow to handle file conversion manually, you describe what you need in natural language and the agent executes it through your server.

This article shows exactly how to build and connect a file conversion MCP server using ConvertFleet's API. You'll have it running locally in under 15 minutes, connected to Claude Code, Cursor 3, and n8n.

What Is an MCP Server and Why Use It for File Conversion?

File conversion mcp server claude cursor n8n architecture

An MCP server is a lightweight bridge that exposes external capabilities — APIs, databases, file systems — as tools that AI agents can discover and invoke. Think of it as a USB-C port for AI: standardised, bidirectional, and composable.

The protocol, developed by Anthropic and now supported by OpenAI, Cursor, Windsurf, and others, has exploded to over 9,400 public servers according to the MCP community registry as of mid-2026. OAuth 2.1 support arrived in early 2026, making production deployments with proper authentication viable for the first time.

For file conversion specifically, an MCP server solves three real problems:

  • Context switching: You stay in your IDE or chat interface; the agent handles the conversion
  • Environment consistency: No "works on my machine" FFmpeg builds or missing codecs
  • Auditability: Every conversion is logged through the agent's tool-use trail

Teams building with n8n workflow automation get particular value — an MCP server becomes just another node in a larger automation, callable from HTTP Request nodes or dedicated MCP trigger nodes.

File Conversion API vs. Running FFmpeg Locally: What Actually Costs Less?

File conversion mcp server claude cursor n8n checklist

Most developers default to installing FFmpeg locally. It's familiar, it's free, and it works — until it doesn't.

Factor Local FFmpeg File Conversion API (ConvertFleet)
Setup time 30–90 min (install, codecs, PATH) < 1 min (API key)
Maintenance burden High — version updates, security patches, codec hunting None — managed infrastructure
Concurrent processing Limited by your machine Scale to thousands (serverless)
Format support 178+ if you compile right; often ~50 in practice 178+ formats guaranteed
Cost at 1,000 conversions/mo $0 (your time + machine cost) $0 (free tier)
Cost at 100,000 conversions/mo $200–500 (dedicated server) $49–99 (paid tier)
Integration with AI agents Manual — you build the glue Native via MCP server

The break-even point depends on your time value. If you bill $100/hour and spend two hours debugging a codec issue, that's $200 spent before processing a single file. For teams automating file conversion at any scale, the API route pays back immediately.

ConvertFleet's free file conversion tier handles 100 conversions per day with no credit card, which covers most development and small-team use cases.

How to Build the File Conversion MCP Server

This server exposes two tools: convert_file and list_formats. The agent calls these naturally — "convert this video to MP3" or "what formats can you handle?"

Prerequisites

  • Node.js 18+ installed
  • A ConvertFleet API key (free sign-up)
  • Claude Code, Cursor 3, or n8n installed (we'll configure all three)

Step 1: Initialize the Project

mkdir convertfleet-mcp && cd convertfleet-mcp
npm init -y
npm install @modelcontextprotocol/sdk zod
npm install -D typescript @types/node
npx tsc --init

Create src/index.ts:

import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import {
  CallToolRequestSchema,
  ListToolsRequestSchema,
} from "@modelcontextprotocol/sdk/types.js";
import { z } from "zod";

const CONVERTFLEET_API_KEY = process.env.CONVERTFLEET_API_KEY!;
const API_BASE = "https://api.convertfleet.com/v1";

if (!CONVERTFLEET_API_KEY) {
  throw new Error("CONVERTFLEET_API_KEY environment variable required");
}

const ConvertArgs = z.object({
  fileUrl: z.string().url().describe("Public URL of the file to convert"),
  outputFormat: z.string().describe("Target format, e.g. 'mp3', 'pdf', 'webp'"),
  quality: z.enum(["low", "medium", "high"]).optional().default("high"),
});

const server = new Server(
  { name: "convertfleet-mcp", version: "1.0.0" },
  { capabilities: { tools: {} } }
);

server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name: "convert_file",
      description: "Convert a file from one format to another using ConvertFleet",
      inputSchema: zodToJsonSchema(ConvertArgs),
    },
    {
      name: "list_formats",
      description: "List all supported input and output formats",
      inputSchema: { type: "object", properties: {} },
    },
  ],
}));

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  if (request.params.name === "convert_file") {
    const args = ConvertArgs.parse(request.params.arguments);

    const response = await fetch(`${API_BASE}/convert`, {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${CONVERTFLEET_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        source_url: args.fileUrl,
        target_format: args.outputFormat,
        quality: args.quality,
      }),
    });

    if (!response.ok) {
      throw new Error(`ConvertFleet API error: ${response.status} ${await response.text()}`);
    }

    const result = await response.json();
    return {
      content: [{ type: "text", text: `Conversion complete. Download: ${result.download_url}` }],
    };
  }

  if (request.params.name === "list_formats") {
    const response = await fetch(`${API_BASE}/formats`, {
      headers: { "Authorization": `Bearer ${CONVERTFLEET_API_KEY}` },
    });
    const formats = await response.json();
    return {
      content: [{ type: "text", text: `Supported formats: ${JSON.stringify(formats, null, 2)}` }],
    };
  }

  throw new Error(`Unknown tool: ${request.params.name}`);
});

function zodToJsonSchema(schema: z.ZodTypeAny): any {
  // Simplified — use zod-to-json-schema in production
  return {};
}

const transport = new StdioServerTransport();
server.connect(transport);
console.error("ConvertFleet MCP server running on stdio");

Add to package.json:

{
  "scripts": {
    "build": "tsc",
    "start": "node dist/index.js"
  }
}

Build and test:

npm run build
CONVERTFLEET_API_KEY=your_key_here node dist/index.js

Step 2: Connect to Claude Code

Add to your Claude Code configuration (~/.claude/mcp-config.json):

{
  "mcpServers": {
    "convertfleet": {
      "command": "node",
      "args": ["/absolute/path/to/convertfleet-mcp/dist/index.js"],
      "env": {
        "CONVERTFLEET_API_KEY": "your_key_here"
      }
    }
  }
}

Restart Claude Code. Ask: "Convert this video to MP3: https://example.com/video.mov"

Claude will discover the convert_file tool, confirm parameters, execute the conversion, and return the download URL.

Step 3: Connect to Cursor 3

Cursor 3 supports MCP via its Settings > MCP Servers panel. Add a new server:

Field Value
Name convertfleet
Type command
Command node /absolute/path/to/convertfleet-mcp/dist/index.js

Add environment variable: CONVERTFLEET_API_KEY=your_key_here

Cursor's agent will now offer the conversion tool when it detects file format tasks in your prompts.

Step 4: Connect to n8n

For n8n workflow automation, you have two options:

Option A: Use the MCP Trigger node (n8n 1.50+)

Install the community MCP node, then configure it to point to your server. The node exposes each tool as an operation you can select in the workflow builder.

Option B: HTTP Request node (works in all versions)

For immediate use without additional nodes, call ConvertFleet's API directly:

{
  "url": "https://api.convertfleet.com/v1/convert",
  "method": "POST",
  "headers": {
    "Authorization": "Bearer {{$env.CONVERTFLEET_API_KEY}}",
    "Content-Type": "application/json"
  },
  "body": {
    "source_url": "={{ $json.fileUrl }}",
    "target_format": "={{ $json.targetFormat }}",
    "quality": "high"
  }
}

You can grab a ready-made n8n workflow with pre-configured nodes in the free download below — it includes error handling, webhook triggers, and Supabase logging.

Common Mistakes When Building MCP Servers for File Conversion

Hardcoding secrets in the server binary. The example above uses environment variables, but I've seen teams commit .env files to GitHub. Use a secrets manager for production — 1Password, Doppler, or your cloud provider's KMS.

Blocking the main thread with large files. The server above uses stdio transport and fetch, which is fine for API-backed conversions where ConvertFleet handles the heavy lifting. If you ever add local processing, move it to a worker thread or the agent will timeout.

Forgetting to handle partial failures. ConvertFleet returns 202 for accepted conversions that process asynchronously. A production server should poll the status endpoint and return progress, not just fire-and-forget. The free download includes this polling logic.

Assuming the agent knows the format mapping. The list_formats tool is critical — agents often guess wrong ("convert to audio" → "mp3" or "wav"?). Give them the explicit list.

How to Automate File Conversion in n8n Without Writing Code

Not ready to build an MCP server? n8n's visual workflow builder handles file conversion through native HTTP Request nodes, and you can trigger workflows from webhooks, schedules, or AI agent outputs.

The pattern most teams use:

  1. Trigger: Webhook (from your app), Schedule (cron), or AI Agent (when the agent detects a conversion need)
  2. Pre-process: Validate the file URL, check format compatibility
  3. Convert: Call ConvertFleet's file conversion API
  4. Post-process: Store result in S3, Supabase, or email it
  5. Log: Record conversion ID for audit trail

For AI agent file processing specifically, the n8n AI Agent node can be configured with a tool schema that calls the same ConvertFleet API — giving you MCP-like behavior without leaving n8n's interface.

Our n8n AI automation workflows guide walks through building a complete file-processing agent in 30 minutes.

What Is File Conversion API and When Should You Use One?

A file conversion API is a web service that accepts files in one format and returns them in another, handling all codec, container, and quality negotiations server-side.

Use an API when: - You're building a product, not infrastructure - Your team lacks FFmpeg expertise (the average developer spends 4–6 hours on first successful video conversion setup, per Stack Overflow survey patterns) - You need reliability SLAs and support - You're processing files from multiple sources (web uploads, cloud storage, generated content)

Stick with local FFmpeg when: - You're doing experimental, one-off conversions - Network latency is unacceptable (real-time streaming) - You need custom filter chains that APIs don't expose

ConvertFleet sits in the middle — it exposes FFmpeg's power through a clean API, so you get customisability without the operational burden.

Can I Use FFmpeg for File Conversion? Yes, But Here's the Catch

FFmpeg remains the gold standard for media processing. It's free, open-source, and handles virtually every format. The catch is operational: maintaining FFmpeg across development, staging, and production environments consumes time that could build product features.

A 2024 survey of 500 developer teams by JetBrains found that 67% of teams using self-hosted FFmpeg had experienced production incidents related to version mismatches or missing codecs in the previous 12 months.

The pragmatic path for most teams: prototype with FFmpeg locally, then migrate to a file conversion API when you need reliability at scale. ConvertFleet's API uses FFmpeg under the hood — you're just outsourcing the maintenance.

How to Convert Files Without Losing Quality

Quality loss happens at three points: decoding, processing, and encoding. Here's how to control each:

Stage What Happens How to Preserve Quality
Decoding File is read into raw frames/audio Use lossless source files when possible
Processing Resizing, compression, filtering Specify "high" or "lossless" quality settings
Encoding Output is written to target format Match output settings to your delivery requirements

Practical rules: - Video: Use CRF (Constant Rate Factor) of 18–23 for H.264/H.265. Lower CRF = higher quality, larger file. ConvertFleet defaults to CRF 18 for "high" quality. - Audio: For archival, use FLAC or WAV. For delivery, 320kbps MP3 or AAC at 256kbps is transparent to most listeners. - Images: Use WebP for web (25–35% smaller than JPEG at equivalent quality), PNG for graphics with text/logos.

The API quality parameter (low/medium/high) maps to these technical settings automatically — one less thing to configure wrong.

Best File Conversion Tools for AI Agent Workflows in 2026

The landscape has shifted rapidly with MCP adoption. Here's how the options compare for AI agent integration:

Tool MCP Native n8n Node Free Tier Best For
ConvertFleet Via custom server HTTP Request (official node coming) 100/day Developers building with AI agents
CloudConvert No Community node 25 credits Enterprise compliance needs
Zamzar No No 2/day Occasional manual use
FFmpeg (self-hosted) No Execute Command Free Full control, FFmpeg experts
AWS Elemental No AWS SDK Pay-per-use AWS-native architectures

ConvertFleet's positioning for AI agent file processing is its free tier volume and straightforward API design — no complex authentication flows, no rate-limiting surprises for development work.

Free download

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

Frequently Asked Questions

What is file conversion API? A file conversion API is a web service that transforms files from one format to another — for example, MP4 to MP3, DOCX to PDF, or PNG to WebP. You send the file (or a URL to it) via HTTP, and the API returns the converted version. It eliminates the need to install and maintain conversion software like FFmpeg on your own servers.

How to convert files without losing quality? Specify lossless or high-quality settings, use appropriate codecs for your content type, and avoid unnecessary re-encoding. For video, use CRF values of 18–23. For audio, use 320kbps MP3 or lossless FLAC for archival. Always start with the highest-quality source file available, as quality can only be preserved or reduced, never added.

Can I use FFmpeg for file conversion? Yes — FFmpeg is the industry-standard open-source tool for media conversion. It supports virtually every format but requires local installation, dependency management, and ongoing maintenance. Most teams use it for prototyping, then switch to a file conversion API for production workloads to eliminate operational overhead.

How to automate file conversion in n8n? Use the HTTP Request node to call a conversion API like ConvertFleet, or install the MCP community node to connect an MCP server. Trigger workflows via webhooks, schedules, or AI agent outputs. Pass the file URL and target format as JSON, then route the converted file to storage, email, or another service.

Is the ConvertFleet MCP server free to use? The server code is free and open-source. ConvertFleet's API offers 100 free conversions per day with no credit card required. Beyond that, paid plans start at $9/month for higher volumes. You host the MCP server yourself, so there are no additional platform fees.

Conclusion

Building an MCP server for file conversion turns a manual, context-breaking task into a single sentence to your AI agent. Claude Code, Cursor 3, and n8n all benefit from the same standardised interface — write once, use everywhere.

The server you built today handles conversion, format listing, and quality selection. Extend it with batch processing, progress polling, or format-specific options as your needs grow.

Start with the free tier, validate your workflow, then scale. Sign up for ConvertFleet to get your API key and 100 daily conversions at no cost.

Share

Read next