Skip to main content
Glama

OCR MCP 服务

中文 | 日本語

基于 MCP 的 OCR 服务,由 PaddleOCR 驱动,支持文本识别和表格识别。

功能特性

  • OCR 文本识别:识别图像中的文本内容,支持中文、英文等多种语言

  • 表格识别:识别图像中的表格并返回结构化数据

  • 手写识别:识别图像中的手写文本

  • 公式识别:识别图像中的数学公式并返回 LaTeX 格式

  • 多格式支持:支持 JPG、PNG、BMP、TIFF、WebP 等图像格式

  • URL 支持:支持本地文件路径和网络 URL

  • MCP 协议:标准 MCP 服务,可集成到兼容 MCP 的 AI 助手中

Related MCP server: mcp_ocr

安装

通过 pip 安装

pip install ocr-mcp

从源码安装

git clone https://github.com/LinuxLinking/OCR_MCP.git
cd OCR_MCP
pip install -e .

使用

作为 MCP 服务运行

# Run directly
ocr-mcp

# Or run via Python module
python -m ocr_mcp

与 Claude Desktop 集成

添加到 Claude Desktop 配置文件:

{
  "mcpServers": {
    "ocr": {
      "command": "ocr-mcp",
      "args": []
    }
  }
}

MCP 工具说明

ocr_recognize

识别图像中的文本内容。

参数:

  • source(必填):图像来源,本地文件路径或 URL

  • language(可选):识别语言,默认为 ch(中文),支持 enjapankorean

  • use_angle_cls(可选):是否启用文本方向分类,默认为 true

示例输出:

1. Hello World (confidence: 98.50%)
2. 你好世界 (confidence: 97.20%)

ocr_table

识别图像中的表格内容并返回结构化数据。

参数:

  • source(必填):图像来源,本地文件路径或 URL

  • language(可选):识别语言,默认为 ch

示例输出:

+--------+-----+------+
| Name   | Age | City |
+--------+-----+------+
| Alice  | 25  | NYC  |
+--------+-----+------+
| Bob    | 30  | LA   |
+--------+-----+------+

ocr_handwrite

识别图像中的手写文本内容。

参数:

  • source(必填):图像来源,本地文件路径或 URL

  • language(可选):识别语言,默认为 ch

示例输出:

1. Hello World (confidence: 85.50%)
2. 你好 (confidence: 82.30%)

ocr_formula

识别图像中的数学公式并返回 LaTeX 格式。

参数:

  • source(必填):图像来源,本地文件路径或 URL

示例输出:

Formula 1:
  LaTeX: E = mc^2
Formula 2:
  LaTeX: \int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}

开发

安装开发依赖

pip install -e ".[dev]"

运行测试

pytest tests/ -v

项目结构

OCR_MCP/
├── src/ocr_mcp/
│   ├── __init__.py          # Package initialization
│   ├── __main__.py          # Module entry point
│   ├── server.py            # MCP service main entry (dispatch layer)
│   ├── ocr_engine.py        # Subprogram 1: Text recognition engine
│   ├── table_parser.py      # Subprogram 2: Table recognition engine
│   ├── formula_engine.py    # Subprogram 3: Formula recognition engine
│   └── utils.py             # Utility functions
├── tests/
│   └── test_ocr.py          # Test files
├── pyproject.toml           # Project configuration
├── LICENSE                  # MIT License
└── README.md                # Project documentation

架构

本项目采用子程序并行架构,包含 4 个独立的识别工具,可单独调用:

┌─────────────────────────────────────────────────────────┐
│                   MCP Server (Dispatch Layer)            │
├──────────────┬──────────────┬─────────────┬─────────────┤
│ Subprogram 1 │ Subprogram 2 │ Subprogram 3│ Subprogram 4│
│ocr_recognize │  ocr_table   │ocr_handwrite│ ocr_formula │
│Text Recognition│Table Recognition│Handwriting Recognition│Formula Recognition│
└──────────────┴──────────────┴─────────────┴─────────────┘
       ↓              ↓              ↓              ↓
   OCREngine     TableParser    OCREngine    FormulaEngine

特性:

  • 每个子程序独立运行,无依赖

  • 支持并行调用,可同时处理多个任务

  • 每次调用创建独立实例,避免状态冲突

  • 可单独扩展或替换任何子程序

依赖

  • PaddleOCR:核心 OCR 识别引擎

  • PaddlePaddle:深度学习框架

  • OpenCV:图像处理

  • MCP:模型上下文协议服务框架

许可证

本项目基于 MIT 许可证 开源。

相关链接

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

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides OCR services powered by Google's Gemini API to extract text from images via file paths or base64 strings. It enables high-accuracy text recognition and CAPTCHA processing through simple MCP tools.
    7
  • A
    license
    A
    quality
    A
    maintenance
    Modular OCR MCP server supporting Apple Vision, PaddleOCR, and PaddleOCR-VL backends. Enables text, layout, table, formula, and chart extraction from images via natural language.
    14
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables image analysis via OpenAI-compatible vision APIs, supporting local files, URLs, and base64 inputs with intelligent tiling for high-resolution images. Provides a secure, configurable MCP stdio server for structured vision analysis.
    1,264
    1
    MIT

View all related MCP servers

Related MCP Connectors

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

  • OCR.space MCP — wraps the OCR.space API (ocr.space) for image/PDF → text OCR.

  • ImagePay MCP: 40 x402 paid API tools (OCR, PDF, image, QR, tabular, web). Pay per call on Base.

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/LinuxLinking/ocr-mcp'

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