Labsco
convertguru logo

File Convert MCP Server

β˜… 5

from convertguru

Convert files between various formats, including images, documents, audio, video, and more.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

File Convert MCP Server

smithery badge

A Model Context Protocol (MCP) server for converting files between various formats.

File Convert is an MCP server designed to handle the conversion of a wide array of file formats, including images, office documents, audio, video, text, and data files. It aims to provide seamless transformation into popular formats such as PDF, JPG, MP4, and HTML, among others. This server offers a set of powerful tools to convert diverse file types into easily accessible and widely compatible formats like PDF, JPG, PNG, TXT.

✨ Features

  • Intelligent File Type Detection: Employs a combination of AI, TrID, and magic bytes for accurate file type identification.
  • Versatile File Conversion: Supports conversion between numerous file types and the following popular formats:
    • Images: Handles a vast range of formats, including many legacy ones. Converts to PDF, JPG, PNG.
    • Office Documents: Converts to PDF, TXT, HTML.
    • Audio/Video: Converts to MP3, MP4.
    • Databases: Converts to CSV.
    • Various Files: Offers conversion capabilities for other file types as well.

πŸ› οΈ Development

Get started with local development by following these steps:

1. Clone the repository:

Copy & paste β€” that's it
git clone https://github.com/convertguru/file-convert-mcp.git

2. Fetch and cache Python dependencies (optional, uvx handles this automatically):

Copy & paste β€” that's it
cd file-convert-mcp
uv sync
cd ..

3. Create .env file with your (optional for now) API key:

Copy & paste β€” that's it
echo "CONVERT_GURU_API_KEY=your_api_key_here" > file-convert-mcp/.env

4. Run the MCP server locally using various uv commands:

Copy & paste β€” that's it
# Using uvx with .env file from the local directory
cd file-convert-mcp
UV_ENV_FILE=.env uvx --from ./file-convert-mcp file-convert-mcp

# OR using uv directly to run the server script
uv run file-convert-mcp/src/file_convert_mcp/server.py

# OR specifying the directory for uv
uv --directory file-convert-mcp/src/file_convert_mcp run server.py

# OR navigating into the server directory
cd file-convert-mcp/src/file_convert_mcp
uv run server.py

# OR using uvx to fetch the core from the GitHub repository + local .env file
UV_ENV_FILE=.env uvx --from git+https://github.com/convertguru/file-convert-mcp.git file-convert-mcp

# OR run with HTTP transport on custom port
TRANSPORT=http PORT=9000 uv run file-convert-mcp/src/file_convert_mcp/server.py

# OR run with stdio transport (default)
TRANSPORT=stdio uv run file-convert-mcp/src/file_convert_mcp/server.py

5. Create .env file with your configuration (optional for now):

Copy & paste β€” that's it
# Basic configuration
echo "CONVERT_GURU_API_KEY=your_api_key_here" > file-convert-mcp/.env

# OR with transport configuration
echo "CONVERT_GURU_API_KEY=your_api_key_here" > file-convert-mcp/.env
echo "TRANSPORT=http" >> file-convert-mcp/.env
echo "PORT=8000" >> file-convert-mcp/.env

6. Modify the server logic if needed: Edit the main server file located at src/file_convert_mcp/server.py.

7. Clearing the uv Cache (if needed): If uv has cached an older version of the code in ~/.cache/uv, you might need to clear the cache. Alternatively, use uv with the -n or --no-cache option to bypass it.

βš™οΈ Available Tools

The MCP server provides the following tools:

  • detect_file_type: Analyzes the first 200 bytes of an uploaded file and uses the Convert.Guru API to determine its type.
  • convert_file: Converts a given file to a specified output format. The desired file extension should be passed as the ext_out parameter.

πŸ“œ License

Visit us https://convert.guru

This project is licensed under the MIT License - see the LICENSE file for complete details.