Skip to main content
Glama

OCR MCP Server

A document OCR MCP tool powered by Claude Vision — no need for third-party OCR engines like Tesseract/PaddleOCR; it directly leverages the multimodal vision capabilities of large language models to extract text.

Python MCP Claude

✨ Features

  • Zero OCR engine dependencies — No Tesseract/PaddleOCR installation; all recognition capability comes from the Claude Vision API

  • Three tools — Image recognition, intelligent PDF recognition, and forced OCR for scanned documents

  • Smart fallback — Text-based PDFs directly extract embedded text at zero API cost; scanned documents are automatically converted to images and processed by Vision

  • Structured output — Supports Markdown tables, JSON, and plain text, covering tables, forms, handwriting, and other scenarios

  • Plug and play — After configuring Claude Desktop, invoke it directly with natural language

Related MCP server: @parserelay/mcp

🛠 Tools

Tool

Purpose

recognize_image

Recognizes text in images; supports printed text, handwriting, and tables; outputs Markdown/JSON

recognize_pdf

Intelligently processes PDFs: text-based versions directly extract embedded text (saving tokens); scanned documents automatically go through Vision OCR

recognize_pdf_ocr

Forces full-page Vision OCR; suited for purely scanned/handwritten PDFs

📦 Installation

# 克隆仓库
git clone https://github.com/你的用户名/ocr-mcp-server.git
cd ocr-mcp-server

# 安装依赖(仅 mcp / anthropic / PyMuPDF)
pip install -r requirements.txt

# 设置 Anthropic API Key
export ANTHROPIC_API_KEY="sk-ant-xxxxx"

⚙️ Configure Claude Desktop

Edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/

  • Windows: %APPDATA%\Claude\

{
  "mcpServers": {
    "ocr": {
      "command": "python",
      "args": ["/你的绝对路径/ocr-mcp-server/server.py"],
      "env": {
        "ANTHROPIC_API_KEY": "sk-ant-xxxxx"
      }
    }
  }
}

Restart Claude Desktop and it's ready to use.

🚀 Usage

In Claude Desktop, trigger directly with natural language:

  • "Help me recognize the text in this image" → automatically calls recognize_image

  • "Extract the table in this PDF" → automatically calls recognize_pdf

  • "What does this scanned document say" → automatically calls recognize_pdf_ocr

🧠 How It Works

图片  ──→ base64 编码 ──→ Claude Vision API ──→ 结构化文本
PDF   ──→ PyMuPDF 检测文字层
            ├─ 有文字层 → 直接提取(零成本)
            └─ 扫描件   ──→ 转图片 ──→ base64 ──→ Vision API

Core idea: use the LLM's visual understanding to replace the traditional OCR pipeline, providing stronger comprehension of complex layouts, tables, handwriting, seals, and similar scenarios while preserving semantic structure.

🔧 Tech Stack

  • mcp — Official MCP protocol Python SDK (FastMCP)

  • anthropic — Official Claude API client

  • PyMuPDF — PDF rendering and embedded text extraction

📄 License

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables document parsing into structured, confidence-scored fields via the scan tool, working with any MCP host like Claude Desktop or Cursor.
    1
    65 npm
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables Claude and other MCP-compatible agents to process documents, extract structured data, detect PII, and export LLM-ready datasets through natural language tool calls.
    8
    36 PyPI
    1
    MIT