A lightweight Model Context Protocol (MCP) server that converts documents to Markdown. Supports PDF, DOCX, HTML, EPUB, CSV, JSON, and plain text files.
Perfect for AI agents that need to ingest and understand document content.
- π Multi-format support: PDF, DOCX, HTML, EPUB, CSV, JSON, images (via OCR), and plain text
- π§ 6 MCP tools:
convert_file,convert_url,list_supported_formats,batch_convert,extract_metadata,convert_directory - π Zero external dependencies for core: Uses Python standard library +
markdownifyfor HTML - β‘ Fast: In-memory processing, no temp files
- π³ Docker-ready: Single Dockerfile, one command deploy
# Clone
git clone https://github.com/demo112/mcp-server-convert.git
cd mcp-server-convert
# Install dependencies
pip install -r requirements.txt
# Run
python -m mcp_server_convertAdd to your MCP settings (~/.claude/settings.json):
{
"mcpServers": {
"convert": {
"command": "python",
"args": ["-m", "mcp_server_convert"],
"cwd": "/path/to/mcp-server-convert"
}
}
}docker build -t mcp-server-convert .
docker run -i --rm mcp-server-convert{
"mcpServers": {
"convert": {
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "/path/to/files:/data", "mcp-server-convert"]
}
}
}Convert a local file to Markdown.
Parameters:
file_path(string, required): Absolute path to the filemax_length(int, optional): Maximum output length in chars (default: 50000)
Fetch a URL and convert its content to Markdown.
Parameters:
url(string, required): URL to fetch and convertmax_length(int, optional): Maximum output length in chars (default: 50000)
Convert multiple files at once.
Parameters:
file_paths(array of strings, required): List of file pathsmax_length_per_file(int, optional): Max length per file (default: 50000)
Convert all supported files in a directory.
Parameters:
dir_path(string, required): Path to directoryrecursive(bool, optional): Include subdirectories (default: true)max_files(int, optional): Maximum files to convert (default: 20)
Extract metadata from a file without full conversion.
Parameters:
file_path(string, required): Path to the file
List all supported file extensions and their conversion methods.
| Format | Extension | Method |
|---|---|---|
.pdf |
PyMuPDF (fitz) | |
| Word | .docx |
python-docx |
| HTML | .html, .htm |
markdownify |
| EPUB | .epub |
ebooklib |
| CSV | .csv |
pandas β markdown table |
| JSON | .json |
Formatted markdown code block |
| XML | .xml |
xmltodict β markdown |
| Excel | .xlsx |
openpyxl β markdown table |
| PowerPoint | .pptx |
python-pptx β markdown slides |
| Text | .txt, .md, .rst, .log |
Direct passthrough |
| Images | .png, .jpg |
pytesseract OCR (if available) |
If this tool helps your workflow, consider supporting its development:
- GitHub Sponsors: Sponsor via Liberapay
- ETH:
0xddD9f45e14c92846f47C1c1A4431aC2b41D87273
MIT