Document-to-Markdown converter with MCP server and bidirectional export
all2md, developed by Thomas Villani, converts complex document formats into structured Markdown for LLM ingestion and automated document workflows. The tool performs bidirectional conversion across 40+ formats, runs a built-in Model Context Protocol server, and offers RAG-native chunking plus AST-based transforms for high-fidelity parsing. It includes advanced PDF table recovery, optional OCR support, and CLI batch utilities. Target users are LLM and RAG builders, Python developers, and power users handling programmatic document preparation.
Transforms complex files into LLM-ready Markdown for RAG ingestion
The tool converts over 40 file types, including PDFs, DOCX, PPTX, HTML, emails, and spreadsheets, into clean, GitHub Flavored Markdown designed for model context ingestion. The pipeline uses an abstract syntax tree to preserve document structure and allow programmatic transforms, and it can write Markdown back to rich formats such as DOCX and PDF, enabling round-trip editing of model-generated content.
Produces structured outputs with measurable fidelity for complex layouts
PDF handling focuses on table recovery, multi-column layout analysis, and header/footer removal, which reduces the amount of spurious or 'invented' text compared with simpler parsers. The project reports benchmarking against Docling and pymupdf4llm and emphasizes low invented-text rates. RAG-native chunking supplies eleven strategies, including semantic, heading, and token splits, while preserving section and page provenance for retrieval workflows.
Requires developer familiarity but provides extensible, format-specific installs
The tool is available as a Python library and a CLI for PC, macOS, and Linux, and it targets Python 3.x environments. The installer uses a modular dependency system so only the codecs needed for particular formats install, and OCR extras such as Tesseract or EasyOCR are optional for scanned PDFs. A plugin API and AST transforms let developers add custom formats or adjust parsing behavior programmatically.
Fits into AI assistant pipelines via MCP and batch tooling
The built-in Model Context Protocol server connects the conversion pipeline directly to AI assistants, and the project supplies a one-click MCPB bundle for clients such as Claude Desktop. Command-line utilities support directory watching, batch conversion, semantic search, and document diffing to automate ingestion. These integrations help feed structured Markdown into retrieval systems and let developers incorporate converted content into downstream model prompts or RAG stores.
Practical choice for developers building model ingestion pipelines
For teams that construct retrieval and context layers, the tool delivers measurable control over source fidelity and provenance; its modular, code-first design suits scripted pipelines and batch operations. Nontechnical users likely encounter a steep setup curve. Practical advice: output GitHub Flavored Markdown and prefer semantic or heading-based chunking to keep provenance intact when importing documents into model context stores. Enable OCR extras for image-based PDFs before batch runs.




