Skip to main content

Document → text via VLM. Independent Python MCP server (Office→PDF + PDF→Markdown/LaTeX/JSON).

Project description

docdistill

Document → text via VLM. An independent Python MCP server with two tools: document_to_pdf (Office→PDF via real renderers) and analyze_doc (PDF→Markdown/LaTeX/JSON via MinerU's VLM). Local file paths only, no CDN, images localized.

Predecessor: seed-viz's analyze_doc (Node), now independent and pure-Python.

Install

In your MCP client (.mcp.json):

{
  "mcpServers": {
    "docdistill": {
      "command": "uvx",
      "args": ["docdistill"],
      "env": { "BACKEND": "mineru-official", "AUTH": "<your-mineru-token>" }
    }
  }
}

Get a free MinerU token (1000/day): https://mineru.net/apiManage/token

Backends

BACKEND What it hits AUTH ENDPOINT
mineru-official (default) mineru.net cloud required (MinerU token) optional (default mineru.net)
mineru-tasks-v3.2 your self-hosted mineru-api none required (e.g. http://127.0.0.1:5580)

mineru-tasks-v3.2 is for users who self-host MinerU (e.g. an intranet-shared deployment: one install serves a whole campus LAN). No rate limits, no auth, data stays local.

Platform support (v1)

  • PDF extraction (analyze_doc): all platforms (hosted backend, any networked machine).
  • Office→PDF (document_to_pdf): Linux (LibreOffice) + Windows (Word/PowerPoint COM) only. macOS users get an honest error for Office files — export to PDF manually, then analyze_doc.

CLI

docdistill document-to-pdf paper.docx        # → paper.pdf, hint to use analyze_doc
docdistill analyze-doc paper.pdf              # → .docdistill/paper.md + .docdistill/images-<hash>/
docdistill analyze-doc thesis.pdf --output-format latex
docdistill analyze-doc doc.pdf --backend mineru-tasks-v3.2 --endpoint http://127.0.0.1:5580

Output lands in .docdistill/ next to the source. The images directory uses a short hash name (images-<hash>) rather than the source filename, so image references render correctly even when the source PDF has spaces/non-ASCII in its name. PDFs >180 pages auto-paginate.

Known behavior: VLM splits multi-subfigure figures

The VLM extracts purely from visual content and does semantic segmentation, not pixel-chopping. On a large figure with several subfigures (e.g. a paper's "Fig. 4 (a)–(e)"), it tends to split it into one image block per visually bounded subfigure. Conversely, a region that looks like a table (clear grid lines) is extracted as a Markdown table rather than an image — which is usually what you want.

This is the VLM's own behavior, not a docdistill bug, and there is no API switch to disable it. Switching to the non-VLM pipeline model avoids the split but noticeably degrades text quality, so docdistill uses VLM. If you need the original single-image figure, refer to the source PDF.

Status

0.1.0 beta. Interface may change before 1.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docdistill-0.1.0.tar.gz (103.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docdistill-0.1.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file docdistill-0.1.0.tar.gz.

File metadata

  • Download URL: docdistill-0.1.0.tar.gz
  • Upload date:
  • Size: 103.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for docdistill-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2177010dfb590a42b365def52e7b521282c152e826cc0be16b5f180ff82d672d
MD5 93b5bec78a2288dc9fb55afa3437eb14
BLAKE2b-256 bd13eb49625be023b1bcb18419d4201a79f05a680e7a20b256e9e77cb3d77a36

See more details on using hashes here.

File details

Details for the file docdistill-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: docdistill-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for docdistill-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c07742f47c103f1428717c45c4eae73e94f0859368069908c3d4781c08a894c7
MD5 bba82e2c7e9b18fb69087dced027b6c1
BLAKE2b-256 a3d0615c503ef2de2a98fb8c541f2916191cea862b6de1b1c7f6a017d5a627d1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page