markitai

markitai

Local
@ynewtime3PythonMITUpdated Yesterday

Convert documents, images and web pages to clean Markdown, for agents: single, URL and batch tools.

Markitai

PyPI Python CI License: MIT

Opinionated Markdown converter with native LLM enhancement support.

  • Multi-format: DOCX, PPTX, XLSX, PDF, EPUB, EML, TXT, MD, images (JPG/PNG/WebP), and URLs → clean Markdown; legacy .doc/.ppt via the legacy extra
  • LLM enhancement: format cleaning, frontmatter metadata, and vision analysis of embedded images, all through litellm, so any provider works (OpenAI, Anthropic, Gemini, local CLIs, and more)
  • Batch processing: concurrent conversion with progress display and --resume for interrupted jobs
  • OCR: scanned PDFs and images via local RapidOCR (optional extra, see below), or --ocr --llm to have the vision model read the page images directly (VLM-OCR)
  • Web fetching: static HTTP with cache revalidation, or Playwright rendering for JS-heavy pages
  • Local web workspace: upload files or folders, submit URLs, configure LLM providers, compare results, retry failures, and revisit conversion history. CLI runs can opt in to that history too, with --record-history

Docs: https://markitai.dev

Install

Guided installer (recommended). It installs Python and uv if they are missing, lets you pick extras and the Playwright browser, and offers a mirror when the default index is unreachable. Bilingual (EN/中文).

# Linux/macOS
curl -fsSL https://markitai.dev/setup.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://markitai.dev/setup.ps1 | iex"

Already have Python 3.11–3.13? Install the package on its own and run the two setup steps yourself:

uv tool install markitai     # or: pipx install markitai
markitai doctor              # check core and optional capabilities
markitai init                # config and LLM provider

Browser rendering needs the browser extra, then Chromium:

uv tool install "markitai[browser]" --force
markitai doctor --fix

Both routes install markitai and the shorter mkai alias.

Extras

ExtraEnables
browserPlaywright rendering for JS-heavy pages
claude-agentClaude Agent SDK as an LLM provider
copilotGitHub Copilot SDK as an LLM provider
extra-fetchcurl-cffi HTTP client (better anti-bot compatibility)
heifHEIC/HEIF/AVIF image input
legacyLegacy Office conversion (.doc/.ppt) via the anydoc Rust backend
mcpBundled markitai-mcp server for AI agents (Model Context Protocol)
ocrLocal OCR for scanned PDFs and images (--ocr)
serveLocal web workspace and REST API
svgSVG rasterization via cairosvg
allEverything above

ocr is opt-in because it pulls in ~160MB of models. The guided installer asks whether you want it, and markitai doctor prints the install command when it is missing:

uv tool install "markitai[ocr]" --force

Launch the local web workspace with:

uv tool install "markitai[serve]" --force
markitai serve

Quick start

markitai document.pdf -o out/            # convert a file
markitai https://example.com -o out/     # convert a URL
markitai ./docs -o out/                  # batch convert a directory
markitai ./docs -o out/ --json           # machine-readable results for automation
markitai https://example.com --no-remote-fetch -o out/  # local URL extraction only
markitai doctor                          # check dependencies and configuration

For LLM enhancement, export any supported provider key. markitai picks the model up from the environment; you don't need a config file:

export GEMINI_API_KEY=...                # or OPENAI_/ANTHROPIC_/DEEPSEEK_/OPENROUTER_API_KEY
markitai document.pdf -o out/ --llm      # clean formatting + generated frontmatter
markitai document.pdf --preset rich      # LLM + alt text + descriptions + screenshots
markitai init                            # or configure it interactively, once

MCP server

markitai-mcp exposes conversion to AI agents over the Model Context Protocol with four tools: convert_document, convert_url, batch_convert, job_status. There is nothing to install, since uvx runs it on demand, and large outputs land on disk instead of in the model context. For Claude Code:

claude mcp add markitai -- uvx --from "markitai[mcp]" markitai-mcp

The MCP guide covers other clients, LLM enhancement and batch jobs. markitai mcp starts the same server through the CLI itself, which is how the MCP Registry lists it.

Documentation

Contributors start at CONTRIBUTING.md.

How markitai compares

Two of the tools we compare markitai with are also its dependencies: markitdown converts the Office formats, and anydoc handles legacy .doc/.ppt behind markitai[legacy]. Against them and docling, markitai gives up ecosystem reach, ML document-structure models and dependency-free speed, and gets a built-in LLM pipeline, live web fetching and a local workspace in return. The feature-by-feature table lives in Why Markitai.

License

markitai's own source code is MIT.

The default installation is not uniformly MIT, because the PDF engine is not. The PyMuPDF packages pymupdf, pymupdf-layout and pymupdf4llm come from Artifex Software and are dual-licensed under AGPL-3.0 or a commercial licence from Artifex. They are required dependencies: PDF conversion does not work without them. Running the CLI on your own machine, or a markitai serve instance only you talk to, carries no AGPL obligation. Redistributing the combined work, or offering it to other people over a network, does.

NOTICE carries the full terms, the rest of the dependency licensing, and the attribution for the code markitai ports from defuddle (MIT) and marker (Apache-2.0).