Skip to main content

MCP server for PaddleOCR PDF-to-Markdown conversion

Project description

PaddleOCR MCP Server

通过 PaddleOCR 官方 API 将 PDF 或图片转换为 Markdown。

功能

  • Tools: ocr_pdf — 提交 PDF/图片到 PaddleOCR,返回合并后的 Markdown 文件路径

环境要求

  • Python >= 3.13
  • uv

环境变量

变量 必需 说明
PADDLEOCR_ACCESS_TOKEN AI Studio access token,从 https://aistudio.baidu.com/account/accessToken 获取

安装

cd servers/paddle-ocr
uv sync

运行

PADDLEOCR_ACCESS_TOKEN=your-token uv run python server.py

测试

uv run pytest -v

接入 MCP Host

发布到 PyPI 后可用 uvx

{
    "mcpServers": {
        "paddle-ocr": {
            "command": "uvx",
            "args": ["paddle-ocr-server"],
            "env": {
                "PADDLEOCR_ACCESS_TOKEN": "your-token"
            }
        }
    }
}

本地开发时用 uv

{
    "mcpServers": {
        "paddle-ocr": {
            "command": "uv",
            "args": ["--directory", "/path/to/servers/paddle-ocr", "run", "paddle-ocr-server"],
            "env": {
                "PADDLEOCR_ACCESS_TOKEN": "your-token"
            }
        }
    }
}

## 使用方式

调用 `ocr_pdf` tool,提供 `file_path`(本地文件)或 `file_url`(URL),二选一。

结果保存到当前工作目录下的同名文件夹,结构如下:
- `full.md` — 合并所有页面的 Markdown
- `pages/page_N.md` — 每页单独的 Markdown
- `imgs/` — 图片文件

返回值为 `full.md` 的绝对路径。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paddle_ocr_server-0.1.5.tar.gz (57.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paddle_ocr_server-0.1.5-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file paddle_ocr_server-0.1.5.tar.gz.

File metadata

  • Download URL: paddle_ocr_server-0.1.5.tar.gz
  • Upload date:
  • Size: 57.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for paddle_ocr_server-0.1.5.tar.gz
Algorithm Hash digest
SHA256 dfe18ebaa980303c7d1696b6061db42ae93246415fcdbe930588f5764cb0a7f6
MD5 174820044e868a49e32e8e3bfbc5a45f
BLAKE2b-256 b68ca8acd733dec9bd929e5f3d405a98f7e4330c1a25dc04ecd63b237f52c462

See more details on using hashes here.

File details

Details for the file paddle_ocr_server-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: paddle_ocr_server-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for paddle_ocr_server-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2a7f1c1d7dc9093a43e341cda7f3549963657d2bba36766101a8a0c56ad0771a
MD5 e0431121063c00f1bba13b494315c7f9
BLAKE2b-256 da8cd519d177d460b5d8530c9a22d9f4ce80ec8b91eac8833030fca8e491ea8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page