Skip to main content
Glama

๐Ÿ” PaddleOCR-json MCP

Local OCR for MCP clients, powered by PaddleOCR-json v1.4.1

Python MCP PaddleOCR--json License CI

A lightweight Model Context Protocol (MCP) wrapper that exposes local PaddleOCR-json text recognition to any compatible MCP client.

Image path ยท Base64 ยท local processing ยท reusable engine process


โœจ Features

  • ๐Ÿ–ผ๏ธ Recognize text from a local image path.

  • ๐Ÿงฉ Recognize Base64 or data:image/...;base64,... input.

  • ๐Ÿ“ Optionally return text boxes and confidence scores.

  • โšก Reuse one PaddleOCR-json process across multiple requests.

  • ๐Ÿ” Restart once automatically when an OCR request fails.

  • ๐Ÿงน Cleanly terminate the child process when the MCP server exits.

  • ๐ŸชŸ Windows and ๐Ÿง Linux runtime layouts supported by the wrapper.

  • ๐Ÿ”’ OCR runs through a local PaddleOCR-json runtime; no remote OCR API is required.

  • ๐Ÿ”Œ Client-agnostic stdio MCP server โ€” no dependency on a specific agent platform.

Related MCP server: Vision-OCR-MCP

๐Ÿงฐ MCP tools

Tool

Purpose

recognize_image

OCR a local image file.

recognize_image_base64

OCR an image supplied as Base64.

paddleocr_status

Check engine files and current subprocess status without starting OCR.

recognize_image and recognize_image_base64 accept include_details=true to include bounding boxes in the normalized result.

๐Ÿ—๏ธ How it works

MCP client
   โ”‚  JSON-RPC over stdio
   โ–ผ
FastMCP wrapper (main.py)
   โ”‚  line-oriented JSON over stdin/stdout
   โ–ผ
PaddleOCR-json v1.4.1
   โ”‚
   โ””โ”€โ”€ models / native runtime files

The wrapper keeps the OCR engine alive for reuse. A single stdout reader feeds responses through a queue, requests are serialized with a lock, and shutdown uses terminate โ†’ wait โ†’ kill as a fallback.

๐Ÿš€ Quick start

1. Clone and install

git clone https://github.com/luffy666code/PaddleOCR-json-MCP.git
cd PaddleOCR-json-MCP
python -m venv .venv

Activate the virtual environment, then install:

python -m pip install -U pip
python -m pip install -e .

2. Add the PaddleOCR-json runtime

Download PaddleOCR-json v1.4.1 from the upstream release page:

https://github.com/hiroi-sora/PaddleOCR-json/releases/tag/v1.4.1

Place the runtime under engine/.

Windows

engine/
โ”œโ”€โ”€ PaddleOCR-json.exe
โ””โ”€โ”€ models/

Linux

engine/
โ”œโ”€โ”€ bin/
โ”‚   โ””โ”€โ”€ PaddleOCR-json
โ”œโ”€โ”€ lib/
โ””โ”€โ”€ models/

See engine/README.md for the expected layout.

3. Run the MCP server

python main.py

The server uses stdio, so in normal use it is started by your MCP client rather than run interactively.

๐Ÿ”Œ MCP client configuration

A generic source-mode configuration looks like this:

{
  "mcpServers": {
    "paddleocr": {
      "command": "python",
      "args": ["/absolute/path/to/PaddleOCR-json-MCP/main.py"]
    }
  }
}

If you build a standalone wrapper, point command at the generated executable instead. The exact configuration file location depends on your MCP client.

The repository intentionally avoids client-specific placeholder syntax and deployment metadata. Keep client/platform adapters outside the reusable core.

๐Ÿงช Tool examples

Local image

{
  "image_path": "C:\\images\\receipt.png",
  "include_details": false
}

Base64 image

{
  "image_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
  "include_details": true
}

A successful normalized result has the shape:

{
  "code": 100,
  "text": "Hello OCR",
  "count": 1,
  "lines": [
    {
      "text": "Hello OCR",
      "score": 0.99,
      "box": [[10, 12], [120, 12], [120, 38], [10, 38]]
    }
  ]
}

๐Ÿ“ฆ Build a standalone wrapper

The engine and model files remain external so they can be updated separately from the Python wrapper.

Windows

scripts\build_windows.bat

Output:

dist/paddleocr-mcp.exe

Linux

./scripts/build_linux.sh

After building, keep the executable next to the engine/ directory:

runtime/
โ”œโ”€โ”€ paddleocr-mcp.exe   # Windows example
โ””โ”€โ”€ engine/
    โ”œโ”€โ”€ PaddleOCR-json.exe
    โ””โ”€โ”€ models/

๐Ÿ“ Repository layout

PaddleOCR-json-MCP/
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ engine/
โ”‚   โ””โ”€โ”€ README.md
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ build_windows.bat
โ”‚   โ””โ”€โ”€ build_linux.sh
โ”œโ”€โ”€ .github/
โ”‚   โ”œโ”€โ”€ workflows/ci.yml
โ”‚   โ””โ”€โ”€ ISSUE_TEMPLATE/bug_report.yml
โ”œโ”€โ”€ CONTRIBUTING.md
โ”œโ”€โ”€ SECURITY.md
โ”œโ”€โ”€ NOTICE
โ””โ”€โ”€ LICENSE

Generated build/, dist/, logs, virtual environments, PaddleOCR-json engine binaries, and model files are intentionally excluded from Git.

๐Ÿ” Privacy & security

The wrapper itself talks to a local PaddleOCR-json process and does not require a cloud OCR API. Images provided by file path stay on the MCP host as far as this wrapper is concerned. Your MCP client or host may implement its own logging, telemetry, or file handling, so review that environment separately.

Do not expose this MCP server to untrusted callers without considering local file access: recognize_image can read any image path that the server process has permission to access.

๐Ÿ™ Credits

This repository is an independent community wrapper around:

PaddleOCR-json v1.4.1 is licensed under the Apache License 2.0. This repository does not claim to be an official PaddlePaddle or PaddleOCR-json project.

๐Ÿ“„ License

Apache License 2.0. See LICENSE and NOTICE.


If this wrapper is useful, consider starring the upstream OCR projects too. โญ

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • OCR.space MCP โ€” wraps the OCR.space API (ocr.space) for image/PDF โ†’ text OCR.

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

  • OCR for images and Korean ID documents

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luffy666code/PaddleOCR-json-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server