Markdownify MCP Server - UTF-8 Enhanced
A document conversion server that transforms various file formats (PDFs, documents, images, audio, web content) to Markdown with improved multilingual and UTF-8 support.
JDJR2024
Tools
youtube-to-markdown
Convert a YouTube video to markdown, including transcript if available
audio-to-markdown
Convert an audio file to markdown, including transcription if possible
xlsx-to-markdown
Convert an XLSX file to markdown
bing-search-to-markdown
Convert a Bing search results page to markdown
docx-to-markdown
Convert a DOCX file to markdown
get-markdown-file
Get a markdown file by absolute file path
image-to-markdown
Convert an image to markdown, including metadata and description
pdf-to-markdown
Convert a PDF file to markdown
pptx-to-markdown
Convert a PPTX file to markdown
webpage-to-markdown
Convert a webpage to markdown
README
Markdownify MCP Server - UTF-8 Enhanced
This is an enhanced version of the original Markdownify MCP project, with improved UTF-8 encoding support and optimized handling of multilingual content.
Enhancements
- Added comprehensive UTF-8 encoding support
- Optimized handling of multilingual content
- Fixed encoding issues on Windows systems
- Improved error handling mechanisms
Key Differences from Original Project
-
Enhanced Encoding Support:
- Full UTF-8 support across all operations
- Proper handling of Chinese, Japanese, Korean and other non-ASCII characters
- Fixed Windows-specific encoding issues (cmd.exe and PowerShell compatibility)
-
Improved Error Handling:
- Detailed error messages in both English and Chinese
- Better exception handling for network issues
- Graceful fallback mechanisms for conversion failures
-
Extended Functionality:
- Added support for batch processing multiple files
- Enhanced YouTube video transcript handling
- Improved metadata extraction from various file formats
- Better preservation of document formatting
-
Performance Optimizations:
- Optimized memory usage for large file conversions
- Faster processing of multilingual content
- Reduced dependency conflicts
-
Better Development Experience:
- Comprehensive debugging options
- Detailed logging system
- Environment-specific configuration support
- Clear documentation in both English and Chinese
Features
Supports converting various file types to Markdown:
- PDF files
- Images (with metadata)
- Audio (with transcription)
- Word documents (DOCX)
- Excel spreadsheets (XLSX)
- PowerPoint presentations (PPTX)
- Web content:
- YouTube video transcripts
- Search results
- General web pages
- Existing Markdown files
Quick Start
-
Clone this repository:
git clone https://github.com/JDJR2024/markdownify-mcp-utf8.git cd markdownify-mcp-utf8
-
Install dependencies:
pnpm install
Note: This will also install
uv
and related Python dependencies. -
Build the project:
pnpm run build
-
Start the server:
pnpm start
Requirements
- Node.js 16.0 or higher
- Python 3.8 or higher
- pnpm package manager
- Git
Detailed Installation Guide
1. Environment Setup
-
Install Node.js:
- Download from Node.js official website
- Verify installation:
node --version
-
Install pnpm:
npm install -g pnpm pnpm --version
-
Install Python:
- Download from Python official website
- Ensure Python is added to PATH during installation
- Verify installation:
python --version
-
(Windows Only) Configure UTF-8 Support:
# Set system-wide UTF-8 setx PYTHONIOENCODING UTF-8 # Set current session UTF-8 set PYTHONIOENCODING=UTF-8 # Enable UTF-8 in command prompt chcp 65001
2. Project Setup
-
Clone the repository:
git clone https://github.com/JDJR2024/markdownify-mcp-utf8.git cd markdownify-mcp-utf8
-
Create and activate Python virtual environment:
# Windows python -m venv .venv .venv\Scripts\activate # Linux/macOS python3 -m venv .venv source .venv/bin/activate
-
Install project dependencies:
# Install Node.js dependencies pnpm install # Install Python dependencies (will be handled by setup.sh) ./setup.sh
-
Build the project:
pnpm run build
3. Verification
-
Start the server:
pnpm start
-
Test the installation:
# Convert a web page python convert_utf8.py "https://example.com" # Convert a local file python convert_utf8.py "path/to/your/file.docx"
Usage Guide
Basic Usage
-
Converting Web Pages:
python convert_utf8.py "https://example.com"
The converted markdown will be saved as
converted_result.md
-
Converting Local Files:
# Convert DOCX python convert_utf8.py "document.docx" # Convert PDF python convert_utf8.py "document.pdf" # Convert PowerPoint python convert_utf8.py "presentation.pptx" # Convert Excel python convert_utf8.py "spreadsheet.xlsx"
-
Converting YouTube Videos:
python convert_utf8.py "https://www.youtube.com/watch?v=VIDEO_ID"
Advanced Usage
-
Environment Variables:
# Set custom UV path export UV_PATH="/custom/path/to/uv" # Set custom output directory export MARKDOWN_OUTPUT_DIR="/custom/output/path"
-
Batch Processing: Create a batch file (e.g.,
convert_batch.txt
) with URLs or file paths:https://example1.com https://example2.com file1.docx file2.pdf
Then run:
while read -r line; do python convert_utf8.py "$line"; done < convert_batch.txt
Troubleshooting
-
Common Issues:
- If you see encoding errors, ensure UTF-8 is properly set
- For permission issues on Windows, run as Administrator
- For Python path issues, ensure virtual environment is activated
-
Debugging:
# Enable debug output export DEBUG=true python convert_utf8.py "your_file.docx"
Usage
Command Line
Convert web page to Markdown:
python convert_utf8.py "https://example.com"
Convert local file:
python convert_utf8.py "path/to/your/file.docx"
Desktop App Integration
To integrate this server with a desktop app, add the following to your app's server configuration:
{
"mcpServers": {
"markdownify": {
"command": "node",
"args": [
"{ABSOLUTE_PATH}/dist/index.js"
],
"env": {
"UV_PATH": "/path/to/uv"
}
}
}
}
Troubleshooting
-
Encoding Issues
- If you encounter character encoding issues, ensure the
PYTHONIOENCODING
environment variable is set toutf-8
- Windows users may need to run
chcp 65001
to enable UTF-8 support
- If you encounter character encoding issues, ensure the
-
Permission Issues
- Ensure you have sufficient file read/write permissions
- On Windows, you may need to run as administrator
Acknowledgments
This project is based on the original work by Zach Caceres. Thanks to the original author for their outstanding contribution.
License
This project continues to be licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Before submitting a Pull Request, please:
- Ensure your code follows the project's coding standards
- Add necessary tests and documentation
- Update relevant sections in the README
Contact
For issues or suggestions:
- Submit an Issue: https://github.com/JDJR2024/markdownify-mcp-utf8/issues
- Create a Pull Request: https://github.com/JDJR2024/markdownify-mcp-utf8/pulls
- Email: jdidndosmmxmx@gmail.com
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Excel MCP Server
A Model Context Protocol server that enables AI assistants to read from and write to Microsoft Excel files, supporting formats like xlsx, xlsm, xltx, and xltm.
Playwright MCP Server
Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.
MCP Package Docs Server
Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
@kazuph/mcp-taskmanager
Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.
Apple MCP Server
Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.