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: DocMistral MCP Server

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the behavioral disclosure burden. It clearly explains the mechanism ('Uses the PDF text layer and image geometry only') and discloses a key limitation ('no OCR is run'), which is essential context for an agent deciding whether this tool is sufficient. It does not detail output structure, but that is less critical here.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the first line states the core function and output categories, the second line clarifies mechanism and intended usage. Every sentence adds value with no repetition or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (one parameter, no output schema), and the description covers what it does, how it works, and where it fits in the workflow. It does not spell out the exact return structure or edge cases, but for an inspection tool the stated categories and intended sequencing are sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'path' has 0% schema description coverage, and the description does not explicitly define it. However, by repeatedly referencing 'a PDF', the description provides enough inference that the path is the location of the PDF file. It adds contextual meaning but does not fully compensate for the absent schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Classify'), identifies the resource ('each page of a PDF'), and names the exact output categories ('text / scanned / mixed / blank'). It also distinguishes itself from OCR workflows by explicitly stating 'no OCR is run', which separates it from the sibling tool ocr_pdf.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear contextual guidance: 'Use this first to decide whether (and which pages need) OCR.' This tells an agent when to invoke the tool without explicitly naming the alternative tool or providing exclusion conditions, keeping it at a 4 rather than a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
pagesNo
out_pathNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of disclosing behavior. It transparently explains that text pages use MarkItDown, scanned pages use vision OCR, page selection via `pages`, and that `out_path` causes a file write with a summary returned. It does not explicitly mention whether the input PDF is modified, but the described behavior strongly implies a read-and-convert operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured. It front-loads the main purpose, then provides necessary details about page handling and output behavior in a logical sequence, with no redundant or off-topic information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is sufficiently complete for the tool's functionality: it explains the conversion process, page selection, and output behavior. Since an output schema exists, return-value details are not required. It does not cover error handling or invalid page syntax, but those are not essential for basic contextual completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, but the tool description compensates by explaining `pages` with an example format ('1-5,9') and its effect, and `out_path` with its write-and-summary behavior. The `path` parameter is implied as the PDF source. Some details, such as accepted path types or behavior when `out_path` is omitted, are not explicitly stated.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's primary action: converting a PDF to Markdown. It also specifies the resource (PDF) and the output format, and clarifies how scanned vs. text-layer pages are handled, leaving no ambiguity about the tool's purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains conditional behavior for `pages` and `out_path`, but it does not explicitly state when to choose this tool over its siblings like `inspect_pdf` or `omlx_models`. It lacks direct guidance on use cases or selection criteria relative to alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

omlx_modelsA

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

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It mentions checking health and listing models, but does not explicitly state whether this is read-only or if it has side effects. The behavior is implied to be safe but not fully disclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise, one sentence, and directly conveys the purpose without fluff or redundancy. It is well-structured for a simple diagnostic tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is sufficient for a tool with no parameters and no output schema. It tells the agent what the tool does. A minor gap is the lack of detail on what 'health' includes, but overall it is complete enough for its simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has no parameters, so there is nothing to explain. The schema is empty and the description adds no unnecessary parameter details. Trivially complete for this dimension.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool checks health by listing available models and the resolved OCR model. This is specific and distinct from the sibling tools (inspect_pdf, ocr_pdf), which focus on PDF operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for checking model health but does not explicitly state when to use it vs. alternatives. No direct guidance is provided, though the context suggests it is a diagnostic/read-only tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updatesv0.1.0
    • First observedinspect_pdf
    • First observedocr_pdf
    • First observedomlx_models

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers