-->
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
mcp-pandoc: A Document Conversion MCP Server
> Officially included in the Model Context Protocol servers open-source project. 🎉
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.
Credit: This project uses the Pandoc Python package for document conversion, forming the foundation for this project.
📋 Quick Reference
**New to mcp-pandoc?** Check out **📖 CHEATSHEET.md** for
- ⚡ Copy-paste examples for all formats
- 🔄 Bidirectional conversion matrix
- 🎯 Common workflows and pro tips
- 🌟 Reference document styling guide
_Perfect for quick lookups and getting started fast!_
Demo
> 🎥 Watch on YouTube
Screenshots
More to come...
Tools
1. 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, odt, pptx formats)
- reference_doc (string): Path to a reference document to use for styling (supported for docx, odt and pptx output; the file must match the output format)
- defaults_file (string): Path to a Pandoc defaults file (YAML) containing conversion options
- filters (array): List of Pandoc filter paths to apply during conversion
- Supported formats, by direction:
| Format | Read | Write |
| -------- | :--: | :---: |
| markdown | ✅ | ✅ |
| html | ✅ | ✅ |
| docx | ✅ | ✅ |
| odt | ✅ | ✅ |
| rst | ✅ | ✅ |
| latex | ✅ | ✅ |
| epub | ✅ | ✅ |
| ipynb | ✅ | ✅ |
| txt | ✅ | ✅ |
| **pdf** | ❌ | ✅ |
| **pptx** | ❌ | ✅ |
- Note: For advanced formats (pdf, docx, rst, latex, epub, odt, pptx), an output_file path is required
🔧 Advanced Features
Defaults Files (YAML Configuration)
Use defaults files to create reusable conversion templates with consistent formatting:
Example usage: "Convert paper.md to PDF using defaults academic-paper.yaml and save as paper.pdf"
Pandoc Filters
Apply custom filters for enhanced processing:
Example usage: "Convert docs.md to HTML with filters ['/path/to/mermaid-filter.py'] and save as docs.html"
> 💡 **For comprehensive examples and workflows**, see **CHEATSHEET.md**
📊 Supported Formats & Conversions
Bidirectional Conversion Matrix
Rows are source formats, columns are targets. PDF and PPTX have no rows because pandoc cannot read them.
| From\To | MD | HTML | TXT | DOCX | ODT | RST | LaTeX | EPUB | IPYNB | PDF | PPTX |
| ------------ | --- | ---- | --- | ---- | --- | --- | ----- | ---- | ----- | --- | ---- |
| **Markdown** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **HTML** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **TXT** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **DOCX** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **ODT** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **RST** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **LaTeX** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **EPUB** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| **IPYNB** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
A Note on Write-Only Formats
**PDF** and **PPTX** can be produced but not read.
Pandoc has never shipped a PDF reader. Pandoc gained a PowerPoint reader in 3.8.3 (released 2025-12-01), but this project declares no minimum pandoc version, and Ubuntu 24.04 still ships pandoc 3.1.3, so pptx input is not offered. Tracked in #54 and #49.