mcp-pandoc Server
vivekvells/mcp-pandoc · 536 stars · Python · MIT
MCP server MCP server for document format conversion using pandoc.
Install
npx -y @smithery/cli install mcp-pandoc --client claudeThese repos do not share one command. When an entry shows a command, it was copied as published. Check the repo's README before you run it.
Files
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
More to come...
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, 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 optionsfilters(array): List of Pandoc filter paths to apply during conversion- Supported formats, by direction:
- 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:
# academic-paper.yaml
from: markdown
to: pdf
number-sections: true
toc: true
metadata:
title: "Academic Paper"
author: "Research Team"
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.
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.
PPTX output needs no particular pandoc version. The PowerPoint writer has existed since pandoc 2.0.5.
Format Categories
Requirements by Format
- PDF (.pdf) - requires TeX Live installation
- DOCX (.docx), ODT (.odt), PPTX (.pptx) - support custom styling via reference documents, and the reference must be the same format as the output
- 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".
To use the published one
{
"mcpServers": {
"mcp-pandoc": {
"command": "uvx",
"args": ["mcp-pandoc"]
}
}
}
💡 Quick Start: See CHEATSHEET.md for copy-paste examples and common workflows.
⚠️ Important Notes
#### Critical Requirements
- Pandoc Installation
- Required: Install
pandoc- the core document conversion engine - Installation:
# macOS
brew install pandoc
# Ubuntu/Debian
sudo apt-get install pandoc
# Windows
# Download installer from: https://pandoc.org/installing.html
- Verify:
pandoc --version
- UV package installation
- Required: Install
uvpackage (includesuvxcommand) - Installation:
# macOS
brew install uv
# Windows/Linux
pip install uv
- Verify:
uvx --version
- 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:
# Converting content to PDF
"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"
# Converting to ODT with a reference document template
"Convert input.md to ODT using template.odt as reference and save as output.odt"
# Converting to a branded PowerPoint deck
"Convert slides.md to PPTX using template.pptx as reference and save as deck.pptx"
# 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:
# Missing filename and extension
"Save this as PDF in /documents/"Facts
- Kind
- MCP server
- Repo
- vivekvells/mcp-pandoc
- Group
- Uncategorized
- Stars
- 536
- License
- MIT
- Language
- Python
- Last push
- 2026-08-15
- Forks
- 62
- Homepage
- pypi.org/project/mcp-pandoc
- Topics
- pandoc, pandoc-markdown, pandoc-template
- 1Everythingmodelcontextprotocol/serversThis MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.85.8k
- 2Fetchmodelcontextprotocol/serversA Model Context Protocol server that provides web content fetching capabilities. This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.85.8k
- 3Gitmodelcontextprotocol/serversA Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.85.8k
- 4Memorymodelcontextprotocol/serversA basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.85.8k
- 5Sequential Thinkingmodelcontextprotocol/serversAn MCP server implementation that provides a tool for dynamic and reflective problem-solving through a structured thinking process.85.8k
- 6Timemodelcontextprotocol/serversA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.85.8k