When agents handle document tasks, they often need to extract text from images or PDFs. Directly uploading to the cloud poses privacy risks and depends on network connectivity. A locally-running OCR solution is a more secure choice. Below is an introduction to a local OCR plugin that runs in DeepSeek Harness.
Plugin Overview¶
This plugin is maintained by user bauerelizabeth07139 and is named opencode-ppocr-mcp. It is based on PaddleOCR 3.7.0 and the PP-OCRv6 Medium detection + recognition models, using ONNX Runtime for local inference on CPU. It supports text recognition for single images and multi-page PDFs without any cloud processing.
Core Features¶
- Image Recognition: Performs detection and recognition on a single image, directly returning text content.
- PDF Recognition: Renders and recognizes multi-page PDF documents page by page.
- Pure Local Inference: CPU-based inference using ONNX Runtime, with no GPU support.
- Privacy & Security: Data is processed entirely locally without uploading to the cloud.
Installation & Activation¶
Installation requires specifying a profile (e.g., web).
Command Line Installation¶
dsh plugin --profile web add bauerelizabeth07139/opencode-ppocr-mcp
Desktop Installation¶
Open Plugins in the sidebar of DeepSeek Harness Desktop, select Add plugin, and enter the repository address https://github.com/bauerelizabeth07139/opencode-ppocr-mcp. After installation, switch to enable the newly installed dsh-ppocr bundle.
Typical Usage¶
After the plugin registers its tools, DSH automatically adds the mcp__ppocr__ namespace. Call examples are as follows:
- Recognize a single image:
mcp__ppocr__ocr_image(image_path=<image path>)
- Recognize a specified page range in a PDF (starting from page 1, recognizing through page 5):
mcp__ppocr__ocr_pdf(pdf_path=<PDF path>, start_page=1, end_page=5)
Use Cases & Notes¶
- Dependencies: The runtime environment requires Python >= 3.8 and the following specified dependency packages:
pip install paddlepaddle==3.0.0 paddleocr==3.7.0 onnxruntime Pillow
- Model Download: The first tool call will download model files (approximately 170 MB), which are stored in the
~/.paddlex/official_models/directory. The first call may be slower. - Performance Limitations: Only CPU inference is supported; GPU and display are not supported, therefore screenshot recognition is not available.
- Parameter Validation: The
end_pageparameter must be passed as an integer; the server does not perform automatic type conversion. - Credential Security: The plugin supports passing credentials (e.g., API Keys) via environment variables, but Harness automatically filters environment variables with credential-like names such as
KEY,TOKEN,SECRET,PASSWORD, etc., to prevent sensitive information leakage.
Conclusion¶
This plugin implements lightweight OCR capabilities through local ONNX Runtime, making it suitable for privacy-sensitive or network-constrained scenarios. For related documentation and source code, please refer to the plugin directory or the GitHub repository.