vlm-ocr
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.
vlm-ocr
An MCP server that OCRs scanned PDF pages (or image files) with the cheapest engine that can do the job: Tesseract first, a vision model only when needed.
Free orientation fix. Tesseract OSD (
--psm 0) straightens rotated pages. It is used only when its confidence is at least 5; otherwise the page goes to the vision model unrotated and the model orients it.Engine per call:
auto | tesseract | local | cloud.autoruns Tesseract and escalates to the cloud model when mean word confidence is below 80 or the page looks like a dense numeric table (at least 45% numeric tokens).Manual hooks: force any engine, and force rotation with
rotate = auto | 0 | 90 | 180 | 270(degrees clockwise).Anti-hallucination: vision models fail silently with clean, plausible, wrong numbers.
ocr_reconcilereads each page twice and reports only the disagreements. Unreadable cells are marked[ILLEGIBLE], never guessed.
Tools: ocr_pdf_pages, ocr_reconcile, estimate_cost, list_vision_models.
Install
sudo dnf install tesseract # or: apt install tesseract-ocr
pip install -r requirements.txtOSD needs osd.traineddata, which some distro packages omit. Download it from the tessdata project and point TESSDATA_PREFIX at the folder holding it (it must also hold eng.traineddata). Without it, rotation falls back to the vision model.
Register the server in your MCP client; see examples/mcp-config.json.
Related MCP server: OCR Lab
Configuration (environment variables)
variable | default | meaning |
| Tesseract default | folder with |
|
| Tesseract binary |
|
| Tesseract language(s), e.g. |
|
| trust OSD only at or above this confidence |
|
|
|
|
| numeric-token share that marks a dense numeric table |
|
| any OpenAI-compatible base URL |
| key for that endpoint | |
| alternative: a file holding the key (a local proxy token works too) | |
|
| cloud model id |
| off | base URL of your own server, e.g. |
| model name that server expects | |
|
| key, if your server wants one |
Engines
tesseract: free, under 2.5 s per page on a laptop CPU, no network. Best on clean print.
cloud: any OpenAI-compatible vision endpoint (OpenRouter by default). Best on faint print and hard tables.
local: for people with a GPU. Serve a vision model with llama-server, vLLM, Ollama or LM Studio, then set
LOCAL_VLM_URLandLOCAL_VLM_MODEL. Off until configured. Point it at Qwen2.5-VL or DeepSeek-OCR.auto: Tesseract, then cloud when unsure. With no cloud key set it returns the Tesseract text with a warning.
Example call: ocr_pdf_pages(pdf_path="/scans/plan.pdf", pages="14", engine="auto", rotate="auto").
Benchmark (indicative only)
Intel i7-8550U laptop, 8 threads, no GPU, 4 synthetic pages (a numeric table, a paragraph, a rotated table, a faint paragraph). Character error rate (CER), lower is better; the CER column reads table / paragraph / rotated / faint. The pages and reference text are in tests/.
engine | s/page | peak RAM | CER |
Tesseract, psm 6, no rotation fix | 0.5-2.2 | 70 MB | 0.000 / 0.000 / 1.506 / 0.354 |
Tesseract after OSD rotation | +0.9 | 70 MB | 0.000 / 0.000 / 0.000 / 0.354 |
Qwen2.5-VL-3B Q4 (llama.cpp, CPU) | 345-520 | 10.4 GB | 0.000 / 0.000 / 0.101 / 0.000 |
granite-docling-258M Q8 (CPU) | 25-59 | 0.63 GB | 0.938 / 1.478 / 0.775 / 0.001 |
OSD was correct and confident (13-18) on the clean pages at every rotation, and unreliable on the faint page (0.3-0.8), hence the confidence gate. Four pages prove little; treat the numbers as a guide. On a GPU a vision model is far faster than the CPU times above: set LOCAL_VLM_URL to Qwen2.5-VL or DeepSeek-OCR.
Tests
python -m unittest discover -s tests -vThe routing and OSD-gating tests need no network. One test runs a real OSD pass and skips if osd.traineddata is not available.
Licence
MIT, see LICENSE. Check the licence of any model you serve locally.
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
Verified OCR with per-value coordinates, plus a workspace agents can file documents into and query.
OCR for agents: PDFs and images to Markdown or JSON, routed across OCR models. Free models included.
Convert PDF, Word, Excel and scanned documents to Markdown, tables and RAG chunks. OCR.
Turn receipts and invoices (photos, PDFs or a zip) into checked numbers: vendor, date, currency, line items, tax and total, each field marked ok, check or missing. Doubtful documents come back flagged with reasons instead of guessed; repeated receipts are marked as duplicates. Exports CSV, line-item CSV, QuickBooks CSV or a renamed file pack. Free daily quota, no API key. Files deleted after 24 hours, never used for training.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables OCR of scanned PDFs and images, returning searchable PDFs, Markdown, and JSON with block coordinates, with optional proofreading to correct OCR errors. Supports uploads via web console, public URL, or one-time token, and exposes tools for job status, page text, document listing, and deletion.-
- AlicenseBqualityCmaintenanceEnables users to extract text from scanned PDF pages and images using existing text layers or Tesseract OCR, returning lines and words with bounding boxes and confidence scores. It also supports searching pages, reading specific regions, and caching results so extracted numbers can be checked against the page.62MIT
- AlicenseNot gradedqualityBmaintenanceGives coding agents on-device OCR that turns images, PDFs and scans into Markdown with tables, plain text or JSON. Also fills a JSON Schema from a document using a local language model, with all processing kept on the machine.52 npm1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to perform local CPU OCR on scanned PDFs and images, generating searchable PDFs or structured Markdown and inspecting PDFs through four validated tools.1Apache 2.0