ocr-consensus-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ocr-consensus-mcp
One MCP server that runs two OCR engines and lets a third model pick the better reading.
┌──────────────────────────────┐
image/PDF ─►│ ocr_consensus │
├──────────────┬───────────────┤
│ Indra OCR │ MiniCPM-OCR │
│ CPU, ONNX │ llama.cpp │
└──────┬───────┴───────┬───────┘
│ candidates │
▼ ▼
┌──────────────────────────────┐
│ MiniCPM-OCR-Jev (2B scorer) │
│ score 0–1 per candidate │
└──────────────┬───────────────┘
▼
chosen text + both scoresJev is a selector, not a text merger. It scores (original image, candidate text, rendered candidate) and the higher score wins. The tool also returns line-level
agreement and the lines unique to each engine so disagreements stay visible.
Tools
Tool | Engine | Notes |
| Indra OCR (Datalab) | CPU/ONNX. Markdown, plain text, line boxes, layout blocks, reading order. |
| MiniCPM-OCR 1.0 (OpenBMB) | Image → markdown via a llama.cpp server. |
| Indra + MiniCPM + MiniCPM-OCR-Jev | Runs both on the whole page, renders both candidates, scores with Jev, returns the winner. |
| Indra blocks + MiniCPM + MiniCPM-OCR-Jev | Region-level: crops each layout block, gets Indra + MiniCPM candidates, scores each pair with Jev, assembles the winners in reading order. |
All tools take an absolute path on the MCP host. PDFs are supported by
ocr_document and ocr_consensus (first page is scored).
Related MCP server: paddleocr-mcp
Requirements
Python 3.10–3.13
llama.cpp with multimodal and MiniCPM-OCR-Jev decision-model support (the
decision model type: openbmb-minicpm-ocr-jevlog line must appear).b12628works.Models:
openbmb/MiniCPM-OCR-1.0-gguf→MiniCPM-OCR-1_0-Q4_K_M.gguf+mmproj-model-f16-4x.ggufopenbmb/MiniCPM-OCR-Jev-gguf→MiniCPM-OCR-Jev-Q4_K_M.gguf+mmproj-model-f16.ggufIndra models download automatically on first use (~76 MB)
The official Jev score service from OpenBMB/MiniCPM-OCR
Install the MCP server
python3 -m venv .venv
.venv/bin/pip install -e .Start the model servers
1. MiniCPM-OCR
llama-server \
-m MiniCPM-OCR-1_0-Q4_K_M.gguf \
--mmproj mmproj-model-f16-4x.gguf \
--host 127.0.0.1 --port 8091 \
-c 4096 -ngl 99Use -ngl 0 for CPU-only.
2. Jev forward engine
llama-server \
-m MiniCPM-OCR-Jev-Q4_K_M.gguf \
--mmproj mmproj-model-f16.gguf \
--host 127.0.0.1 --port 18499 \
-c 32768 -ngl 99Startup must log decision model type: openbmb-minicpm-ocr-jev.
3. Jev score service
git clone https://github.com/OpenBMB/MiniCPM-OCR
cd MiniCPM-OCR/scripts/minicpm-ocr-jev
python3 -m venv .venv-score
.venv-score/bin/pip install -r sdk/requirements-score.txt
JEV_BACKEND_CONFIG=sdk/backends/llamacpp.yaml \
PATH=$PWD/.venv-score/bin:$PATH \
bash sdk/start_score.sh 18501 http://127.0.0.1:18499curl http://127.0.0.1:18501/healthz must report "status": "ok".
4. This MCP server
MCP_HOST=127.0.0.1 MCP_PORT=8936 .venv/bin/python server.pyFor a LibreChat Docker container, bind to the Docker bridge and point MCP at it:
MCP_HOST=172.17.0.1 MCP_PORT=8936 .venv/bin/python server.pyEnvironment variables
Variable | Default | Purpose |
|
| MCP bind address |
|
| MCP port |
|
| MiniCPM llama.cpp endpoint |
|
| model id sent to llama.cpp |
|
| Jev score service |
| all cores | Indra worker threads |
| Liberation Sans | font used to render candidates for Jev |
LibreChat
mcpServers:
ocr:
type: streamable-http
url: http://host.docker.internal:8936/mcp
requiresOAuth: false
timeout: 120000
serverInstructions: |
Multi-engine OCR. `ocr_consensus` runs Indra + MiniCPM-OCR and uses
MiniCPM-OCR-Jev to choose the better candidate. Paths are on the host.Tools appear as ocr_document_mcp_ocr, ocr_document_minicpm_mcp_ocr, and
ocr_consensus_mcp_ocr.
Measured on an RX 9070 XT (invoice image)
Stage | GPU | CPU ( |
Indra | — | ~0.1 s |
MiniCPM-OCR | 0.3 s | 1.7 s |
Jev (2 candidates) | 0.8 s | 2.9 s |
| ~2.6 s | ~5 s |
The Jev scores in that test were Indra 0.055, MiniCPM 0.869, so MiniCPM was chosen — matching the visibly cleaner output.
Region-level consensus
ocr_regions uses Indra's layout blocks as the region set:
Indra returns blocks with
labelandbboxin reading order.Each block is cropped from the page image.
Indra's block text and a MiniCPM-OCR reading of the crop are the two candidates.
Both candidates are rendered and scored against the crop with Jev.
The higher-scoring candidate is kept; winners are assembled in block order.
Example on the invoice probe: the table block went to MiniCPM (0.051 vs Indra
0.019), the date block went to Indra, and the assembled markdown has a clean
HTML table.
Limitations
Region-level scoring depends on Indra's block segmentation. Different layout detectors may produce different regions, and candidates must share the crop.
ocr_regionscurrently uses the first page of a PDF.Candidate rendering uses a plain white page and one font. Jev's scores depend on the render, so a different font stack changes scores.
The MCP server reads host paths. LibreChat uploads live inside its container; add a shared mount or a copy step before pointing these tools at attachments.
Indra is weak on handwriting and complex merged-cell tables; MiniCPM-OCR’s full pipeline normally uses a separate layout stage.
License and credits
Apache-2.0 for this wrapper. The engines keep their own licenses:
Datalab Indra — Apache-2.0
OpenBMB MiniCPM-OCR and Jev — Apache-2.0
llama.cpp — MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert scanned PDFs to Markdown or EPUB, and translate PDF and EPUB books via MCP.
OCR images and PDFs from a link into text, Markdown or structured JSON, and read past jobs
OCR and document understanding: extract text from images, then summarize or translate it.
Hosted OCRmyPDF: add a searchable text layer to scanned PDFs and images, returned as PDF/A.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables OCR on images and PDFs, including full-page OCR, region OCR by description or bounding box, and caching with summary capabilities.-
- AlicenseCqualityDmaintenanceA local OCR MCP server that extracts text from images using PP-OCRv6 for fast text extraction and VL-1.6 for document structure analysis, with automatic model routing and GPU detection.32MIT
- FlicenseBqualityDmaintenanceEnables structured document understanding of local PDFs via a dual-extract MCP server, combining MinerU text/layout and Qwen3-VL vision with fusion adjudication for field extraction, tables, formulas, and validation. Fully local and offline.81-
- AlicenseNot gradedqualityDmaintenanceEnables document text recognition and extraction from images and PDFs using Claude Vision, including support for scanned documents and structured output, without requiring local OCR engines.MIT