Markdownify UTF-8
STDIOEnhanced Markdownify MCP server with improved UTF-8 encoding and multilingual content support.
Enhanced Markdownify MCP server with improved UTF-8 encoding and multilingual content support.
This is an enhanced version of the original Markdownify MCP project, with improved UTF-8 encoding support and optimized handling of multilingual content.
Enhanced Encoding Support:
Improved Error Handling:
Extended Functionality:
Performance Optimizations:
Better Development Experience:
Supports converting various file types to Markdown:
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
Install Node.js:
node --version
Install pnpm:
npm install -g pnpm pnpm --version
Install Python:
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
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
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"
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"
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
Common Issues:
Debugging:
# Enable debug output export DEBUG=true python convert_utf8.py "your_file.docx"
Convert web page to Markdown:
python convert_utf8.py "https://example.com"
Convert local file:
python convert_utf8.py "path/to/your/file.docx"
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" } } } }
Encoding Issues
PYTHONIOENCODING
environment variable is set to utf-8
chcp 65001
to enable UTF-8 supportPermission Issues
This project is based on the original work by Zach Caceres. Thanks to the original author for their outstanding contribution.
This project continues to be licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Before submitting a Pull Request, please:
For issues or suggestions: