Open Ocr CLI logo

Open Ocr CLI

OCR images, PDFs, and public web pages through configurable vision providers, CLI commands, or MCP tools.

Install Open Ocr CLI

Run the project’s own setup commands, in order.

Setup steps from the project

open-ocr-cli installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    npm install --global open-ocr-cli
    
  2. 2. Add to Claude Code
    claude mcp add --transport stdio --scope user open-ocr -- open-ocr-cli mcp
    

Overview

open-ocr-cli MCP server exposes OCR for images, PDFs, and public URLs through Gemini, Kimi, Meta Muse, OpenRouter, or OpenAI-compatible endpoints. Its MCP tools cover capability discovery, structured extraction, iterative agentic extraction, web-page extraction, and bounded artifact reading. Reach for it when an agent needs validated Markdown or schema-based data, resumable batch processing, and enforced cost limits.

Use cases

  • Extract invoice fields into validated JSON
  • OCR scanned folders with resumable batch jobs
  • Read public web pages as agent-accessible content
  • Process difficult documents with iterative regional re-reads
  • Check OCR costs and inputs with a dry run

Key features

  • MCP tools for file, agentic, web, and artifact extraction
  • Markdown, preset, and custom JSON Schema output
  • Gemini, Kimi, Muse, OpenRouter, and OpenAI-compatible providers
  • Resumable batches with manifests and bounded concurrency
  • Cost ceilings, rate limits, and paid-run confirmation
  • CLI, JSON protocol, Docker, and GitHub Actions support

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

4/4 checks healthy over the last 15d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars6Stargazers on the source repository.
Last commit7d agoMost recent push to the default branch.

How Open Ocr CLI works

What open-ocr-cli does

open-ocr-cli turns images, PDFs, and public web pages into Markdown or structured JSON. It can use provider presets for invoices, receipts, resumes, and business cards, or validate results against a user-supplied JSON Schema. The same OCR engine is available from the terminal, through MCP, or through a versioned JSON request protocol for scripts and agents.

Supported provider profiles include Gemini, Kimi, Meta Muse, OpenRouter, and OpenAI-compatible APIs. OpenRouter can route to supported vision models, while the generic compatible profile can target services such as a local Ollama endpoint. Provider and model selection can be changed per command.

How it works

Run open-ocr-cli mcp to start a stdio MCP server. The server uses its launch directory as a boundary: input files, schemas, configuration paths, and output directories must resolve within that directory. Provider endpoints, credential variable names, and operational limits come from the server's configuration or environment; tool arguments may reduce configured limits but cannot raise them or change routing and pricing settings.

The MCP interface includes five tools:

  • ocr_capabilities reports available providers, models, modes, schemas, and limits.
  • ocr_extract processes files as Markdown, a preset, or custom-schema data.
  • ocr_run_agentic performs iterative extraction with regional re-reads.
  • ocr_web extracts content from public URLs.
  • ocr_read_artifact reads saved results in bounded chunks.

Batch jobs support directories and globs, bounded concurrency, manifests, and resumption. Completed documents are skipped unless their content changed, and existing output files are protected from accidental replacement. Results have explicit succeeded, partial, failed, or skipped states with typed error information. Cost ceilings, request-rate limits, dry runs, and per-model price estimates help control paid processing.

Setup and configuration

Install the package globally with npm, then run open-ocr-cli doctor to check the environment. Node.js 20.19+, 22.13+, or 24+ is supported. Docker and GitHub Actions installation paths are also available.

Set the credential variable for the selected provider before starting the MCP process. open-ocr-cli init creates project configuration, while init --global writes shared configuration under the user's configuration directory. Flags take precedence over environment variables, which take precedence over configuration files. Credentials are referenced by variable name rather than stored in configuration.

Register the stdio process with Claude Code using claude mcp add --transport stdio --scope user open-ocr -- open-ocr-cli mcp. Codex requires its MCP 2026-07-28 feature and protocol environment setting, plus an appropriate working directory. OPEN_OCR_MCP_CONFIRM=1 enables confirmation before paid runs, showing the document count, cost ceiling, destination host, and credential variable.

Tools and capabilities

The CLI supports single-file extraction, structured presets, custom schemas, agentic mode, web URLs, dry runs, provider and model discovery, environment diagnostics, and batch status inspection. The machine interface accepts protocol v2 requests and emits JSONL lifecycle events ending in run.completed or run.failed.

PDF handling depends on the provider profile. Gemini and Muse read PDFs natively, Kimi extracts PDF text first, and the generic OpenAI-compatible profile accepts images only. Cloudflare AI Gateway routing is available through the gateway option.

Batch processing resumes after interruption and applies a cumulative --max-cost ceiling. If a paid provider returns no usage data, the ceiling fails closed. Output names are adjusted to avoid hidden names and agent instruction filenames.

Limitations and notes

The MCP transport is stdio, so the server inherits the working directory and environment of its host process. A single document can take a long time in agentic mode because it may issue several billed requests. Claude Code's stdio idle timeout and the server's per-document timeout need compatible values.

The server is designed for public web URLs; private-page authentication is not described as part of the web tool. Provider capabilities differ, so use ocr_capabilities or the CLI's model and provider commands before selecting a model.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Open Ocr CLI

open-ocr-cli is an MCP server that connects agents to Gemini, Kimi, Meta Muse, OpenRouter, and OpenAI-compatible vision APIs. Its main tools discover capabilities, extract files, run iterative agentic OCR, process public web pages, and read saved artifacts in bounded chunks. It returns Markdown or validated structured data.

Install it globally with npm using `npm install --global open-ocr-cli`, then run `open-ocr-cli doctor`. Node.js 20.19+, 22.13+, or 24+ is supported. Docker and GitHub Actions installation options are also available.

Set the credential variable for the selected provider, or configure it with `open-ocr-cli init` or `init --global`. Supported credentials include `GEMINI_API_KEY`, `MOONSHOT_API_KEY`, `META_API_KEY`, `OPENROUTER_API_KEY`, and `OPEN_OCR_API_KEY`. Flags override environment variables and configuration files.

Yes. Register it as a stdio server with `claude mcp add --transport stdio --scope user open-ocr -- open-ocr-cli mcp`. Start Claude Code with the provider credential in its environment, then check the connection with `/mcp`.

Yes, with Codex's MCP 2026-07-28 feature enabled. Configure the `open-ocr-cli mcp` command, set `CODEX_MCP_PROTOCOL_VERSION=2026-07-28`, provide the credential variable, and choose a working directory. The CLI protocol or portable skill can be used if MCP connection fails.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewOpen Ocr CLI AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/open-ocr-cli?style=directory)](https://allmcps.com/mcp/open-ocr-cli)
HTML Embed
<a href="https://allmcps.com/mcp/open-ocr-cli"><img src="https://allmcps.com/api/badge/open-ocr-cli?style=directory" alt="Open Ocr CLI on AllMCPs" /></a>