mcp-pandoc
The mcp-pandoc server enables document format conversion using pandoc.
Converts content between supported formats including markdown, HTML, PDF, DOCX, RST, LaTeX, EPUB, and TXT
Accepts content as a string or from an input file specified by path
Displays converted content directly for basic formats (TXT, HTML, markdown)
Requires output file paths for advanced formats (PDF, DOCX, RST, LaTeX, EPUB)
Preserves formatting and structure during conversion
Provides detailed error messages for conversion failures
Requires TeX Live installation for PDF conversion
Integrates with GitHub for issue tracking and contributions, with references to the GitHub Issues page for bug reports and feature requests.
Enables conversion of content to and from LaTeX format, preserving formatting and structure when transforming documents.
Provides specific installation and configuration instructions for macOS users, including TeX Live installation via Homebrew.
Provides conversion capabilities to and from Markdown format, allowing for seamless transformation of document content while maintaining formatting.
Supports publishing the server to PyPI for easy installation, with instructions for building and publishing the package.
Offers Ubuntu-specific installation instructions for the TeX Live dependency required for PDF conversion.
Includes a demonstration video hosted on YouTube showcasing the document conversion capabilities of the MCP server.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-pandocconvert this markdown to a PDF file"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: flexberry-markitdown-mcp
📋 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-contentsTransforms 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:
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:
# 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.
From\To | MD | HTML | TXT | DOCX | ODT | RST | LaTeX | EPUB | IPYNB | 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.
PPTX output needs no particular pandoc version. The PowerPoint writer has existed since pandoc 2.0.5.
Format Categories
Category | Formats | Requirements |
Basic | MD, HTML, TXT, IPYNB | None, returned inline |
Advanced | DOCX, ODT, PDF, PPTX, RST, LaTeX, EPUB | Must specify |
Styled | DOCX, ODT, PPTX with reference doc | Custom template support ⭐ |
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 engineInstallation:
# macOS brew install pandoc # Ubuntu/Debian sudo apt-get install pandoc # Windows # Download installer from: https://pandoc.org/installing.htmlVerify:
pandoc --version
UV package installation
Required: Install
uvpackage (includesuvxcommand)Installation:
# macOS brew install uv # Windows/Linux pip install uvVerify:
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/"
# 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.pdfinstead 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
Error: "reference_doc must be a '.odt' file when output_format is 'odt'"
Solution: The reference document must be the same format as the output. Pandoc does not check this itself: a mismatched reference is silently ignored for DOCX output, and produces an ODT file that cannot be opened
Note: Reference documents work with DOCX, ODT and PPTX output formats
How to create:
pandoc -o reference.docx --print-default-data-file reference.docx, and likewise withreference.odtorreference.pptx
Quickstart
Installing manually via claude_desktop_config.json config file
On MacOS:
open ~/Library/Application\ Support/Claude/claude_desktop_config.jsonOn Windows:
%APPDATA%/Claude/claude_desktop_config.json
a) Only for local development & contribution to this repo
ℹ️ Replace with your locally cloned project path
"mcpServers": {
"mcp-pandoc": {
"command": "uv",
"args": [
"--directory",
"<DIRECTORY>/mcp-pandoc",
"run",
"mcp-pandoc"
]
}
}b) Published Servers Configuration - Consumers should use this config
"mcpServers": {
"mcp-pandoc": {
"command": "uvx",
"args": [
"mcp-pandoc"
]
}
}If you face any issue, use the "Published Servers Configuration" above directly instead of this cli.
Note: To use locally configured mcp-pandoc, follow "Development/Unpublished Servers Configuration" step above.
Development
Testing
To run the comprehensive test suite and validate all supported bidirectional conversions, use the following command:
uv run pytest tests/test_conversions.pyThis ensures backward compatibility and verifies the tool's core functionality.
Building and Publishing
To prepare the package for distribution:
Sync dependencies and update lockfile:
uv syncBuild package distributions:
uv buildThis will create source and wheel distributions in the dist/ directory.
Publish to PyPI:
uv publishNote: You'll need to set PyPI credentials via environment variables or command flags:
Token:
--tokenorUV_PUBLISH_TOKENOr username/password:
--username/UV_PUBLISH_USERNAMEand--password/UV_PUBLISH_PASSWORD
Debugging
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm with this command:
npx @modelcontextprotocol/inspector uv --directory /Users/vivekvells/Desktop/code/ai/mcp-pandoc run mcp-pandocUpon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
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.
Available Tools
1 toolconvert-contentsA
Converts content between different formats. Transforms input content from any supported format into the specified output format.
🚨 CRITICAL REQUIREMENTS - PLEASE READ:
PDF Conversion:
You MUST install TeX Live BEFORE attempting PDF conversion:
Ubuntu/Debian:
sudo apt-get install texlive-xetexmacOS:
brew install texliveWindows: Install MiKTeX or TeX Live from https://miktex.org/ or https://tug.org/texlive/
PDF conversion will FAIL without this installation
File Paths - EXPLICIT REQUIREMENTS:
When asked to save or convert to a file, you MUST provide:
Complete directory path
Filename
File extension
Example request: 'Write a story and save as PDF'
You MUST specify: '/path/to/story.pdf' or 'C:\Documents\story.pdf'
The tool will NOT automatically generate filenames or extensions
File Location After Conversion:
After successful conversion, the tool will display the exact path where the file is saved
Look for message: 'Content successfully converted and saved to: [file_path]'
You can find your converted file at the specified location
If no path is specified, files may be saved in system temp directory (/tmp/ on Unix systems)
For better control, always provide explicit output file paths
Supported formats:
Basic (returned inline): txt, html, markdown, ipynb
Advanced (REQUIRE complete file paths): pdf, docx, rst, latex, epub, odt, pptx
pptx is WRITE-ONLY: it can be produced, but not used as an input format ✅ CORRECT Usage Examples:
'Convert this text to HTML' (basic conversion)
Tool will show converted content
'Save this text as PDF at /documents/story.pdf'
Correct: specifies path + filename + extension
Tool will show: 'Content successfully converted and saved to: /documents/story.pdf'
❌ INCORRECT Usage Examples:
'Save this as PDF in /documents/'
Missing filename and extension
'Convert to PDF'
Missing complete file path
When requesting conversion, ALWAYS specify:
The content or input file
The desired output format
For advanced formats: complete output path + filename + extension Example: 'Convert this markdown to PDF and save as /path/to/output.pdf'
🎨 DOCX, ODT & PPTX STYLING: 4. Custom Styling with Reference Documents:
Use reference_doc parameter to apply professional styling to DOCX, ODT and PPTX output
The reference document MUST match the output format: .docx for docx, .odt for odt, .pptx for pptx
Create custom templates with your branding, fonts, and formatting
Perfect for corporate reports, academic papers, and professional documents
Example: 'Convert this report to DOCX using /templates/corporate-style.docx as reference and save as /reports/Q4-report.docx'
🎯 PANDOC FILTERS (NEW FEATURE): 5. Pandoc Filter Support:
Use filters parameter to apply custom Pandoc filters during conversion
Filters are Python scripts that modify document content during processing
Perfect for Mermaid diagram conversion, custom styling, and content transformation
Example: 'Convert this markdown with mermaid diagrams to DOCX using filters=["./filters/mermaid-to-png-vibrant.py"] and save as /reports/diagram-report.docx'
📋 Creating Reference Documents:
Generate template: pandoc -o template.docx --print-default-data-file reference.docx
Customize in Word/LibreOffice: fonts, colors, headers, margins
Use for consistent branding across all documents
📋 Filter Requirements:
Filters must be executable Python scripts
Use absolute paths or paths relative to current working directory
Filters are applied in the order specified
Common filters: mermaid conversion, color processing, table formatting
📄 Defaults File Support (NEW FEATURE): 7. Pandoc Defaults File Support:
Use defaults_file parameter to specify a YAML configuration file
Similar to using pandoc -d option in the command line
Allows setting multiple options in a single file
Options in the defaults file can include filters, reference-doc, and other Pandoc options
Example: 'Convert this markdown to DOCX using defaults_file="/path/to/defaults.yaml" and save as /reports/report.docx'
Note: After conversion, always check the success message for the exact file location.
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | List of Pandoc filter paths to apply during conversion. Filters are applied in the order specified. | |
| contents | No | The content to be converted (required if input_file not provided) | |
| input_file | No | Complete path to input file including filename and extension (e.g., '/path/to/input.md') | |
| output_file | No | Complete path where to save the output including filename and extension (required for pdf, docx, rst, latex, epub, odt, pptx formats) | |
| input_format | No | Source format of the content (defaults to markdown) | markdown |
| defaults_file | No | Path to a Pandoc defaults file (YAML) containing conversion options. Similar to using pandoc -d option. | |
| output_format | No | Desired output format (defaults to markdown). Note pptx is write-only: it can be produced but not read. | markdown |
| reference_doc | No | Path to a reference document to use for styling. Supported for docx, odt and pptx output. The file must match the output format: a .docx reference for docx output, .odt for odt, .pptx for pptx. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by explaining that PDF conversion requires TeX Live, that filenames won't be auto-generated, that files may be saved to temp directory if no path is given, and that pptx is write-only. It also mentions the success message that reveals the saved location. The only minor gap is not explicitly stating whether operations are reversible or if any destructive actions occur, but for a conversion tool, this is less critical.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is excessively long and repetitive. Key information about file paths is repeated multiple times (e.g., in the critical requirements, incorrect usage examples, and the final note). The use of emojis, many sections, and multiple examples makes it hard to scan quickly. While it is front-loaded with the main purpose, the sheer volume undermines conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is highly complete given the tool's complexity. It covers all major usage scenarios, including basic conversions, advanced format path requirements, styling with reference documents, Pandoc filters, and defaults files. It even explains output location and success messages, which is valuable since there is no output schema. The description leaves little room for user confusion about how to proceed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Although the schema already provides descriptions for all 8 parameters, the tool description significantly enriches parameter understanding. It explains the purpose and usage of `reference_doc`, `filters`, `defaults_file`, and clarifies the importance of `output_file` for advanced formats. For example, it gives a specific example for using filters with Mermaid diagrams and explains that reference documents must match output format. This adds substantial value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence clearly states the tool's function: 'Converts content between different formats.' This is a specific verb+resource description that distinguishes it from potential alternative tools. The rest of the description reinforces this with supported formats and examples. However, the purpose is somewhat diluted by the extensive additional requirements and feature explanations.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit, actionable guidance on when and how to use the tool, including correct and incorrect usage examples, requirements for PDF conversion, and file path specifications. It clearly delineates basic vs. advanced formats and instructs users to always specify content, output format, and complete file paths for advanced formats. This goes beyond mere context to offer concrete usage rules.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.11.1- Changed
convert-contents4 fields changed- changed
Input schema / properties / output_file / descriptionPrevious value: -"Complete path where to save the output including filename and extension (required for pdf, docx, rst, latex, epub formats)"New value: +"Complete path where to save the output including filename and extension (required for pdf, docx, rst, latex, epub, odt, pptx formats)" - changed
Input schema / properties / output_format / descriptionPrevious value: -"Desired output format (defaults to markdown)"New value: +"Desired output format (defaults to markdown). Note pptx is write-only: it can be produced but not read." - changed
Input schema / properties / output_format / enumPrevious value: -[ - "markdown", - "html", - "pdf", - "docx", - "rst", - "latex", - "epub", - "txt", - "ipynb", - "odt" -]New value: +[ + "markdown", + "html", + "pdf", + "docx", + "rst", + "latex", + "epub", + "txt", + "ipynb", + "odt", + "pptx" +] - changed
Input schema / properties / reference_doc / descriptionPrevious value: -"Path to a reference document to use for styling (supported for docx output format)"New value: +"Path to a reference document to use for styling. Supported for docx, odt and pptx output. The file must match the output format: a .docx reference for docx output, .odt for odt, .pptx for pptx."
1 tool update
v0.8.1- Changed
convert-contents3 fields changed- added
Input schema / additionalPropertiesAdded value: +false - removed
Input schema / allOfRemoved value: -[ - { - "if": { - "properties": { - "output_format": { - "enum": [ - "pdf", - "docx", - "rst", - "latex", - "epub" - ] - } - } - }, - "then": { - "required": [ - "output_file" - ] - } - } -] - removed
Input schema / oneOfRemoved value: -[ - { - "required": [ - "contents" - ] - }, - { - "required": [ - "input_file" - ] - } -]
1 tool update
v1.0.0- First observed
convert-contents
TDQS
There is only one tool, so there is no possibility of an agent mistaking it for another. Its purpose is clearly defined as content conversion, with no overlapping tools.
Although there is only one tool, the name 'convert-contents' follows a clear verb_noun convention and is semantically appropriate. With no other tools, there are no naming conflicts or mixed conventions.
A single tool for Pandoc conversion feels minimal, though it can cover many conversions through its parameters. It is on the thin side of the acceptable range for a focused converter server.
The tool supports conversion across a wide range of formats, including inline returns and file outputs, plus advanced options like reference documents, filters, and defaults files. For a conversion-only server, this covers the domain thoroughly with no obvious operational gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Document-to-Markdown MCP server — convert PDF, Office and HTML into LLM-ready Markdown.
Generate PDF, Word (.docx) and PowerPoint (.pptx) documents from Markdown over MCP.
Hosted MCP server: convert PDFs to clean, LLM-ready Markdown with tables, formulas and OCR.
MCP server for Api2Pdf — generate PDFs & images from HTML, URLs or office files; merge, barcodes.
Related MCP Servers
- AlicenseBqualityDmaintenanceA universal MCP server for document processing, conversion, and automation. Handle PDF, DOCX, HTML, Markdown, and more through a unified API and toolset.1333139MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for converting various file formats (PDF, DOCX, images, audio, etc.) to Markdown using Microsoft MarkItDown, with support for large files and Cyrillic text.1MIT
- MIT
- AlicenseAqualityDmaintenanceA secure MCP server for converting documents between Markdown, DOCX, HTML, PDF, and TXT formats within a sandboxed working directory.3MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vivekVells/mcp-pandoc'
If you have feedback or need assistance with the MCP directory API, please join our Discord server