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: mcp-upstage

🛠 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

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

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

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