This MCP server is an enhanced version of the Markdownify MCP project with improved UTF-8 encoding support. It converts various file types (PDFs, images, audio, documents, web content) to Markdown format with optimized handling of multilingual content and fixed encoding issues on Windows systems.
Install Node.js:
node --version
Install pnpm:
npm install -g pnpm
pnpm --version
Install Python:
python --version
Windows-specific UTF-8 configuration:
# 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 dependencies:
pnpm install
./setup.sh
Build and start the server:
pnpm run build
pnpm start
Convert web pages to Markdown:
python convert_utf8.py "https://example.com"
Convert local files to Markdown:
# 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"
Convert YouTube video transcripts:
python convert_utf8.py "https://www.youtube.com/watch?v=VIDEO_ID"
Using environment variables for customization:
# Set custom UV path
export UV_PATH="/custom/path/to/uv"
# Set custom output directory
export MARKDOWN_OUTPUT_DIR="/custom/output/path"
Batch processing multiple files:
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 process the batch:
while read -r line; do python convert_utf8.py "$line"; done < convert_batch.txt
Enable debugging:
export DEBUG=true
python convert_utf8.py "your_file.docx"
To integrate with a desktop application, add this to your app's server configuration:
{
"mcpServers": {
"markdownify": {
"command": "node",
"args": [
"{ABSOLUTE_PATH}/dist/index.js"
],
"env": {
"UV_PATH": "/path/to/uv"
}
}
}
}
PYTHONIOENCODING
environment variable is set to utf-8
chcp 65001
to enable UTF-8 supportTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "markdownify" '{"command":"node","args":["{ABSOLUTE_PATH}/dist/index.js"],"env":{"UV_PATH":"/path/to/uv"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"markdownify": {
"command": "node",
"args": [
"{ABSOLUTE_PATH}/dist/index.js"
],
"env": {
"UV_PATH": "/path/to/uv"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"markdownify": {
"command": "node",
"args": [
"{ABSOLUTE_PATH}/dist/index.js"
],
"env": {
"UV_PATH": "/path/to/uv"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect