Skip to main content
Back to Blog

Developer & APIsJul 11, 20265 min read

MCP File Converter: Add Conversion to Claude & Cursor Agents

Hasnain NisarAutomation engineer · Nisar Automates
MCP File Converter: Add Conversion to Claude & Cursor Agents

MCP File Converter: Add Conversion to Claude & Cursor Agents

TL;DR: - MCP (Model Context Protocol) lets AI agents call external tools as named functions — like convert_to_pdf or extract_audio - Wrapping a file conversion API for developers as an MCP server eliminates local ffmpeg/LibreOffice dependencies - Claude Code, Cursor, and LangChain agents can all consume the same MCP server with zero configuration drift - This guide ships a ready-to-paste mcp-config.json you can run in minutes

Your agent needs to convert a video to MP3, compress a PDF, or resize an image. You could install ffmpeg on every machine, manage LibreOffice versions, and debug font dependencies. Or you could expose a clean convert_file tool that your agent calls like any other function. That's what MCP — the protocol Anthropic open-sourced and OpenAI, Cursor, and Vercel all adopted by mid-2026 — makes hungrily devours. With over 97 million monthly SDK downloads, MCP has become the standard way to give AI agents real capabilities without bloating their environment.

This guide shows you how to wrap Convert Fleet's file conversion API for developers into a lightweight MCP server. Your Claude Code routines, Cursor agents, or custom LangChain pipelines get convert_to_pdf, extract_audio, and resize_image as first-class tools. No local binaries. No version hell. Just an API key and a JSON config.

What Is a File Conversion API for Developers?

Mcp file converter claude cursor agents architecture

A file conversion API for developers is a programmatic service that transforms files between formats — PDF to Word, MP4 to MP3, HEIC to PNG — via HTTP requests rather than local software. It handles format detection, codec negotiation, and output delivery so your code doesn't have to.

Most teams hit the wall with local conversion when they scale. ffmpeg works until you need it on three serverless runtimes. LibreOffice headless mode breaks on certain fonts. ImageMagick security policies block common operations. A file conversion API for developers pushes that complexity to a managed service. You send a file, specify the output format, and receive a converted result or a download URL.

The best APIs in this class — including Convert Fleet, Zamzar, and CloudConvert — support 100+ formats, offer n8n/Zapier nodes, and return webhooks on completion. For agent use, the critical feature is synchronous or fast-polling endpoints: agents timeout if conversion takes 30 seconds with no response.

Why MCP Is the Right Protocol for File Conversion Tools

Mcp file converter claude cursor agents comparison

MCP (Model Context Protocol) standardizes how AI agents discover and call external tools. Anthropic released it in late 2024; by mid-2026, OpenAI's Agents SDK, Cursor's agent mode, and Vercel's AI SDK all ship native MCP support. The protocol uses JSON-RPC over stdio or HTTP, with automatic tool discovery via a tools/list endpoint.

For file conversion, MCP solves three real problems:

  1. Environment isolation. Your agent runs in a container with no ffmpeg, no LibreOffice, no system fonts. An MCP server calling an API keeps it that way.
  2. Tool discoverability. Instead of hardcoding conversion logic, the agent reads available tools from the server and chooses based on the task.
  3. Reusability across agents. The same MCP server works in Claude Code, Cursor, a LangChain agent, or a custom orchestrator. No per-platform adapters.

The protocol's growth has been explosive. MCP SDK downloads hit 97 million monthly by June 2026, according to npm and PyPI aggregate data reported by Anthropic's developer relations team. That scale means tooling, documentation, and community solutions now exist for most integration patterns — including the one below.

How to Build the MCP File Converter Server

This section walks through building a minimal but production-ready MCP server that wraps Convert Fleet's file conversion API for developers. You'll need Node.js 18+, an API key from Convert Fleet, and about 15 minutes.

Prerequisites

  • Node.js 18+ and npm installed
  • A Convert Fleet API key (free tier includes 100 conversions/month)
  • Basic familiarity with TypeScript (the example uses it; JavaScript works too)

Step 1: Initialize the Project

Create a directory and install dependencies:

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

Step 2: Define the Tool Schemas

MCP servers expose tools with JSON Schema definitions. For file conversion, define three tools: convert_to_pdf, extract_audio, and resize_image. Each takes a source URL and parameters, returns a job ID for polling.

Create src/tools.ts:

import { z } from 'zod';

export const ConvertToPdfSchema = z.object({
  sourceUrl: z.string().url().describe("Public URL of the file to convert"),
  outputQuality: z.enum(['standard', 'high', 'print']).optional()
    .describe("PDF quality preset")
});

export const ExtractAudioSchema = z.object({
  sourceUrl: z.string().url().describe("Public URL of the video file"),
  format: z.enum(['mp3', 'wav', 'aac', 'flac']).default('mp3'),
  bitrate: z.enum(['128k', '192k', '320k']).optional()
});

export const ResizeImageSchema = z.object({
  sourceUrl: z.string().url(),
  width: z.number().int().positive(),
  height: z.number().int().positive().optional(),
  maintainAspect: z.boolean().default(true),
  format: z.enum(['jpeg', 'png', 'webp']).optional()
});

Step 3: Implement the Server

Create src/server.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 { ConvertToPdfSchema, ExtractAudioSchema, ResizeImageSchema } from './tools';

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

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

server.setRequestHandler(ListToolsRequestSchema, async () => ({
  tools: [
    {
      name: 'convert_to_pdf',
      description: 'Convert a document or image to PDF using Convert Fleet',
      inputSchema: zodToJsonSchema(ConvertToPdfSchema)
    },
    {
      name: 'extract_audio',
      description: 'Extract audio track from a video file',
      inputSchema: zodToJsonSchema(ExtractAudioSchema)
    },
    {
      name: 'resize_image',
      description: 'Resize and optionally reformat an image',
      inputSchema: zodToJsonSchema(ResizeImageSchema)
    }
  ]
}));

server.setRequestHandler(CallToolRequestSchema, async (request) => {
  const { name, arguments: args } = request.params;

  // Map tool calls to Convert Fleet API
  const endpoint = {
    convert_to_pdf: '/convert/pdf',
    extract_audio: '/extract/audio',
    resize_image: '/convert/image'
  }[name]!;

  const response = await fetch(`${API_BASE}${endpoint}`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(args)
  });

  const result = await response.json();
  return { content: [{ type: 'text', text: JSON.stringify(result) }] };
});

async function zodToJsonSchema(schema: any) {
  // Use zod-to-json-schema in production; simplified here
  return {};
}

const transport = new StdioServerTransport();
await server.connect(transport);

Step 4: Configure Claude Code or Cursor

Add to your project's mcp-config.json or .cursor/mcp.json:

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

Restart Claude Code or Cursor. The agent now sees convert_to_pdf, extract_audio, and resize_image as available tools. Ask it to "convert this DOCX to PDF" and it calls the tool, polls the job, and returns the download URL.

Grab the complete, production-hardened mcp-config.json and server template in the free download below — it includes error handling, job polling, and TypeScript types.

MCP vs. Direct API Calls: Which Approach Wins?

Teams building automation workflows face a real architectural choice: call a file conversion API directly from n8n/Pipedream, or route everything through an MCP server. Both work. The difference shows up in maintenance and flexibility.

Dimension Direct API Integration MCP Server Wrapper
Setup time 10–15 min per platform 30 min once, reusable everywhere
Agent compatibility Requires per-platform code Works in Claude, Cursor, LangChain, any MCP(match MCP client
Tool discovery Hardcoded endpoints Automatic tools/list introspection
Environment deps None (pure HTTP) None (runs as separate process)
Debugging Standard HTTP logs MCP protocol tracing needed
Best for Single-platform automation Multi-agent, AI-native workflows

Direct integration wins for simple file conversion for automation in one tool — say, an fixed n8n workflow that converts uploaded files. The MCP approach wins when you have multiple agents, changing requirements, or want to expose conversion as a capability any AI can discover. Most teams we see start with direct API calls, then migrate to MCP once they hit three or more agent touchpoints.

Common Mistakes When Wiring File Conversion into Agents

Oversized files timeout silently. Agents often have 30–60 second execution limits. A 500MB video conversion will fail opaquely. Pre-validate file size or use webhook-based async patterns.

Missing format support assumptions. Your agent assumes "convert to DOCX" works for every input. It doesn't — scanned PDFs need OCR first, proprietary formats need specific converters. Surface format limitations in tool descriptions so the LLM reasons around them.

No retry logic on 429 rate limits. Free tiers throttle aggressively. A basic MCP server forwards the error; a robust one implements exponential backoff. The difference is a working demo versus a production integration.

Forgetting output URL expiry. Converted file links often expire in 24 hours. Your agent must download or forward the result promptly, not store the URL for later. We learned this the hard way with a document ingestion pipeline that broke every Monday morning.

How to Integrate n8n with File Conversion Tools

For teams already running automation workflows, n8n offers the fastest path to file conversion without writing code. Convert Fleet's n8n node appears in the community node directory — search "Convert Fleet" in n8n's node panel.

A typical pattern: Trigger (new file in Google Drive / S3 / email attachment) → Convert Fleet node (convert to target format) → Upload to destination (Dropbox, SharePoint, another S3 bucket). The node handles polling, error retries, and binary data passing between steps.

For MCP-native n8n workflows, use the HTTP Request node to call your MCP server directly, or wrap the MCP server as a custom n8n node. The free download includes a ready-to-import n8n workflow JSON that demonstrates both patterns — grab it below and adapt to your stack.

What Are the Different Types of File Formats Supported by Convert Fleet?

Convert Fleet handles 178+ formats across six categories:

  • Documents: PDF, DOCX, DOC, ODT, RTF, TXT, EPUB, MOBI, AZW3
  • Spreadsheets: XLSX, XLS, CSV, ODS, TSV
  • Presentations: PPTX, PPT, ODP, KEY
  • Images: JPEG, PNG, WEBP, HEIC, TIFF, BMP, SVG, ICO, RAW formats
  • Audio: MP3, WAV, AAC, FLAC, OGG, M4A, AIFF, WMA
  • Video: MP4, AVI, MOV, WMV, FLV, MKV, WEBM, MPEG, 3GP

The API auto-detects input format from file headers, not extensions — so a misnamed .jpg file identified as HEIC still converts correctly. Output format is specified per-request. For bulk file conversion, queue up to 100 files in a single batch job with a shared callback webhook.

Beyond 123apps: Why Developers Move to APIs

Browser-based tools like 123apps work for one-off conversions. They break down in production: no API access, no batching, no webhook notifications, no SLA. When we audited teams that had outgrown manual tools, the pattern was consistent — around 50 files/week was the pain threshold where free file conversion tools became a bottleneck.

A file conversion API for developers replaces that friction with programmable scale. The same HTTP call converts one file or ten thousand. Webhooks notify your system on completion. Format support stays current without local updates. For teams building automation workflows, that's the difference between a working prototype and a reliable pipeline.

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 between formats via HTTP requests. You send a file and target format; the API returns the converted result or a download URL. It eliminates local software dependencies for format conversion.

How to automate file conversion? Use a file conversion API for developers within an automation platform like n8n, Make, or Pipedream. Trigger on file upload, call the conversion endpoint, and route the output to storage or notification. For AI agents, wrap the API as an MCP server for tool-based discovery.

How to integrate n8n with file conversion tools? Install the Convert Fleet community node in n8n, or use the HTTP Request node to call any file conversion API directly. Pass binary data between nodes, handle errors with n8n's retry logic, and use webhooks for async completion if conversion time exceeds your workflow timeout.

What are the different types of file formats supported by Convert Fleet? Convert Fleet supports 178+ formats across documents, spreadsheets, presentations, images, audio, and video. This includes PDF, DOCX, MP3, MP4, WEBP, HEIC, and many specialized formats like ICO, ODP, and RAW camera files.

Is MCP better than direct API integration for file conversion? MCP is better for multi-agent or AI-native workflows where tool discoverability matters. Direct API integration is faster to set up for single-platform automation. Many teams start with direct APIs and migrate to MCP as their agent ecosystem grows.

Conclusion

MCP has become the default protocol for giving AI agents real capabilities. Wrapping a file conversion API for developers as an MCP server turns format conversion from an environment headache into a discoverable, reusable tool. Your Claude Code routines, Cursor agents, and n8n workflows all speak the same interface.

Start with the mcp-config.json and server template — grab the free download below. Test it with a single convert_to_pdf call. Once you see the agent handle conversion without local dependencies, you'll want every external capability exposed the same way.

Convert Fleet runs a free tier with 100 conversions monthly — enough to prototype and validate before you commit. Sign up, generate your API key, and give your agents the tools they actually need.

Share

Read next