
docling.rs
io.github.docling-project由 GitHub 账号 docling-project 发布v2.67.1更新于 Nov 7, 2026
Documents to Markdown for agents: PDF layout, tables and OCR, Office, HTML, scans. docling in Rust.
概览
本地 MCP 服务器,把 PDF、Office 文件、HTML、扫描件和音频转换成 Markdown、docling JSON 和 RAG 分块,供助手读取。
- 可以做什么
- 把文档转换为保留版式、表格和 OCR 的 Markdown
- 转换为 docling JSON、HTML、纯文本、LaTeX、分块和页面图像
- 读取 PDF、图片、Office、HTML、邮件、EPUB、字幕以及音频视频文件
- 从网址、data URI 或标准输入获取并转换文档
- 扩展名缺失或错误时按内容识别文件的真实格式
- 适用场景
- 当助手需要读取真实文档而非纯文本时使用:带表格和扫描页的 PDF、Office 文件,或需要转成 Markdown 或分块供 RAG 流程使用的混合文件夹。
- 运行要求
- 以本地 stdio 进程运行,通过 uvx 从 docling-rs-mcp 包启动,或使用容器镜像。PDF、图片和音频转换需要一次性下载的 ONNX 模型(小于 1 GB),例如用 --download-models 下载到 DOCLING_RS_CACHE_DIR。仅视频抽帧需要 PATH 中可选的 ffmpeg。无需账号或 API 密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 docling.rs,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
docling.rs
[docling.rs — a duck feeding a document into a meat grinder]
[CI] [Live browser demo] [License MIT] [crates.io version] [PyPI version] [npm version] [GitHub release] [crates.io downloads] [PyPI downloads/month] [npm downloads/month]
docling.rs converts documents — PDF, Office, HTML, scans, audio — into Markdown, docling JSON and the other shapes an LLM or a RAG pipeline can read. It is a Rust port of IBM's docling: the same output, byte-for-byte, from one static binary. No Python, no PyTorch.
Pulling text out of a PDF is easy. Keeping its structure — headings in order, tables as tables, scanned pages read — takes layout analysis, table recognition and OCR. docling has the models for that, and a Python stack to match. docling.rs runs the same models from a single binary: PDF 4.3× faster than Python docling at under half the RAM, Office and HTML 20–60× faster, and tables that survive — cell recall 0.94 where MarkItDown gets 0.31 (numbers, method).
Coming from MarkItDown?
pip install docling-rs, swap one import —
from docling_rs.markitdown import MarkItDown — and keep its API, every
format it converts included, with real layout analysis, tables and OCR
behind it: guide,
measured side by side.
Coming from Marker?
pip install docling-rs, swap the imports —
from docling_rs.marker.converters.pdf import PdfConverter — and keep its
API: create_model_dict, text_from_rendered, the JSON block tree, chunks,
marker_single's CLI and output layout, with docling's layout analysis,
TableFormer and OCR behind it and no PyTorch or inference server:
guide, measured side by side.
Coming from MinerU?
pip install docling-rs, swap the imports —
from docling_rs.mineru.parser import parse — and keep MinerU 4's SDK:
ParseResult, markdown(), the Middle JSON, Content Lists and Structured
Content, save()'s layout and mineru-kit parse, with docling's layout
analysis, TableFormer and OCR behind it and no DocVortex or llama.cpp:
guide, measured side by side.
Install
Office, HTML, Markdown and e-mail need no models. PDF, images and audio need
the ONNX models (layout, OCR, TableFormer, Whisper; under 1 GB): install.sh,
--cli and the containers bring them along; with pip, run
python -c "import docling_rs; docling_rs.download_models()" once; with npm
or a checkout, run download_dependencies.sh where you convert
(details). Windows: docs/WINDOWS.md.
▶ Try it in your browser first — the converter as wasm, OCR included; nothing leaves your device.
Use
Same options, same outputs on every surface — every option in
docs/OPTIONS.md.
Highlights
- From Python docling:
from docling_rs import DocumentConverter;result.documentis a genuineDoclingDocument(migration notes). - Every docling format, and a few it lacks — the table under Status, each validated against live docling (Conformance).
- Every output docling has: Markdown (docling's, or a stricter dialect), docling JSON, HTML, plain text, DocLang, LaTeX, Pandoc AST (→ DOCX, EPUB, Typst… through pandoc), WebVTT subtitles, RAG chunks and page images (output formats).
- From any language: Rust, Python, Node.js / Bun, the browser (wasm, fully client-side), C, C++, C#, Go, Java and Swift through one C header, any HTTP client, the shell (Integration).
- A drop-in server for docling-serve: Open WebUI uses it as its Docling
content-extraction engine — point Docling Server URL at
http://<host>:5001— and n8n, Dify and LangChain clients work unchanged (docling-rs serve, Open WebUI setup). - AI agents (MCP):
docling-rs mcpgives Claude Desktop, Claude Code, Cursor or VS Code MarkItDown'sconvert_to_markdowntool, plusconvertfor JSON, chunks and the rest —uvx docling-rs-mcp, orclaude mcp add docling -- docling-rs mcp(MCP server). - LangChain:
pip install "docling-rs[langchain]"— langchain-docling'sDoclingLoaderon the Rust engine, one import to swap (details). - AutoGen:
pip install "docling-rs[autogen]"—DoclingIndexerfills any AutoGen memory with chunks that carry their pages,DoclingConvertToollets an agent read documents (details). - Microsoft Agent Framework:
pip install "docling-rs[agent-framework]"— AutoGen's successor:DoclingIndexerfills any Agent Framework vector store,DoclingContextProviderputs the relevant chunks with their pages into each turn (details). - Your own formats: register a backend for a format docling.rs does not
read — or to read one of its formats your way — from Rust, Python
(
@docling_rs.register_backend(extensions=["rtf2"]), and MarkItDown'sregister_converterand plugins) or Node.js, ahead of the built-in formats (pluggable backends). - RAG:
docling-rag— chunk, embed and search with a REST API and a web UI (RAG subsystem). - Runs where you are: Linux x64 / arm64 / s390x, macOS (Apple Silicon) and Windows prebuilt (CLI, wheels, npm), Intel macs from source, containers for amd64 and arm64; NVIDIA CUDA and TensorRT, DirectML (a prebuilt Windows CLI), CoreML and WebGPU in the browser as opt-in accelerators (GPU, IBM Z).
Developed with Claude Code and TENET (minimalistic AI-driven development framework).
Status
Every format in docling's pipeline converts — plus a few docling lacks. A
file with no or an unknown extension, stdin, an upload or a data: URL is
typed by its content (InputFormat::detect, docling_rs.detect_format,
detectFormat: the packages, the OLE files, PDF, images, audio and video,
iWork, XML, JSON, notebooks, messages, …), and a file that fails under its
extension is checked by content and converted as what it really is, with a
warning.
Every extension, with what each backend does:
docs/MIGRATION.md.
Installing ffmpeg (optional — only for video frame sampling)
Any ffmpeg ≥ 4.x on PATH works; docling.rs shells out to the binary and
parses its output, so no dev headers/libraries are needed.
- Debian/Ubuntu:
sudo apt-get install ffmpeg - Fedora:
sudo dnf install ffmpeg-free(orffmpegfrom RPM Fusion) - Alpine:
apk add ffmpeg - macOS:
brew install ffmpeg - Windows:
winget install ffmpeg(orchoco install ffmpeg, orscoop install ffmpeg). Installing from a downloaded zip (gyan.dev / BtbN) also works — either add the extractedbin\folder toPATH, or skipPATHentirely and pointDOCLING_FFMPEGat the exe:set DOCLING_FFMPEG=C:\tools\ffmpeg\bin\ffmpeg.exe
Check with ffmpeg -version. DOCLING_FFMPEG overrides the binary used on
any OS; the docling-rs-serve Docker image ships ffmpeg preinstalled.
A trimmed, decode-only build (--disable-everything --enable-…) works too
(#853); docling.rs needs only: the file protocol; the demuxers of your
containers (mov for mp4/mov/m4v, matroska for mkv/webm, avi, mpeg);
the video decoders of your tracks (h264, hevc, vp8, vp9, av1,
mpeg4, mpeg2video, …) with their parsers; the filters select,
metadata, fps, scale, showinfo; the encoders png and
wrapped_avframe; the muxers image2 and null. No audio component is
used — the transcript is decoded in Rust — and the scene scan maps the
video stream alone. Missing a component, ffmpeg fails the scene scan
(Encoder not found, Invalid argument) and the video converts as
transcript only; DOCLING_RS_DEBUG=1 shows the message.
Conformance with Microsoft MarkItDown
MarkItDown converts the same kinds
of documents to Markdown for LLMs. Measured side by side — MarkItDown 0.1.9
(markitdown[all]) and docling.rs master after 2.51.3 (release build), 4 vCPU,
no GPU, 2026-10-25 — on this repository's test corpus and on MarkItDown's own
OCR test set
(scripts/conformance/markitdown_compare.py):
Accuracy is scored against Python docling's groundtruth, which favours
docling.rs by construction; the timings do not depend on it. Text drawn into
images (MarkItDown's own OCR test set) reads at 1.00 with docling.rs' local
OCR, against 0.00–0.33 for MarkItDown without an LLM. Method, caveats and the full
OCR comparison: docs/MARKITDOWN.md.
Conformance with Marker
Marker (datalab's marker-pdf)
converts PDFs and, through a PDF render, Office files to Markdown for LLMs
with a layout model and OCR. Measured side by side — Marker 2.0.0
(marker-pdf[full], its CPU default fast mode, llama.cpp for its OCR) and
docling.rs master after 2.51.3 (release build), 4 vCPU, no GPU, 2026-10-25 ³ —
on this repository's test corpus
(scripts/conformance/marker_compare.py):
A failed file scores 0. ¹ Only one XLSX groundtruth carries a heading.
² The median HTML file needs OCR in Marker: a cold call starts its llama.cpp
server and loads the 1.2 GB OCR model first.
³ The HTML row is the earlier run's (docling.rs 2.46.2, another host): its
re-run here was stopped after 3 h 45 min — its warm pass done, the first cold
marker_single call had spent 97 minutes on one 855-byte file, Marker's OCR model
looping on one render (5,000+ tokens for a single block).
Accuracy is scored against Python docling's groundtruth, which favours
docling.rs by construction; the timings and memory do not depend on it.
Marker reads Office files, HTML and EPUB by rendering them to PDF and
running its vision models on the render; on CPU every page its text check
flags goes through a 1.2 GB vision-language OCR model in a llama.cpp server
that pip install marker-pdf does not bring (without it 4 PDFs, 9 DOCX, 10
HTML and the EPUB fail outright). Peak RSS counts Marker's client and its
inference servers. Marker's balanced mode (its published benchmarks) needs
a GPU. Method, caveats and the API map:
docs/MARKER.md.
Conformance with MinerU
MinerU (OpenDataLab) converts PDFs,
images and Office files to Markdown and JSON for LLMs in four tiers — flash
(text layer, no models), basic (ONNX layout / table / OCR models),
standard and advanced (a vision-language model through llama.cpp).
Measured side by side — MinerU 4.0.12 and docling.rs master after 2.51.3
(release build), 4 vCPU, no GPU, 2026-10-25 — on this repository's test corpus
(scripts/conformance/mineru_compare.py):
A failed file scores 0. ¹ Only one XLSX groundtruth carries a heading.
Accuracy is scored against Python docling's groundtruth, which favours
docling.rs by construction; the timings and memory do not depend on it.
MinerU parses Office files, HTML and EPUB at flash only; basic is its
model tier on CPU; its standard tier (a 1.2 B vision-language model through llama.cpp) took 138 s for one page on a 4 vCPU CPU in the earlier run and is not in the table. Method, caveats and the API map:
docs/MINERU.md.
Conformance with Python docling
Every declarative format is compared against the live library — Markdown
byte for byte, JSON structurally (every key and value but origin/version
and re-encoded image bytes). Latest sweep, docling 2.142.1 with the
docling-core 2.103.1 it locks, over its mirrored test corpus
(scripts/conformance/full_conformance.py; ✅ all = every file matches):
¹ Deliberate: in 1706.03762 a \multirow / \multicolumn cell's row_span / col_span agree with its offsets, where upstream leaves them at 1 (docling#4817's LaTeX rewrite is ported in full, PDF figures rendered at 144 dpi like upstream's).
² xlsx_02_sample_sales_data: 20 date cells print by docling PR #4628's number-format rules (#634), which the released docling does not apply yet.
³ Deliberate: a table inside a list item stays a table after the item (upstream prints its grid right under the item line); two Wikipedia links keep docling-core 2.104's %28/%29 escaping.
⁴ Whitespace only: a one-run footnote prints on its bullet, where docling 2.142 leaves the bullet empty and puts the text on the next line.
⁵ Deliberate: a code span keeps its literal text (&), which upstream decodes when a raw HTML block sends the file through its HTML backend.
⁶ Ahead of the release: pptx_chart's 3-D column chart is read as a bar chart with its data, as docling main reads it since docling#4811 (after 2.142.1).
The residuals, with the exact files: docs/MIGRATION.md.
The PDF/image pipeline is pinned by a deterministic snapshot baseline and
scored against docling's groundtruth in
docs/PDF_CONFORMANCE.md.
Performance
One fixture per format through published Python docling and the Rust release
binary (scripts/test/performance.sh); docling ÷ docling.rs, so bigger means
Rust wins by more. Measured 2026-10-25: docling 2.142.1 (the default PyPI
install, torch included) against docling.rs master after 2.51.3, 4 vCPU, no
GPU.
† A 4 KB CSV converts in microseconds, so Rust's own process startup dominates its number; end to end it is 780× faster.
Declarative formats hold 17–28 MB against docling's 750–780 MB (it imports
torch even for them) and finish 200–890× sooner end to end; the PDF peaks at
0.46 GB against 2.2 GB and converts 19× faster end to end. Where the time
goes, and what was measured not to help:
docs/PDF_CONFORMANCE.md.
Integration — using docling.rs from your language
One engine, several front doors, the same options and outputs everywhere.
Rust when you're already in Cargo; the CLI for scripts and batch jobs; serve when several services share one warm pipeline; Node / Python in-process; wasm when the document must not leave the user's machine; FFI for anything that can call C.
Rust API
Every conversion knob is one serializable struct, docling::ConvertOptions,
filled the same way by every surface (docs/OPTIONS.md).
The library guide covers the output formats,
error handling, chunking, image extraction, streaming, OCR, the PDF switches,
the remote VLM pipeline and registering your own backends (#680).
HTTP conversion API — docling-rs serve
docling-serve exposes the converter over
HTTP with one warm PDF/image pipeline shared across requests (repeat PDFs skip
the model load), streamed Markdown, batches, ZIP inputs, async jobs, an
interactive test form at GET / and an OpenAPI 3.1 description at
GET /openapi.yaml. It also serves Python docling-serve's routes, so Open
WebUI, n8n, Dify and LangChain clients work unchanged.
Request options, server flags, async jobs, the docling-serve routes and the
Open WebUI setup: crates/docling-serve/README.md;
containers and sizing: docs/DEPLOYMENT.md.
MCP server — docling-rs mcp
docling-rs mcp is a Model Context Protocol
server in the default docling-rs binary and image. Agents get MarkItDown's
convert_to_markdown(uri) tool — same name and contract, so a
markitdown-mcp setup switches by changing the command — plus
convert(uri, to, options) and list_input_formats().
Local reads stay under --root; URLs need --allow-url-fetch. Listed in the
official MCP registry
and on Smithery. The PyPI
launcher, Docker, Streamable HTTP (--http), the security model and memory
behaviour:
crates/docling-cli/README.md.
RAG subsystem
crates/docling-rag turns documents into
chunks, embeds them (Ollama, Gemini or a local ONNX model), stores them
(SQLite + sqlite-vec or PostgreSQL + pgvector) and searches them — hybrid,
multi-query and HyDE retrieval, an evaluation harness, a REST API and a
built-in search UI.
In the browser — docling-wasm
The declarative converters and the PDF text layer compile to WebAssembly:
npm i docling.rs-wasm, then convert(bytes, filename, to) runs fully
client-side — no server, a ~3.4 MB gzipped module, optional in-browser OCR.
Details and the demo page: crates/docling-wasm.
Node.js, Python and C
- Node.js / Bun —
docling.rson npm, a prebuilt N-API addon: sync and async conversion, streaming, chunking, ZIP batches, a warmPipeline. - Python —
docling-rson PyPI (docling-rs-cudafor NVIDIA): docling'sDocumentConverterwith a genuine docling-coreDoclingDocument, MarkItDown's API, and the LangChain, AutoGen and Microsoft Agent Framework integrations. - C ABI —
docling-ffi: one library and onedocling.hfor C, C++, C#/.NET, Go, Java, Swift and Zig, prebuilt in every published release.
Deploy in a container
Compose files (standalone, Caddy TLS, CUDA), environment variables, sizing
and observability: docs/DEPLOYMENT.md.
Getting the ML models
The PDF/image pipeline needs ONNX models — RT-DETR layout, PP-OCR, and
TableFormer — and audio needs Whisper. download_dependencies.sh fetches
them from this repository's
releases into
./.models, where every surface looks (--cli: beside a cargo-installed
binary instead):
Every asset and option (ASR presets, enrichment models, NER for PII
redaction, INT8, fonts), GPU execution providers and the environment
overrides: docs/MODELS.md. IBM Z and other targets
without a prebuilt ONNX Runtime: docs/IBMZ.md.
Contributing
Bug reports and pull requests are welcome — see CONTRIBUTING.md for the build and test commands, the conformance workflow, and the conventions a change is expected to follow.
License
MIT, matching upstream docling.
来源:README.md,提交 5144ee0
工具
0版本历史
22- v2.67.1最新Nov 7, 2026
- v2.65.1Nov 3, 2026
- v2.62.0Nov 1, 2026
- v2.55.4Oct 30, 2026
- v2.53.3Oct 29, 2026
- v2.52.6Oct 26, 2026
- v2.51.3Oct 25, 2026
- v2.51.0Oct 23, 2026
- v2.49.0Oct 22, 2026
- v2.48.5Oct 22, 2026
- v2.48.0Oct 21, 2026
- v2.46.3Oct 20, 2026
- v2.46.1Oct 20, 2026
- v2.45.7Oct 19, 2026
- v2.42.0Oct 18, 2026
- v2.38.0Oct 18, 2026
- v2.37.1Oct 18, 2026
- v2.35.0Oct 16, 2026
- v2.30.1Oct 15, 2026
- v2.27.0Oct 15, 2026
- v2.24.0Oct 14, 2026
- v2.22.0Oct 14, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分