
mcp-pandoc
Document format conversion (Markdown, HTML, LaTeX, DOCX, PDF, and more) via Pandoc over MCP.
Add to your client
Copy the config for your MCP client and paste it into its config file.
uvx mcp-pandocPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-pandoc": {
"command": "uvx",
"args": [
"mcp-pandoc"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Before you start
- Pandoc installed and on PATH (e.g. `brew install pandoc`, or `apt-get install pandoc`)
- uv / uvx package manager to run the server (e.g. `brew install uv`, or `pip install uv`)
- For PDF output: a TeX engine such as TeX Live with xelatex (`brew install texlive`, or `apt-get install texlive-xetex`)
- No credentials or API key needed — auth is none
About mcp-pandoc
mcp-pandoc is a Model Context Protocol server that wraps the Pandoc document converter, letting an AI agent convert content between document formats while preserving structure and formatting. It is useful for turning agent-generated Markdown into polished DOCX, HTML, LaTeX, or PDF, and for reading other formats into Markdown for editing.
It exposes a single convert-contents tool that takes input/output formats, content or file paths, and optional advanced options: a reference document for DOCX styling, a YAML defaults file for reusable conversion templates, and Pandoc filters. Supported formats include Markdown, HTML, TXT, DOCX, PDF, RST, LaTeX, EPUB, IPYNB, and ODT.
Note two key constraints: PDF is output-only (you cannot convert from a PDF), and the advanced formats (PDF, DOCX, RST, LaTeX, EPUB) require an explicit output file path with the correct extension. It runs over stdio and is typically launched with uvx mcp-pandoc.
Tools & capabilities (1)
convert-contentsConvert content or a file between supported formats (Markdown, HTML, TXT, DOCX, PDF, RST, LaTeX, EPUB, IPYNB, ODT) with optional reference doc, YAML defaults file, and Pandoc filters.
When to use it
- Use it when you want an agent to export Markdown notes or a draft into a styled DOCX or PDF deliverable.
- Use it when converting HTML or LaTeX into clean Markdown for further editing.
- Use it when you need consistent DOCX styling via a reference document template.
- Use it when you want reusable, parameterized conversions through a Pandoc YAML defaults file.
- Use it when turning a Jupyter notebook (IPYNB) or EPUB into another document format.
- Use it when you need to generate a print-ready PDF from agent output via Pandoc and TeX.
Quick setup
- 1Install Pandoc and uv (plus TeX Live if you need PDF output).
- 2Add the server to your MCP client config with command `uvx` and args `["mcp-pandoc"]`.
- 3Restart your MCP client so it loads the server.
- 4For advanced formats (PDF, DOCX, RST, LaTeX, EPUB), provide a full output file path with the correct extension when calling the tool.
- 5Verify by asking the agent to convert a short Markdown snippet to HTML.
Security notes
It reads and writes files at the paths the model supplies, so it can overwrite local files; scope its use to a working directory you control. PDF conversion shells out to Pandoc and a LaTeX engine, which must be installed and trusted.
mcp-pandoc FAQ
Can it convert from a PDF to Markdown or DOCX?
No. PDF is treated as an output-only format. You can generate PDFs but not parse existing PDFs into other formats.
Why does my PDF conversion fail?
PDF output requires a TeX engine. Install TeX Live (e.g. texlive-xetex) so Pandoc has a LaTeX backend to render the PDF.
Why do I get an error about a missing output path?
Advanced formats (PDF, DOCX, RST, LaTeX, EPUB) require an explicit output file path with the right extension. TXT, HTML, and Markdown can be returned inline.
Does it need an API key?
No. It runs locally over stdio and relies entirely on your local Pandoc installation; there is no authentication.
How is it installed and run?
It is distributed for `uvx`/uv rather than npm. Configure your client to run `uvx mcp-pandoc`, which fetches and launches it.
Alternatives to mcp-pandoc
Official MCP reference server for secure local filesystem read/write within allowed directories.
Official MCP server for reading, searching, and manipulating a local Git repository's files and history.
Official AWS Labs MCP server to manage and query S3 Tables (table buckets, namespaces, tables).
Compare mcp-pandoc with: