Read, convert, search, diff and outline PDF, Word, PowerPoint, HTML and 40+ formats as Markdown.
io.github.thomas-villani/all2md MCP Server
The io.github.thomas-villani/all2md MCP server reads documents and converts them into Markdown. It supports converting, searching, diffing, and outlining content from PDF, Word, PowerPoint, and HTML, as well as 40+ additional formats.
π οΈ Key Features
Read and convert documents to Markdown
Search content
Diff changes
Outline documents
Handles PDF, Word, PowerPoint, HTML, and 40+ formats
π Use Cases
Convert office and document formats into Markdown for reuse
Locate information within supported document types
Compare document outputs using diff
Generate structured outlines from documents
β‘ Developer Benefits
Consistent Markdown output across multiple input formats
Read, convert, search, and chunk PDFs, Office files, e-books, emails, and 40+ other formats, as Markdown and back again. From Python, from your terminal, or from your AI assistant.
rcat is cat for documents. It renders PDFs, Word and PowerPoint files (the 97-2003 .doc and .ppt too), spreadsheets, e-books, emails, notebooks, man pages and every other format all2md reads, with headings, tables, syntax-highlighted code, links with their targets, footnotes, math and admonitions. No browser, no office suite, and it works over SSH. If you reach for glow to read Markdown or doxx to read Word files, rcat is the same idea for every format.
bash
rcat report.docx # read a Word document
rcat deck.pptx --outline # just the slide titles
rcat handbook.pdf --extract "Installation"# one section, by heading
rcat contract.pdf --pager # page through it
curl -sL https://example.com/spec.pdf | rcat -
For anything longer, all2md read (or rcat -i) opens the interactive viewer shown above: an outline beside the text, jumps between headings, the links on screen, and, given a folder, a tree of the documents in it.
bash
all2md read handbook.pdf
all2md read docs/ # choose from the documents in a folder
When you would rather have a browser, all2md view report.docx opens a styled HTML preview, all2md view ./docs -r browses a whole folder with on-demand conversion, and all2md edit notes.md opens a browser editor that saves back to the file.
Styling needs the cli_extras extra and the viewer needs tui; all2md[all] includes both. More in the viewer documentation.
Convert documents from the command line
Any supported format to Markdown, and Markdown back to DOCX, PDF, PPTX, HTML, EPUB and more:
bash
all2md report.pdf > report.md # to Markdown on stdout
all2md answer.md --out answer.docx # Markdown (an LLM's output, say) to Word
all2md ./inbox -r --output-dir ./markdown -p 4 # a whole tree, four at a time
all2md ./inbox -r --output-dir ./markdown --watch # keep converting as files arrive
all2md scan.pdf --pdf-ocr-enabled # scanned pages, through OCR
Every option of every converter is a CLI flag (all2md --help) or a key in a config file (all2md config generate). Every file command reads stdin and writes stdout with -, so all2md slots into pipelines. Word documents come out as Word shows them: tracked changes resolved by policy, comments with their anchors, footnotes, field results, merged cells, and the list numbers Word actually prints.
to_markdown() handles the common case; convert() goes between any two formats; to_ast() gives you the parsed document to work with.
python
from all2md import to_markdown, convert, to_ast, from_ast
markdown = to_markdown("report.pdf", pages="1-3", flavor="gfm")
convert("notes.md", "notes.docx", target_format="docx")
doc = to_ast("report.docx") # a typed document tree
html = from_ast(doc, target_format="html")
The core has no dependencies; each format's extra pulls in only what that format needs. Options are typed dataclasses (PdfOptions, DocxOptions, β¦) or plain keyword arguments, and AST transforms (remove-images, heading-offset, your own) slot in between parsing and rendering. New formats and transforms plug in through entry points.
If you are an LLM with a coding environment, all2md llm-help prints usage guidance written for you, and all2md install-skills installs it as a skill for Claude Code, Cursor and others.
import all2md
for c in all2md.chunk("handbook.pdf", strategy="semantic", max_tokens=512, overlap=64):
print(c.chunk_id, c.section_heading, c.page, c.token_count)
There are 11 strategies (semantic, heading, section, token, sentence, paragraph, code, β¦). Tables and code blocks are kept whole, and the output is JSONL ready for any vector store. Real token counts use tiktoken from the chunk extra. See the chunk command.
Give your AI assistant your documents
all2md ships a Model Context Protocol server, so an assistant like Claude can read your PDFs and Office files, write Word documents, edit them in place, search a folder, and compare two versions. You don't need to write any code.
or install it with uv tool install "all2md[mcp]" and use "command": "all2md-mcp". The [mcp] extra covers PDF, Word, PowerPoint, Excel, HTML, EPUB, ODF and reStructuredText; use [all] for everything.
Tools:read_document_as_markdown, save_document_from_markdown, edit_document, plus the read-only search_documents, diff_documents and get_document_outline.
all2md's conversion quality is measured against independent ground truth, not asserted. Each benchmark lane is published with a control that shows what the measurement looks like when it should fail:
Born-digital PDFs: publisher PDFs from PubMed Central, scored against the JATS XML deposited beside them.
Scanned pages: 981 OmniDocBench pages against human annotation, for the OCR path.
Round trips: Markdown β format β Markdown must hold fidelity 100 for this repository's own docs, on every pull request.
Against other converters, on a sealed holdout of 103 PubMed Central articles scored with the same instruments (reading of 2026-08-29):
all2md
pymupdf4llm 1.28.2
Docling 2.120.3
Recall of attainable text
97.3%
97.1%
96.2%
Invented text (lower is better)
0.55%
6.26%
2.05%
Table text preserved
73.1%
60.7%
79.3%
Docling's learned table model still leads on tables. The comparison lane has the full results, the ground rules, and the caveats that bound them. Conversion Fidelity has the rest.
You can measure your own documents the same way:
bash
all2md report scan.pdf # a reference-free "quality card"
all2md roundtrip notes.md --via docx # convert, parse back, score what survived
all2md optimize hard.pdf --sample-pages 5 # auto-tune the settings for a difficult file
CI quality gate
The same scores run as a GitHub Action, which fails the build when your documents stop converting cleanly:
It fails rather than passing quietly when no files match, no threshold is set, or a document cannot be converted at all, and it warns when a threshold sits so far below your real floor that it could never fire. See the action's documentation.
How is all2md different from Pandoc?
all2md is Python-native and built for programmatic use, LLM pipelines and reading documents in the terminal. Pandoc has more publishing breadth and scholarly features such as citations. They complement each other well.
Does it work with scanned PDFs?
Yes. Install all2md[pdf,ocr] (or ocr-easyocr for no system binary) and pass --pdf-ocr-enabled. all2md report tells you when a PDF has no text layer.
Can I output something other than Markdown?
Yes: DOCX, PDF, PPTX, HTML, EPUB, ODT, RST, LaTeX and more, or any text format through Jinja2 templates.
How do I add a format?
Write a parser, describe it with ConverterMetadata, and register it under the all2md.converters entry point. See examples/plugins.