Install
$ agentstack add mcp-thomas-villani-all2md Open-source listing — not yet scanned by AgentStack. Follow the source repository for install instructions.
Security review
⚠ Flagged1 finding(s); flagged for manual review. · v0.1.0 How review works →
- • Prompt-injection patterns
- • Secret / credential exfiltration
- • Dangerous shell & filesystem operations
- • Untrusted network calls
- • Known-malicious package signatures
- high Pipes remote content directly into a shell (remote code execution).
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
all2md: The Universal Document Conversion Library
[](https://pypi.org/project/all2md/) [](https://github.com/thomas-villani/all2md/actions/workflows/ci.yml) [](https://codecov.io/gh/thomas-villani/all2md) [](https://all2md.readthedocs.io/) [](https://opensource.org/licenses/MIT) [](https://pypi.org/project/all2md/)
Universal Python document conversion library with native AI assistant integration
all2md is a comprehensive document converter that transforms PDFs, Office files, HTML, emails, spreadsheets, and 40+ other formats into clean Markdown — and back again. Built on an AST-based architecture, it provides powerful programmatic document processing for Python applications, CLI workflows, data pipelines, and AI assistants.
📖 Read the Documentation | 🚀 [Quick Start](#quick-start) | 🎯 [Use Cases](#use-case-scenarios)
Quick Start
Get started with all2md in less than 30 seconds:
# Install with PDF support
pip install "all2md[pdf]"
# Convert any document to Markdown
all2md document.pdf
# Convert to a file
all2md report.docx -o report.md
# Use in Python
python -c "from all2md import to_markdown; print(to_markdown('document.pdf'))"
That's it! For more formats, install the dependencies you need: all2md[docx,html,xlsx] or all2md[all] for everything.
Want to integrate with AI assistants? See the [MCP Server](#mcp-server-for-ai-assistants) and [Agent Skills](#agent-skills) sections below.
Essential CLI Commands Cheatsheet
Beyond basic conversion, all2md provides powerful commands for working with any document format:
# View documents in terminal with rich formatting (like fancy cat)
all2md doc.pdf --rich
rcat doc.pdf # `rcat` = shorthand for `all2md --rich`
# Rapidly convert Markdown to DOCX, PDF, or other formats
all2md report.md --out report.docx
all2md notes.md --out presentation.pptx
# Package a paper for ArXiv submission
all2md arxiv paper.md -o submission.tar.gz --bib references.bib
# View any document in your web browser with instant HTML preview
all2md view document.pdf
all2md view spreadsheet.xlsx --theme docs
# Serve a directory (or a glob) over HTTP with live HTML preview
all2md serve ./docs --recursive
all2md serve "reports/*.docx" # serve only files matching the glob
# Edit any document in a browser-based Markdown/WYSIWYG editor and save back
all2md edit notes.md # md source: overwrite original (with .bak)
all2md edit report.docx # non-md: default save is report.md (sibling)
# Extract specific sections by heading name
all2md doc.pdf --extract "Introduction"
all2md view report.docx --extract "Q3 Results"
# Grep through any document type (PDF, DOCX, etc.)
all2md grep "search term" documents/*.pdf
all2md grep -i "case insensitive" report.docx
# Keyword and vector search across document collections
all2md search "machine learning" ./research_papers/
all2md search "project timeline" --semantic ./docs/
# Chunk documents for RAG/LLM pipelines (JSONL with section + page provenance)
all2md chunk report.pdf --strategy semantic --max-tokens 512 --overlap 64
# Pipe and chain commands with stdin/stdout support (use '-' for stdin)
curl https://example.com/doc.pdf | all2md - | grep "important"
cat report.html | all2md - --format html --rich
all2md document.docx | wc -w # Count words in any document
# All file commands support stdin via '-'
echo "Quick Note" | all2md view - # View from stdin
cat doc.pdf | all2md grep "search term" - # Search stdin content
echo "Version 1" | all2md diff - version2.html # Diff with stdin
These commands work with all supported formats - treat PDFs, Word docs, and spreadsheets like plain text files. Full stdin/stdout support means you can pipe, chain, and integrate all2md into any workflow.
The Problem
Modern document workflows require converting between multiple file formats - PDFs to Markdown for analysis, Word documents to HTML for web publishing, spreadsheets to readable text for processing. Existing solutions often require multiple tools with inconsistent APIs, produce messy output, or lack programmatic control. Converting back from Markdown to rich formats is even harder.
The Solution
all2md provides a unified, bidirectional conversion pipeline built on a powerful Abstract Syntax Tree (AST) architecture:
- Parse: Convert any supported document into a consistent AST representation
- Transform: Programmatically clean, modify, or analyze the content using a powerful transform pipeline
- Render: Output to Markdown, or convert directly to other rich formats like DOCX, PDF, or HTML
This AST-based approach enables:
- Consistent conversions across all formats
- Bidirectional workflows (Markdown ↔ DOCX/PDF/HTML)
- Programmatic control with a clean Python API
- Perfect for AI workflows - Feed documents to LLMs and convert their Markdown responses back to rich formats
Why all2md?
While tools like Pandoc excel at document conversion, all2md is designed specifically for Python developers, AI/LLM workflows, and programmatic document processing. Here's when to use all2md:
Choose all2md when you need:
- Python-Native Integration - First-class Python API designed for embedding in applications, not just CLI usage
- AI Assistant Integration - Built-in MCP server for direct Claude Desktop, ChatGPT, and other AI model integration
- AST-Based Transforms - Powerful document manipulation pipeline for cleaning, modifying, and analyzing content programmatically
- Lightweight Dependencies - Install only what you need;
- Extensibility - Simple plugin system using Python entry points to add custom formats and transforms
- Modern Python - Built for Python 3.10+ with type hints, dataclasses, and contemporary patterns
Choose Pandoc when you need:
- Maximum format support (100+ formats)
- Scholarly document features (citations, bibliographies)
- Standalone binary with no runtime dependencies
- Battle-tested stability (15+ years of development)
Use both together: all2md complements Pandoc in Python projects. Use all2md for LLM preprocessing, programmatic workflows, and AI integration, then hand off to Pandoc for specialized academic formats if needed.
Key Features
- Comprehensive Format Support: Convert between dozens of formats, including PDF, DOCX, PPTX, HTML, EML, EPUB, XLSX, IPYNB, RST, Org-Mode, ZIP archives, and over 100 source-code and config file types.
- Bidirectional Conversion: Not just to Markdown! Convert from Markdown to formats like DOCX, PDF, and HTML.
- Document Comparison: Built-in
diffcommand that works like Unixdiffbut for any document format. Compare PDFs, Word docs, or mixed formats with text-based, symmetric comparison. - Custom Template Rendering: Use Jinja2 templates to create any text-based output format (DocBook XML, YAML, ANSI terminal, custom markup) without writing Python code.
- MCP Server: Built-in Model Context Protocol (MCP) server for direct AI assistant integration. Enable Claude, ChatGPT, and other AI models to read and convert documents directly, plus query tools to search a corpus, diff two documents, and outline a document's headings.
- In-Browser Preview & Editor:
all2md viewrenders any document in your browser andall2md editgives you a live Markdown editor — both with a dark-mode toggle and an optional standalone-window mode (--window,pip install all2md[window]). - Agent Skills: Pre-built skill files that teach AI coding assistants (Claude Code, Cursor, Windsurf) how to use all2md. Install with
all2md install-skills. - AST-Based Pipeline: At its core,
all2mduses an Abstract Syntax Tree (AST) to represent documents, enabling powerful and consistent manipulation across all formats. - Advanced PDF Parsing: Intelligent table detection, multi-column layout analysis, optional GNN-based semantic layout classification (
pdf_layoutextra), header/footer removal, OCR support for scanned documents, and robust text extraction powered by PyMuPDF. - Extensible Plugin System: Easily add support for new file formats (converters) or create custom document manipulations (transforms) using a simple entry-point system.
- Powerful CLI: A full-featured command-line interface with multi-file processing, parallel execution, directory watching, stdin/stdout piping, and dynamic, format-specific options.
- Highly Configurable: Fine-tune every aspect of the conversion process using clean, type-safe
dataclassoptions for each format. - Security-Conscious: Built-in protections against Server-Side Request Forgery (SSRF) when fetching remote resources and security validation for archives like ZIP, DOCX, and EPUB.
- Smart Dependency Management: Core library is dependency-free. Install support for formats only as you need them.
all2md is built around four core strengths that make it ideal for modern document processing workflows:
1. AST-Based Architecture
Unlike direct format-to-format converters, all2md uses an intermediate Abstract Syntax Tree:
- Consistent document representation across all formats
- Enables powerful transforms (remove images, offset headings, rewrite links, etc.)
- Makes bidirectional conversion possible and reliable
- Allows custom output formats via Jinja2 templates (DocBook XML, YAML, ANSI terminal, etc.)
- Facilitates complex document analysis and manipulation
2. Production-Ready Python API
Designed for embedding in applications, not just CLI usage:
- Clean, typed API with comprehensive options classes for every format
- One-call helpers —
to_markdown(),to_ast(),convert(), andchunk()for RAG-ready chunks - Progress callbacks for long-running conversions
- Bidirectional conversion between any supported formats
- AST manipulation for advanced document processing
- Transform pipeline for systematic document modification
- Extensive documentation with examples for every format
3. Powerful CLI Features
Beyond basic conversion, the CLI includes advanced features for production workflows:
- Watch Mode - Automatically convert files as they change
- Parallel Processing - Multi-worker processing for large document sets
- Static Site Generation - Built-in SSG with 5 themes (dark, docs, minimal, newspaper, sidebar)
- Quick Preview -
all2md viewcommand for instant HTML preview - Web Editor -
all2md editopens any document in a Markdown + WYSIWYG editor and saves back to any supported format with automatic backups - Config Management - Generate, validate, and manage conversion configs
- Format Discovery -
all2md list-formatsshows all supported formats and dependencies - Agent-Friendly - Clean, intuitive interface that AI agents can use directly, plus pre-built agent skills installable via
all2md install-skills
4. AI-Native Integration
RAG-Native Chunking — Split any document into chunks ready for retrieval-augmented generation, with provenance most chunkers throw away.
all2md chunk doc.pdf --strategy semantic --max-tokens 512 --overlap 64→ JSONL, one chunk per line- Every chunk carries its section heading/level and the source page span (where the format records it), so answers can cite where they came from
- 11 strategies (semantic/heading/section/token/sentence/paragraph/word/line/char/code/auto); keep tables and code blocks whole; strip or elide noisy elements
- One-call Python API:
chunks = all2md.chunk("doc.pdf", strategy="semantic", max_tokens=512)
MCP Server — Built-in Model Context Protocol server enables direct integration with AI assistants like Claude Desktop. No wrapper scripts or external tools needed.
- Direct document reading in Claude Desktop and other MCP-compatible AI tools
- Smart auto-detection of file paths, data URIs, base64, and plain text
- Section extraction for targeted reading
- Vision model support with embedded images
- Security-first design with file allowlists and network controls
Agent Skills — Pre-built skill files that teach AI coding assistants how to use all2md effectively.
- 7 focused skills covering reading, conversion, generation, grep, search, diff, and chunking
- Works with Claude Code, Cursor, Windsurf, and other skill-aware agents
- Install with one command:
all2md install-skills - Customizable — edit the installed skill files to match your project's needs
See [MCP Server](#mcp-server-for-ai-assistants) and [Agent Skills](#agent-skills) sections below for setup.
Additional Strengths
- Comprehensive Format Support - 35+ input formats and 20+ output formats including PDF, DOCX, PPTX, HTML, EML, EPUB, XLSX, IPYNB, RST, Org-Mode, ZIP archives, and over 100 source-code and config file types
- Advanced PDF Parsing - Intelligent table detection, multi-column layout analysis, optional GNN-based semantic layout classification, header/footer removal, OCR support for scanned documents, powered by PyMuPDF
- Highly Configurable - Fine-tune every aspect of conversion using clean, type-safe dataclass options for each format
- Security-Conscious - Built-in SSRF protection, archive validation (ZIP bombs, path traversal), and sandboxed HTML rendering
- Smart Dependency Management - Core library has no dependencies; install only what you need
MCP Server for AI Assistants
all2md includes a built-in MCP (Model Context Protocol) server that allows AI assistants like Claude to directly read and convert documents:
# Install with MCP support
pip install "all2md[mcp]"
# Start MCP server with temporary workspace
all2md-mcp --temp --enable-from-md
Tools: read_document_as_markdown, save_document_from_markdown, edit_document, plus three read-only query tools enabled by default — search_documents (grep + keyword/BM25 across a corpus), diff_documents (compare two documents), and get_document_outline (heading structure for navigation).
Key features:
- Smart Auto-Detection: Automatically detect source type (file path, data URI, base64, or plain text)
- Corpus Search: Grep and keyword/BM25 search across many documents, returning ranked snippets instead of whole files
- Section Extraction & Outlines: Extract sections by heading or list a document's structure for targeted reading
- Document Diffing: Compare two documents (any format) and get a unified or JSON diff
- Security First: File allowlists, network controls, and path validation
- vLLM Image Support: Optionally embed images as base64 for vision-enabled models
One-click install (Claude Desktop)
Install the prebuilt MCPB bundle — no manual config or separate Python install required (the bundle pulls in all2md via uv on first run):
- Download
all2md.mcpbfrom the latest release. - Open Claude Desktop → Settings → Extensions (the gear icon, or
Ctrl+,/Cmd+,). - Drag
all2md.mcpbonto the Extensions pane (or use the **Install
Extension / Advanced** button to browse for it). Double-clicking the file also works if your OS has the .mcpb association registered, but the drag path doesn't depend on it.
- In the install dialog, choose a workspace folder that all2md may read from
and write to (defaults to your Documents folder; files outside it are rejected), and optionally adjust the toggles for writing/rendering, in-place editing, and network access.
- The all2md tools (
read_document_as_markdown,save_document_from_markdown,
edit_document, search_documents, diff_documents, and get_document_outline) then appear under the "+" → Connectors panel in a chat, ready to use on files in your workspace folder.
> Requires a Claude Desktop build with MCPB extension support (late-2
…
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: thomas-villani
- Source: thomas-villani/all2md
- License: MIT
- Homepage: https://all2md.readthedocs.io/
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.