Skip to main content
Glama

markitdown-ocr-mcp

MCP server exposing OCR-enabled PDF → Markdown conversion to Claude Code.

MarkItDown + the official markitdown-ocr LLM-vision plugin, backed by a local oMLX server running GLM-OCR (or any OpenAI-compatible vision endpoint).

Setup

uv sync --group dev
uv tool install --editable .
claude mcp add markitdown-ocr-mcp --scope user -- ~/.local/bin/markitdown-ocr-mcp

oMLX must be running (omlx start) with a vision model loaded.

Related MCP server: noteker

Tools

  • inspect_pdf(path) — per-page classification (text / scanned / mixed / blank), no OCR

  • ocr_pdf(path, pages?, out_path?, dpi?) — hybrid conversion to Markdown: text-layer pages via MarkItDown (exact text), scanned/mixed pages rendered and OCR'd directly by the vision model; pages ("1-5,9") extracts only a page subset; out_path writes to file; dpi overrides OCR_DPI

  • omlx_models() — oMLX health check + available models + resolved OCR model

Testing

uv run pytest                        # unit + integration, no oMLX needed
uv run python scripts/smoke_omlx.py  # live OCR smoke test (needs oMLX)
uv run python scripts/probe_mcp.py   # end-to-end probe of the installed binary

Config (env vars)

Var

Default

OMLX_URL

http://127.0.0.1:8080/v1

OMLX_API_KEY

auto-read from ~/.omlx/settings.json

OMLX_OCR_MODEL

auto-discovered from /v1/models — prefers GLM-OCR (small prefill footprint)

OMLX_OCR_PROMPT

OCR:

OCR_DPI

150 (render DPI for direct OCR)

OCR_MAX_LONG_SIDE

1300 (pixel cap keeping oMLX's prefill inside its memory guard)

Available Tools

3 tools
inspect_pdfA

Classify each page of a PDF as text / scanned / mixed / blank.

Uses the PDF text layer and image geometry only — no OCR is run. Use this first to decide whether (and which pages need) OCR.

Inputs: path (required).

ocr_pdfA

Convert a PDF to Markdown, OCR-ing scanned/image pages via oMLX.

Text-layer pages go through MarkItDown directly; scanned pages are rendered and OCR'd by the vision model. If pages is given (e.g. "1-5,9"), only those pages are converted. If out_path is given the Markdown is written there and a summary is returned instead.

Inputs: path (required), pages, out_path. Returns: result

omlx_modelsA

Check oMLX health: available models and the resolved OCR model.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct role: inspect_pdf classifies pages, ocr_pdf performs conversion, and omlx_models checks OCR service health. There is no functional overlap or ambiguity between them.

    Naming Consistency4/5

    All names use lowercase snake_case and follow a pattern of verb_noun (inspect_pdf, ocr_pdf). omlx_models breaks the verb_noun pattern but is still readable and consistent in style, making it a minor deviation.

    Tool Count5/5

    With only three tools, the server is tightly scoped to the PDF-to-Markdown OCR workflow. Each tool serves a necessary purpose without redundancy or bloat.

    Completeness5/5

    The server supports the full workflow: inspecting PDFs to identify OCR needs, converting with optional page selection, and verifying OCR model availability. No critical missing operations are apparent for its stated purpose.

    Maintenance

    ActivityStale
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers