ocr-mcp
Enables document OCR processing via OcrPlane APIs, supporting document parsing, asynchronous polling, markdown extraction, and task management.
README
OcrPlane CLI
Agent-friendly command line client for the OcrPlane/MineRU OCR API.
ocrplane-cli is the installable package and Docker image name. The installed
command is ocrplane.
Features
- Typer command line interface
- Pydantic v2 input and output models
- Rich human-readable terminal output
- Stable
--jsonoutput for agents --dry-runrequest planning- Async submit plus polling and paginated result reads
Requirements
- Python 3.11+
- An OcrPlane API base URL
- An API key from OcrPlane
Online Install
Recommended install with uv:
uv tool install "git+https://github.com/asharca/ocrplane-cli.git"
ocrplane --help
Run once without installing:
uvx --from "git+https://github.com/asharca/ocrplane-cli.git" ocrplane --help
Upgrade later:
uv tool upgrade ocrplane-cli
Alternative isolated install with pipx:
pipx install "git+https://github.com/asharca/ocrplane-cli.git"
ocrplane --help
If the repository is private or you prefer SSH:
pipx install "git+ssh://git@github.com/asharca/ocrplane-cli.git"
ocrplane --help
Upgrade later:
pipx upgrade ocrplane-cli
Install into the current Python environment with pip:
python3 -m pip install "git+https://github.com/asharca/ocrplane-cli.git"
ocrplane --help
Run directly with Docker:
docker run --rm \
-e OCRPLANE_BASE_URL="https://ocr.rhzy.ai" \
-e OCRPLANE_API_KEY="mk_xxxxxxxxxxxxxxxxxxxx" \
-v "$PWD:/workspace" \
ghcr.io/asharca/ocrplane-cli:latest \
parse /workspace/report.pdf --json
macOS Install
Using the system Python or Homebrew Python:
cd ~/Code/ocrplane-cli
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
ocrplane --help
If python3 is missing:
brew install python
Install with uv:
brew install uv
uv tool install "git+https://github.com/asharca/ocrplane-cli.git"
ocrplane --help
Or install uv with the official standalone installer:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install "git+https://github.com/asharca/ocrplane-cli.git"
ocrplane --help
Optional isolated install with pipx:
brew install pipx
pipx ensurepath
pipx install "git+https://github.com/asharca/ocrplane-cli.git"
ocrplane --help
Linux Install
Debian/Ubuntu:
sudo apt-get update
sudo apt-get install -y python3 python3-venv python3-pip git
cd ~/code/ocrplane-cli
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
ocrplane --help
RHEL/CentOS/Fedora:
sudo dnf install -y python3 python3-pip git
cd ~/code/ocrplane-cli
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
ocrplane --help
Optional isolated install with pipx:
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install "git+https://github.com/asharca/ocrplane-cli.git"
ocrplane --help
Install with uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install "git+https://github.com/asharca/ocrplane-cli.git"
ocrplane --help
Run once with uvx:
uvx --from "git+https://github.com/asharca/ocrplane-cli.git" ocrplane --help
Configure
Set the API endpoint and key:
export OCRPLANE_BASE_URL="https://ocr.rhzy.ai"
export OCRPLANE_API_KEY="mk_xxxxxxxxxxxxxxxxxxxx"
Compatibility aliases are also supported:
MINERU_API_BASE_URL
MINERU_BASE_URL
MINERU_API_KEY
API_KEY
APIKEY
Prefer OCRPLANE_BASE_URL and OCRPLANE_API_KEY for new setups.
To keep local secrets out of git:
cp .env.example .env
Then edit .env and load it before using the CLI:
set -a
source .env
set +a
Quick Start
Validate a request without sending it:
ocrplane parse /workspace/report.pdf --json --dry-run
Submit a document and wait for completion:
ocrplane parse /workspace/report.pdf --json
For large documents, submit first and read results by page:
ocrplane parse /workspace/large.pdf --json --no-wait
ocrplane status <task_id> --json
ocrplane markdown <task_id> --json --offset 0 --max-length 12000
ocrplane blocks <task_id> --json --offset 0 --limit 50
Write result artifacts to disk:
ocrplane parse /workspace/report.pdf --save-dir /workspace/ocr-report
This writes:
summary.jsonresult.mdcontent_blocks.jsonpages.json
Commands
ocrplane parse FILE
ocrplane status TASK_ID
ocrplane markdown TASK_ID
ocrplane blocks TASK_ID
ocrplane result TASK_ID
ocrplane list
ocrplane reprocess TASK_ID
ocrplane settings
Common parse options:
ocrplane parse /workspace/a.pdf \
--backend pipeline \
--lang ch \
--parse-method auto \
--formula \
--table \
--start-page 0 \
--end-page 9 \
--timeout 900 \
--poll-interval 3 \
--json
Docker
Build locally:
docker build -t ocrplane-cli .
Run against a mounted workspace:
docker run --rm \
-e OCRPLANE_BASE_URL \
-e OCRPLANE_API_KEY \
-v "$PWD:/workspace" \
ocrplane-cli parse /workspace/report.pdf --json
Published images use:
ghcr.io/asharca/ocrplane-cli:latest
The GitHub Actions workflow publishes this image on pushes to main.
Agent Notes
- Use
--jsonfor machine-readable output. - Use
--dry-runwhen planning a call or checking paths. - Use
--no-waitfor large files, then poll withstatus. - Read large markdown with
markdown --offset --max-length. - Read structured OCR blocks with
blocks --offset --limit. - Avoid printing API keys in logs or prompts.
Development
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
python -m compileall src/ocrplane
python -m pip wheel . --no-deps -w /tmp/ocrplane-cli-wheel
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.