You signed in with another tab or window. Reload
to refresh your session. You signed out in another tab or window. Reload
to refresh your session. You switched accounts on another tab or window. Reload
to refresh your session. Dismiss alert
wowyuarm / file-converter-mcp Public
A MCP server that provides file conversion tools
3 stars
0 forks
Branches
Tags
Activity
Notifications
You must be signed in to change notification settings
main
Go to file
Code
| Name | | Name | Last commit message | Last commit date |
| --- | --- | --- | --- |
| Latest commit
-------------
History
-------
4 Commits
| | |
| .github | | .github | | |
| .gitignore | | .gitignore | | |
| CONTRIBUTING.md | | CONTRIBUTING.md | | |
| CONTRIBUTING_EN.md | | CONTRIBUTING_EN.md | | |
| LICENSE | | LICENSE | | |
| README.md | | README.md | | |
| README_CN.md | | README_CN.md | | |
| file_converter_server.py | | file_converter_server.py | | |
| pyproject.toml | | pyproject.toml | | |
| uv.lock | | uv.lock | | |
| View all files | | |
简体中文
| English
This MCP server provides multiple file conversion tools for converting various document and image formats. This project is built using the Model Context Protocol (MCP)
and is designed to serve AI agents that need file conversion capabilities.
Various conversion libraries:
Clone the Repository
shell
git clone https://github.com/wowyuarm/file-converter-mcp.git
cd file-converter-mcp
Create a Virtual Environment (optional but recommended)
shell
python -m venv venv
source venv/bin/activate # On Unix-based systems
venv\Scripts\activate # On Windows
Install Dependencies
Install the required packages using pip:
shell
pip install mcp docx2pdf pdf2docx pillow pandas pdfkit markdown
Alternatively, if you are using uv
:
shell
uv add "mcp[cli]" docx2pdf pdf2docx pillow pandas pdfkit markdown
Note: Some conversion libraries may have additional system dependencies. Please check their documentation for details.
To test the server, run:
mcp dev file_converter_server.py
Optionally, you can install the server on Claude Desktop with:
mcp install file_converter_server.py --name "File Converter"
The MCP server exposes the following tools:
Command: docx2pdf
Input Option 1: Path to a .docx file
input_file: path/to/document.docx
Input Option 2: Base64 encoded content of the DOCX file
file_content_base64: [base64 encoded string]
Output: Base64 encoded string of the converted PDF file
Command: pdf2docx
Input Option 1: Path to a PDF file
input_file: path/to/document.pdf
Input Option 2: Base64 encoded content of the PDF file
file_content_base64: [base64 encoded string]
Output: Base64 encoded string of the converted DOCX file
Command: convert_image
Input Option 1:
input_file: path/to/image.png
output_format: jpg
Input Option 2:
file_content_base64: [base64 encoded string]
input_format: png
output_format: jpg
Output: Base64 encoded string of the converted image
Command: excel2csv
Command: html2pdf
Command: convert_file
Input Option 1:
input_file: path/to/file.docx
input_format: docx
output_format: pdf
Input Option 2:
file_content_base64: [base64 encoded string]
input_format: docx
output_format: pdf
Output: Base64 encoded string of the converted file
These are maintained for backward compatibility. All main tools now support content-based input directly.
Command: convert_content
Command: docx2pdf_content
Command: pdf2docx_content
Command: markdown2pdf_content
The server includes robust file path handling that:
All conversion tools now support two methods of input:
Path-Based Conversion (traditional approach)
@File Converter
docx2pdf
input_file: file.docx
Content-Based Conversion (works even when path lookup fails)
@File Converter
docx2pdf
file_content_base64: [base64 encoded string]
This dual-mode approach provides maximum flexibility and reliability:
When using with Claude, if a file upload fails to be found:
Try using the original filename with a preceding path:
@File Converter
docx2pdf
input_file: /tmp/file.docx
If that fails, obtain the file content directly from Claude:
@File Converter
docx2pdf
file_content_base64: [base64 content obtained from Claude]
{"success": false, "error": "error message"}
{"success": true, "data": "base64 encoded file content"}
Contributions are welcome! If you'd like to contribute, please follow the guidelines in CONTRIBUTING.md
(中文版: 贡献指南
, English: Contributing Guidelines
).
This project is licensed under the MIT License – see the LICENSE
file for details.
Visit the GitHub repository at: https://github.com/wowyuarm/file-converter-mcp
A MCP server that provides file conversion tools
No releases published
No packages published
You can’t perform that action at this time.