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
Setup instructions
Provider
wowyuarm
Release date
Mar 13, 2025
Language
Python
Stats
17 stars

The File Converter MCP server provides multiple document and image conversion tools designed for AI agents. It enables conversion between various formats including DOCX, PDF, images, Excel, HTML, and Markdown using the Model Context Protocol (MCP).

Installation

Prerequisites

  • Python 3.10 or higher
  • Various conversion libraries (will be installed in the next steps)

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
    source venv/bin/activate      # On Unix-based systems
    venv\Scripts\activate         # On Windows
    
  3. Install Dependencies

    Using pip:

    pip install mcp docx2pdf pdf2docx pillow pandas pdfkit markdown
    

    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 test the server locally:

mcp dev file_converter_server.py

Installing on Claude Desktop

To make the server available in Claude Desktop:

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

Available Conversion Tools

Main Tools (Support Both Path and Content Input)

DOCX to PDF Conversion

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

Or with 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 with content:

@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 Conversion

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

Generic File Conversion

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

Legacy Content-Based Tools

These tools are maintained for backward compatibility:

  • convert_content: Generic content conversion
  • docx2pdf_content: Convert DOCX content to PDF
  • pdf2docx_content: Convert PDF content to DOCX
  • markdown2pdf_content: Convert Markdown content to PDF

Troubleshooting File Path Issues

If the server can't find your uploaded file:

  1. Try specifying a full path:

    @File Converter
    docx2pdf
    input_file: /tmp/file.docx
    
  2. If that fails, use content-based input:

    @File Converter
    docx2pdf
    file_content_base64: [base64 content]
    

Setting Up as an MCP Server

  1. Install dependencies:

    python -m pip install -e .
    
  2. Start the MCP server:

    python start_mcp_server.py
    
  3. Configure your MCP client with the following configuration:

    Recommended configuration (cursor-mcp.config.json):

    {
      "mcpServers": {
        "file-converter": {
          "command": "python",
          "args": ["file_converter_server.py"],
          "cwd": "."
        }
      }
    }
    

Error Handling

The server provides structured error responses:

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

All tools validate file existence using multiple search strategies and provide detailed error messages to help troubleshoot issues.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "file-converter" '{"command":"python","args":["file_converter_server.py"],"cwd":"."}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "file-converter": {
            "command": "python",
            "args": [
                "file_converter_server.py"
            ],
            "cwd": "."
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "file-converter": {
            "command": "python",
            "args": [
                "file_converter_server.py"
            ],
            "cwd": "."
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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