sandraschi/ocr-mcp

FastMCP server providing advanced OCR capabilities with current state-of-the-art models (DeepSeek-OCR, Florence-2, DOTS.OCR, PP-OCRv5, Qwen-Image-Layered decomposition), WIA scanner control, and multi-format document processing for PDFs, CBZ comics, and images.

Python

23

114 commits

updated Oct 13, 2026

See the code

README

OCR-MCP

Just Ruff Python FastMCP

Complete AI OCR webapp and MCP server. A web app with a streamlined dashboard (drag-and-drop or scanner, pick an engine, click one button) and a FastMCP 3.1 MCP server for agentic IDEsClaude, Cursor, Windsurfso agents can run OCR, preprocessing, and workflows as tools. Same 14 engines, WIA scanner (Windows), and pipelines; one repo.

Topics: ocr, mcp, fastmcp, document-processing, scanner, wia, pdf, computer-vision, model-context-protocol, llm

Version Python FastMCP License OCR Engines Scanner Web UI Status

What it does

  • Web app React (web_sota/) + FastAPI (backend/app.py): upload or scan, pick engine, get text/PDF/JSON. Ports 10858 (Vite) and 10859 (API). In-app Help (/help) documents the web UI, the MCP server, and OCR backends.
  • MCP server FastMCP 3.1 stdio: tools for OCR, preprocessing, scanner, workflows. Sampling defaults to local Ollama (http://127.0.0.1:11434/v1, model llama3.2) no cloud API key. Set OCR_SAMPLING_USE_CLIENT_LLM=1 to use the host IDEs LLM instead. Mistral OCR uses MISTRAL_API_KEY when you call that backend. See AI_FEATURES.md.

Features: 14 backends (Unlimited-OCR, PaddleOCR-VL-1.5, Nemotron VL 8B, DeepSeek-OCR-2, MinerU2.5-Pro, Mistral OCR) Auto backend selection Preprocessing (deskew, enhance, crop) Layout & table extraction Form detection & reconstruction (checkbox, text field, radio, signature detection → fillable ODT via libreoffice-mcp) Quality assessment WIA scanner Auto-Scan watcher (detect documents on flatbed, auto-OCR) Batch & pipelines Multi-format export

Docs

DocDescription
InstallInstall, run MCP, Web UI (start.ps1, ports 10858/10859), PyYAML notes, client config
Backend depsWeb FastAPI backend: same venv as ocr-mcp, pyproject.toml, PyTorch, OCR_AUTO_INSTALL_DEPS
TechnicalArchitecture, tools, config, development, packaging
OCR modelsEngines, capabilities, hardware (see also AI_MODELS.md)
Backend requirementsPer-model pip packages, system deps, env/config
MCP toolset matrixPortmanteau tools, operation status, corpus v0
AI featuresSampling, SEP-1577, agentic workflows, prompts
Webapp redesignJuly 2026 redesign: dashboard-first workflow, removed legacy frontend, 5-page sidebar
Book scanningHome book scanning guide: V-cradle, CZUR, auto-scan integration
Book pipelineSpine-to-EPUB pipeline plan: cut, scan, OCR, chapter detect, EPUB, Calibre
In-app HelpSource for /help: webapp vs MCP vs backends (mirrors INSTALL / TECHNICAL)
SOTA ComplianceVerified SOTA v12.0 Architecture

Also: JUSTFILE.md (just recipes) OCR-MCP_MASTER_PLAN.md (roadmap) tests/README.md (testing)

Quick Start

git clone https://github.com/sandraschi/ocr-mcp
cd ocr-mcp
just

This opens an interactive dashboard showing all available commands. Run just bootstrap to install dependencies, then just serve or just dev to start.

Manual Setup

If you don't have just installed:

🛡️ Industrial Quality Stack

This project adheres to SOTA 14.1 industrial standards for high-fidelity agentic orchestration:

  • Python (Core): Ruff for linting and formatting. Zero-tolerance for print statements in core handlers (T201).
  • Webapp (UI): Biome for sub-millisecond linting. Strict noConsoleLog enforcement.
  • Protocol Compliance: Hardened stdout/stderr isolation to ensure crash-resistant JSON-RPC communication.
  • Automation: Justfile recipes for all fleet operations (just lint, just fix, just dev).
  • Security: Automated audits via bandit and safety.

Install (Claude Desktop)

irm https://github.com/sandraschi/ocr-mcp/releases/latest/download/install.ps1 | iex

Or download ocr-mcp.mcpb from releases (stable name) and install it in Claude Desktop. Other clients (Cursor, Windsurf, opencode):

{
  "mcpServers": {
    "ocr-mcp": {
      "command": "uv",
      "args": ["--directory", "D:/Dev/repos/ocr-mcp", "run", "ocr-mcp"]
    }
  }
}

Stack

LayerTech
MCP serverPython 3.12+, FastMCP 3.4 (stdio + streamable HTTP), Pydantic v2
REST backendFastAPI + Uvicorn (backend/app.py, port 10859)
Web UIReact + Vite + TypeScript + TailwindCSS + Zustand + Lucide + Framer Motion (web_sota/, port 10858)
DesktopTauri 2.0 NSIS (native/)
Lint/typeRuff (T20), Pyright, Biome, tsc

MCP tools (portmanteau)

ToolOperations
process_documentprocess_document, process_batch, analyze_layout, extract_tables, detect_forms, analyze_reading_order, classify_type, extract_metadata, assess_quality, validate_accuracy, compare_backends, analyze_image_quality
manage_imagepreprocess, convert, pdf_to_images, embed_text
operate_scannerlist_scanners, scanner_properties, configure_scan, scan_document, scan_batch, preview_scan, diagnostics
manage_workflowprocess_batch_intelligent, create/execute/monitor pipeline, optimize_processing, ocr_health_check, list_backends, manage_models
manage_corpusregister, update_metadata, get, search, list_recent, attach_ocr_result
ingest_bookdetect_chapters, detect_metadata, assemble_epub, full_pipeline
execute_agentic_workflowgoal-driven multi-step OCR via sampling (SEP-1577)
llm_opslist_models, loaded, switch_model, unload_all, vram
get_help / get_status / shutdown_serverdocs, health, graceful exit

Env vars

VarDefaultPurpose
OCR_DEFAULT_BACKENDautodefault engine (tesseract, paddleocr-vl, mistral-ocr, …)
MISTRAL_API_KEY—Mistral OCR cloud backend
OCR_TRANSPORT / MCP_TRANSPORTstdiostdio, http, sse
MCP_PORT / OCR_PORT10859HTTP bind port
TESSERACT_CMD / POPPLER_PATH—native helper paths (Windows)
OCR_SAMPLING_USE_CLIENT_LLM01 = use host IDE LLM for sampling

Ports

ServicePort
Vite frontend10858
FastAPI backend + MCP HTTP (/mcp)10859

Full reference: llms-full.txt. Backend deps: docs/BACKEND_DEPS.md. Onboarding: docs/ONBOARDING.md.

License

MIT — see LICENSE.

agentic-workflow
fastmcp
mcp
mcp-server
ocr

sandraschi/ocr-mcp

FastMCP server providing advanced OCR capabilities with current state-of-the-art models (DeepSeek-OCR, Florence-2, DOTS.OCR, PP-OCRv5, Qwen-Image-Layered decomposition), WIA scanner control, and multi-format document processing for PDFs, CBZ comics, and images.

Python

23

114 commits

updated Oct 13, 2026

See the code

README

OCR-MCP

Just Ruff Python FastMCP

Complete AI OCR webapp and MCP server. A web app with a streamlined dashboard (drag-and-drop or scanner, pick an engine, click one button) and a FastMCP 3.1 MCP server for agentic IDEsClaude, Cursor, Windsurfso agents can run OCR, preprocessing, and workflows as tools. Same 14 engines, WIA scanner (Windows), and pipelines; one repo.

Topics: ocr, mcp, fastmcp, document-processing, scanner, wia, pdf, computer-vision, model-context-protocol, llm

Version Python FastMCP License OCR Engines Scanner Web UI Status

What it does

  • Web app React (web_sota/) + FastAPI (backend/app.py): upload or scan, pick engine, get text/PDF/JSON. Ports 10858 (Vite) and 10859 (API). In-app Help (/help) documents the web UI, the MCP server, and OCR backends.
  • MCP server FastMCP 3.1 stdio: tools for OCR, preprocessing, scanner, workflows. Sampling defaults to local Ollama (http://127.0.0.1:11434/v1, model llama3.2) no cloud API key. Set OCR_SAMPLING_USE_CLIENT_LLM=1 to use the host IDEs LLM instead. Mistral OCR uses MISTRAL_API_KEY when you call that backend. See AI_FEATURES.md.

Features: 14 backends (Unlimited-OCR, PaddleOCR-VL-1.5, Nemotron VL 8B, DeepSeek-OCR-2, MinerU2.5-Pro, Mistral OCR) Auto backend selection Preprocessing (deskew, enhance, crop) Layout & table extraction Form detection & reconstruction (checkbox, text field, radio, signature detection → fillable ODT via libreoffice-mcp) Quality assessment WIA scanner Auto-Scan watcher (detect documents on flatbed, auto-OCR) Batch & pipelines Multi-format export

Docs

DocDescription
InstallInstall, run MCP, Web UI (start.ps1, ports 10858/10859), PyYAML notes, client config
Backend depsWeb FastAPI backend: same venv as ocr-mcp, pyproject.toml, PyTorch, OCR_AUTO_INSTALL_DEPS
TechnicalArchitecture, tools, config, development, packaging
OCR modelsEngines, capabilities, hardware (see also AI_MODELS.md)
Backend requirementsPer-model pip packages, system deps, env/config
MCP toolset matrixPortmanteau tools, operation status, corpus v0
AI featuresSampling, SEP-1577, agentic workflows, prompts
Webapp redesignJuly 2026 redesign: dashboard-first workflow, removed legacy frontend, 5-page sidebar
Book scanningHome book scanning guide: V-cradle, CZUR, auto-scan integration
Book pipelineSpine-to-EPUB pipeline plan: cut, scan, OCR, chapter detect, EPUB, Calibre
In-app HelpSource for /help: webapp vs MCP vs backends (mirrors INSTALL / TECHNICAL)
SOTA ComplianceVerified SOTA v12.0 Architecture

Also: JUSTFILE.md (just recipes) OCR-MCP_MASTER_PLAN.md (roadmap) tests/README.md (testing)

Quick Start

git clone https://github.com/sandraschi/ocr-mcp
cd ocr-mcp
just

This opens an interactive dashboard showing all available commands. Run just bootstrap to install dependencies, then just serve or just dev to start.

Manual Setup

If you don't have just installed:

🛡️ Industrial Quality Stack

This project adheres to SOTA 14.1 industrial standards for high-fidelity agentic orchestration:

  • Python (Core): Ruff for linting and formatting. Zero-tolerance for print statements in core handlers (T201).
  • Webapp (UI): Biome for sub-millisecond linting. Strict noConsoleLog enforcement.
  • Protocol Compliance: Hardened stdout/stderr isolation to ensure crash-resistant JSON-RPC communication.
  • Automation: Justfile recipes for all fleet operations (just lint, just fix, just dev).
  • Security: Automated audits via bandit and safety.

Install (Claude Desktop)

irm https://github.com/sandraschi/ocr-mcp/releases/latest/download/install.ps1 | iex

Or download ocr-mcp.mcpb from releases (stable name) and install it in Claude Desktop. Other clients (Cursor, Windsurf, opencode):

{
  "mcpServers": {
    "ocr-mcp": {
      "command": "uv",
      "args": ["--directory", "D:/Dev/repos/ocr-mcp", "run", "ocr-mcp"]
    }
  }
}

Stack

LayerTech
MCP serverPython 3.12+, FastMCP 3.4 (stdio + streamable HTTP), Pydantic v2
REST backendFastAPI + Uvicorn (backend/app.py, port 10859)
Web UIReact + Vite + TypeScript + TailwindCSS + Zustand + Lucide + Framer Motion (web_sota/, port 10858)
DesktopTauri 2.0 NSIS (native/)
Lint/typeRuff (T20), Pyright, Biome, tsc

MCP tools (portmanteau)

ToolOperations
process_documentprocess_document, process_batch, analyze_layout, extract_tables, detect_forms, analyze_reading_order, classify_type, extract_metadata, assess_quality, validate_accuracy, compare_backends, analyze_image_quality
manage_imagepreprocess, convert, pdf_to_images, embed_text
operate_scannerlist_scanners, scanner_properties, configure_scan, scan_document, scan_batch, preview_scan, diagnostics
manage_workflowprocess_batch_intelligent, create/execute/monitor pipeline, optimize_processing, ocr_health_check, list_backends, manage_models
manage_corpusregister, update_metadata, get, search, list_recent, attach_ocr_result
ingest_bookdetect_chapters, detect_metadata, assemble_epub, full_pipeline
execute_agentic_workflowgoal-driven multi-step OCR via sampling (SEP-1577)
llm_opslist_models, loaded, switch_model, unload_all, vram
get_help / get_status / shutdown_serverdocs, health, graceful exit

Env vars

VarDefaultPurpose
OCR_DEFAULT_BACKENDautodefault engine (tesseract, paddleocr-vl, mistral-ocr, …)
MISTRAL_API_KEY—Mistral OCR cloud backend
OCR_TRANSPORT / MCP_TRANSPORTstdiostdio, http, sse
MCP_PORT / OCR_PORT10859HTTP bind port
TESSERACT_CMD / POPPLER_PATH—native helper paths (Windows)
OCR_SAMPLING_USE_CLIENT_LLM01 = use host IDE LLM for sampling

Ports

ServicePort
Vite frontend10858
FastAPI backend + MCP HTTP (/mcp)10859

Full reference: llms-full.txt. Backend deps: docs/BACKEND_DEPS.md. Onboarding: docs/ONBOARDING.md.

License

MIT — see LICENSE.

agentic-workflow
fastmcp
mcp
mcp-server
ocr