PaddleOCR-MCP
PaddleOCR MCP (Model Context Protocol) server and CLI tool that extracts text from images and outputs results in markdown format. Optimized for fast inference with GPU auto-detection.
Installation
CLI Tool
This tool can be run using uvx:
uvx --from . paddleocr-md <image_path> [-o output.md]
Or install it locally:
uv pip install -e .
paddleocr-md <image_path> [-o output.md]
MCP Server
The MCP (Model Context Protocol) server allows integration with MCP clients like Cursor, Claude Desktop, etc.
Run MCP server with uvx:
uvx --from . python -m paddleocr_cli.mcp_server
See MCP_README.md for detailed MCP server documentation and integration instructions.
Usage
Basic Usage
The tool is optimized for speed by default with the following settings:
- Fast mode enabled (disables preprocessing for maximum speed)
- PP-OCRv4 (faster mobile models)
- 640px image size limit (faster processing)
- Auto GPU detection (uses GPU if available, falls back to CPU)
# Output will be saved as <image_name>.png.md
# Uses: fast mode + PP-OCRv4 + 640px + auto GPU detection
uvx --from . paddleocr-md image.png
# Specify custom output path
uvx --from . paddleocr-md image.png -o result.md
# Force CPU mode
uvx --from . paddleocr-md image.png --cpu
# Disable fast mode for better accuracy on rotated text
uvx --from . paddleocr-md image.png --no-fast
# Use PP-OCRv5 for better accuracy (slower)
uvx --from . paddleocr-md image.png --ocr-version PP-OCRv5
Default Optimization Settings
The tool is optimized for speed by default with these settings:
- ✅ Fast mode enabled: Disables textline orientation classification (skips one model)
- ✅ PP-OCRv4: Uses faster mobile models (PP-OCRv4_mobile_det, PP-OCRv4_mobile_rec)
- ✅ 640px image size limit: Faster processing (vs default 960px)
- ✅ Auto GPU detection: Automatically uses GPU if available, falls back to CPU
- ✅ Document preprocessing disabled: Skips unnecessary preprocessing steps
Customization Options
-
--no-fast: Disable fast mode for better accuracy- Enables textline orientation classification
- Better accuracy on rotated text, but slower
-
--cpu: Force CPU mode- Overrides auto GPU detection
- Explicitly use CPU
-
--gpu: Force GPU mode- Will fail if GPU not available
- Use when you want to ensure GPU usage
-
--ocr-version PP-OCRv5: Use better accuracy version- PP-OCRv5 has better accuracy but slower than PP-OCRv4 (default)
- Uses server models
-
--max-size <pixels>: Adjust image processing size- Default: 640px
- Larger values (e.g., 960, 1280) = better accuracy, slower
- Smaller values (e.g., 480) = faster, may reduce accuracy
-
--hpi: High-Performance Inference- Automatically selects best inference backend (Paddle Inference, OpenVINO, ONNX Runtime, TensorRT)
- Requires HPI dependencies:
paddleocr install_hpi_deps cpu/gpu - Best performance but requires additional setup
Examples
# Basic usage (uses all optimizations by default: fast + PP-OCRv4 + 640px + auto GPU)
uvx --from . paddleocr-md photo.jpg
# Process with custom output
uvx --from . paddleocr-md document.png -o extracted_text.md
# Better accuracy (slower) - disable fast mode and use PP-OCRv5
uvx --from . paddleocr-md image.png --no-fast --ocr-version PP-OCRv5 --max-size 960
# Force CPU mode
uvx --from . paddleocr-md image.png --cpu
# Use High-Performance Inference (requires HPI dependencies)
uvx --from . paddleocr-md image.png --hpi
Output Format
The tool generates a markdown file containing:
- Source image path
- List of detected text (one per line)
Example output (test_image.png.md):
# OCR Result
**Source Image:** `test_image.png`
---
- HelloPaddleOcR
- 10000C
Requirements
- Python >= 3.8
- PaddleOCR
- Pillow
License
MIT
Metadata
Release files for paddleocr-mcp-server 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| paddleocr_mcp_server-0.1.0.tar.gz | 10.9 kB | Without provenance | Details for paddleocr_mcp_server-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| paddleocr_mcp_server-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for paddleocr_mcp_server-0.1.0-py3-none-any.whl |
Total release size: 19.8 kB
Release files / paddleocr_mcp_server-0.1.0.tar.gz
| Download URL | paddleocr_mcp_server-0.1.0.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd6d496bb5eb9fbddd95e53f783da53bbfea0e2d04337b39cccc184a4342a103
|
|
BLAKE2b-256 checksum How to use checksums |
bbd671e7d2cfb54b8b3d140ee5d124a897d2320ad5d5a3ddec265a20d67793fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Release files / paddleocr_mcp_server-0.1.0-py3-none-any.whl
| Download URL | paddleocr_mcp_server-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b37f247761f59096236394b5f52941bb25e03d01c8738be22a85bdf2baf536ed
|
|
BLAKE2b-256 checksum How to use checksums |
44b2691ac1f7f946277e0846767d208de94d827267f9efb9490cbd8fcb07c098
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Security for paddleocr-mcp-server 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.