
Mcp Document Converter
io.github.xt765Published by GitHub account xt765v0.2.2Updated Oct 24, 2026
Convert PDF, DOCX, HTML, Markdown, and Text for AI assistant context injection.
Overview
A local MCP server that converts documents between Markdown, HTML, DOCX, PDF and plain text so an assistant can read or produce them.
- What you can do
- Convert a document from one format to another, choosing source and output paths, target format, CSS, template and metadata options, with source format auto-detected from the extension when not given. Query format support: list supported formats, show the full conversion matrix, check whether a given source-to-target pair is possible, and get details on a single format. Outputs can include syntax highlighting, custom CSS styling and preserved title, author and creation metadata.
- When to use it
- Useful when an assistant needs to turn a PDF, Word file, HTML page or Markdown note into another format for context injection, or to produce a styled HTML or PDF from Markdown. Add it when document format conversion is a recurring part of the workflow.
- Requirements
- Runs as a local process on the user's machine, installed from PyPI (pip install mcp-document-converter) or launched with uvx; the README also shows running from a Git repository. Python and the listed dependencies, including WeasyPrint for PDF output, are needed. No authentication, API keys or headers are declared. Optional environment variables MCP_CONVERTER_LOG_LEVEL and MCP_CONVERTER_TEMP_DIR control logging and the temp directory.
Installation
In SourceWeft
- Open Mcp Document Converter in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
MCP Document Converter
MCP (Model Context Protocol) Document Converter - A powerful MCP tool for converting documents between multiple formats, enabling AI agents to easily transform documents.
[License] [Python] [PyPI Version] [PyPI Downloads] [MCP Registry] [MCP Marketplace]
Features
- Multi-format Support: Supports 5 mainstream document formats: Markdown, HTML, DOCX, PDF, and Text
- Bidirectional Conversion: Any format can be converted to any other format (5×5=25 conversion combinations)
- MCP Protocol: Compliant with MCP standards, can be used as a tool for AI assistants like Trae IDE
- Plugin Architecture: Easy to extend with new parsers and renderers
- Syntax Highlighting: HTML and PDF outputs support code syntax highlighting
- Style Customization: Support for custom CSS styles
- Metadata Preservation: Preserves document title, author, creation time, and other metadata during conversion
📚 Documentation
User Guide · API Reference · Contributing · Changelog · License
Architecture
Core Components
- DocumentIR (Intermediate Representation): Unified abstraction for all documents, containing document tree, metadata, assets, etc.
- BaseParser (Parser Base Class): Defines the parser interface, parses various formats into DocumentIR
- BaseRenderer (Renderer Base Class): Defines the renderer interface, renders DocumentIR into various formats
- ConverterRegistry (Registry): Manages all parsers and renderers, provides format lookup and auto-matching
- DocumentConverter (Conversion Engine): Coordinates parsers and renderers to complete document conversion
Supported Formats
Input Formats (Parsers)
Output Formats (Renderers)
Conversion Matrix
Installation
Using pip (Recommended)
From Source
MCP Tools
This server provides the following tools:
convert_document
Convert a document from one format to another.
Arguments:
source_path(string, required): Path to the source document.target_format(string, required): Target format (html,pdf,markdown,docx,text).output_path(string, optional): Path for the output file.source_format(string, optional): Format of the source file (auto-detected if not provided).options(object, optional): Additional options liketemplate,css, andpreserve_metadata.
Configuration
Using in Trae IDE / Claude Desktop
Add the following to your MCP configuration file:
Option 1: Using PyPI (Recommended)
Option 2: Using GitHub repository
Option 3: Using Gitee repository (Faster access in China)
Option 4: Using pip (Manual installation)
First install the package:
Then add to configuration:
Using in Cherry Studio
Cherry Studio is a powerful open-source desktop AI client assistant that supports integrating various tools through the MCP protocol
Configuration Example:
Usage Example:
Usage
As an MCP Tool
After configuration, AI assistants can directly call the following tools:
1. convert_document (Recommended)
Use a unified interface to convert any supported document type.
2. list_supported_formats
List all supported document formats.
3. get_conversion_matrix
Get the complete format conversion matrix.
4. can_convert
Check if conversion from source format to target format is supported.
5. get_format_info
Get detailed information about a specific format.
As a Python Library
Tool Interface Details
convert_document
Convert a document from one format to another.
Parameters:
Options:
Example:
Extension Development
Adding a New Parser
Adding a New Renderer
Registering Extensions
Testing
Environment Variables
Dependencies
Core Dependencies
mcp>= 1.26.0 - MCP protocol implementationpydantic>= 2.12.5 - Data validation
Parser Dependencies
markdown>= 3.5.0 - Markdown parsingbeautifulsoup4>= 4.12.0 - HTML parsingpython-docx>= 1.1.0 - DOCX parsingpypdf>= 6.7.4 - PDF parsingchardet>= 5.0.0 - Encoding detectionpyyaml>= 6.0.0 - YAML parsing
Renderer Dependencies
weasyprint>= 60.0 - PDF renderingpygments>= 2.17.0 - Code highlightingjinja2>= 3.1.6 - Template enginereportlab>= 4.0.0 - PDF generation
Development Dependencies
pytest>= 7.0.0 - Testing frameworkpytest-asyncio>= 0.21.0 - Async testing supportpytest-cov>= 4.0.0 - Coverage reportingbasedpyright>= 1.0.0 - Type checkingruff>= 0.1.0 - Linting and formatting
License
MIT License
Contributing
Issues and Pull Requests are welcome!
Related Projects
- MCP Document Reader - MCP document reader supporting multiple document formats
- Model Context Protocol - Official Model Context Protocol documentation
Source: README.md at commit 2b57af4
Tools
0Version history
1- v0.2.2LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts
