development
documentation
public
conversion
pandoc
What is A Model Context Protocol server for document format conversion using pandoc.?
This server provides tools to transform content between different document formats while preserving formatting and structure. PDF support is under development, and the functionality and available tools are subject to change and expansion as we continue to improve the server.
A Model Context Protocol server for document format conversion using pandoc. This server provides tools to transform content between different document formats while preserving formatting and structure.
Please note that mcp-pandoc is currently in early development. PDF support is under development, and the functionality and available tools are subject to change and expansion as we continue to improve the server.
Credit: This project uses the Pandoc Python package for document conversion, forming the foundation for this project.
This tool uses pandoc for conversions, which allows for generating PDF files from the formats listed above. However, converting from a PDF to other formats is not supported. Therefore, PDF should be considered an output-only format.
Format Categories
Category
Formats
Requirements
Basic
MD, HTML, TXT, IPYNB, ODT
None
Advanced
DOCX, PDF, RST, LaTeX, EPUB
Must specify output_file path
Styled
DOCX with reference doc
Custom template support â
Requirements by Format
PDF (.pdf) - requires TeX Live installation
DOCX (.docx) - supports custom styling via reference documents
All others - no additional requirements
Note: For advanced formats:
Complete file paths with filename and extension are required
PDF conversion requires TeX Live installation (see Critical Requirements section -> For macOS: brew install texlive)
When no output path is specified:
Basic formats: Displays converted content in the chat
Advanced formats: May save in system temp directory (/tmp/ on Unix systems)
Usage & configuration
NOTE: Ensure to complete installing required packages mentioned below under "Critical Requirements".
PDF Conversion Prerequisites: Only needed if you need to convert & save pdf
TeX Live must be installed before attempting PDF conversion
Installation commands:
# Ubuntu/Debian
sudo apt-get install texlive-xetex
# macOS
brew install texlive
# Windows
# Install MiKTeX or TeX Live from:
# https://miktex.org/ or https://tug.org/texlive/
File Path Requirements
When saving or converting files, you MUST provide complete file paths including filename and extension
The tool does not automatically generate filenames or extensions
Examples
â Correct Usage:
"Convert this text to PDF and save as /path/to/document.pdf"
# Converting between file formats
"Convert /path/to/input.md to PDF and save as /path/to/output.pdf"
# Converting to DOCX with a reference document template
"Convert input.md to DOCX using template.docx as reference and save as output.docx"
# Step-by-step reference document workflow
"First create a reference document: pandoc -o custom-reference.docx --print-default-data-file reference.docx" or if you already have one, use that
"Then convert with custom styling: Convert this text to DOCX using /path/to/custom-reference.docx as reference and save as /path/to/styled-output.docx"
â Incorrect Usage:
"Save this as PDF in /documents/"
# Missing complete path
"Convert this to PDF"
# Missing extension
"Save as /documents/story"
Common Issues and Solutions
PDF Conversion Fails
Error: "xelatex not found"
Solution: Install TeX Live first (see installation commands above)
File Conversion Fails
Error: "Invalid file path"
Solution: Provide complete path including filename and extension
Example: /path/to/document.pdf instead of just /path/to/
Format Conversion Fails
Error: "Unsupported format"
Solution: Use only supported formats:
Basic: txt, html, markdown
Advanced: pdf, docx, rst, latex, epub
Reference Document Issues
Error: "Reference document not found"
Solution: Ensure the reference document path exists and is accessible
Note: Reference documents only work with DOCX output format
How to create: pandoc -o reference.docx --print-default-data-file reference.docx
Quickstart# Install
Option 1: Installing manually via claude_desktop_config.json config file
On MacOS: open ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
a) Only for local development & contribution to this repo
âšī¸ Replace <DIRECTORY> with your locally cloned project path