File Converter MCP server

Provides file conversion capabilities for transforming documents and images between formats like DOCX, PDF, Excel, CSV, and HTML without external tools
Back to servers
Provider
wowyuarm
Release date
Mar 13, 2025
Language
Python
Stats
11 stars

The File Converter MCP server provides multiple tools for converting various document and image formats. Built on the Model Context Protocol (MCP), it enables AI agents to transform files between formats like DOCX, PDF, images, Excel, HTML, and Markdown.

Installation

Prerequisites

  • Python 3.10+
  • Various conversion libraries (installed in the steps below)

Setup Instructions

  1. Clone the repository

    git clone https://github.com/wowyuarm/file-converter-mcp.git
    cd file-converter-mcp
    
  2. Create a virtual environment (recommended)

    python -m venv venv
    
    # On Unix/Linux/macOS
    source venv/bin/activate
    
    # On Windows
    venv\Scripts\activate
    
  3. Install dependencies

    pip install mcp docx2pdf pdf2docx pillow pandas pdfkit markdown
    

    Alternatively, using uv:

    uv add "mcp[cli]" docx2pdf pdf2docx pillow pandas pdfkit markdown
    

    Note: Some conversion libraries may require additional system dependencies. Check their documentation for details.

Running the Server

Development Mode

To run the server in development mode:

mcp dev file_converter_server.py

Install on Claude Desktop

To make the server available on Claude Desktop:

mcp install file_converter_server.py --name "File Converter"

Available Conversion Tools

DOCX to PDF Conversion

@File Converter
docx2pdf
input_file: path/to/document.docx

or with direct content:

@File Converter
docx2pdf
file_content_base64: [base64 encoded string]

PDF to DOCX Conversion

@File Converter
pdf2docx
input_file: path/to/document.pdf

Image Format Conversion

@File Converter
convert_image
input_file: path/to/image.png
output_format: jpg

or:

@File Converter
convert_image
file_content_base64: [base64 encoded string]
input_format: png
output_format: jpg

Excel to CSV Conversion

@File Converter
excel2csv
input_file: path/to/spreadsheet.xlsx

HTML/Markdown to PDF

@File Converter
html2pdf
input_file: path/to/document.html

Generic File Conversion

For versatile conversion between supported formats:

@File Converter
convert_file
input_file: path/to/file.docx
input_format: docx
output_format: pdf

or with direct content:

@File Converter
convert_file
file_content_base64: [base64 encoded string]
input_format: docx
output_format: pdf

Troubleshooting File Handling

If Claude or another agent can't find your uploaded file:

  1. Try specifying a full path

    @File Converter
    docx2pdf
    input_file: /tmp/file.docx
    
  2. Use content-based conversion instead

    @File Converter
    docx2pdf
    file_content_base64: [base64 encoded string]
    

The server implements a robust file search strategy that:

  • Looks in common upload locations
  • Tries multiple filename variations
  • Works with relative and absolute paths
  • Supports content-based input as a fallback option

All conversions return either:

  • Success: {"success": true, "data": "base64 encoded file content"}
  • Error: {"success": false, "error": "error message"}

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later