Pandoc Document Conversion
A Model Context Protocol server for document format conversion using pandoc.
Overview
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.
Tools
- convert-contents
- Transforms content between supported formats
- Inputs:
contents
(string): Source content to convert (required if input_file not provided)input_file
(string): Complete path to input file (required if contents not provided)input_format
(string): Source format of the content (defaults to markdown)output_format
(string): Target format (defaults to markdown)output_file
(string): Complete path for output file (required for pdf, docx, rst, latex, epub formats)
- Supported input/output formats:
- markdown
- html
- docx
- rst
- latex
- epub
- txt
- Note: For advanced formats (pdf, docx, rst, latex, epub), an output_file path is required
Supported Formats
Currently supported formats:
Basic formats (direct conversion):
- Plain text (.txt)
- Markdown (.md)
- HTML (.html)
Advanced formats (requires complete file paths):
- PDF (.pdf) - requires TeX Live installation
- DOCX (.docx)
- RST (.rst)
- LaTeX (.tex)
- EPUB (.epub)
⚠️ Important Notes
Critical Requirements
-
PDF Conversion Prerequisites
- TeX Live must be installed before attempting PDF conversion
-
File Path Requirements
- When saving or converting files, you MUST provide complete file paths including filename and extension
Common Issues and Solutions
-
PDF Conversion Fails
- Error: "xelatex not found"
- Solution: Install TeX Live first
-
File Conversion Fails
- Error: "Invalid file path"
- Solution: Provide complete path including filename and extension
-
Format Conversion Fails
- Error: "Unsupported format"
- Solution: Use only supported formats:
- Basic: txt, html, markdown
- Advanced: pdf, docx, rst, latex, epub
Quickstart
Configuration Example
Contributing
We welcome contributions to enhance mcp-pandoc! Here's how you can get involved:
- Report Issues: Found a bug or have a feature request? Open an issue on our GitHub Issues page.
- Submit Pull Requests: Improve the codebase or add features by creating a pull request.