Skip to main content
Glama
slamsmart

Super-MCP-OCR-Deepseek

by slamsmart

๐Ÿฆ‰ Super MCP OCR for DeepSeek (teks-only LLM)

Memberi "mata" ke model AI yang tidak punya vision (mis. DeepSeek v4 Flash, DeepSeek R1, atau LLM teks-only lain) โ€” semua gambar & dokumen dibaca jadi teks murni yang bisa langsung dianalisa.

Gambar / PDF / Word / Excel / PPT
        โ”‚
        โ–ผ
   [ MCP OCR Server ]  โ”€โ”€โ–บ  teks murni  โ”€โ”€โ–บ  LLM bisa baca & jawab

โœจ Fitur

Format

Cara baca

๐Ÿ–ผ๏ธ Gambar โ€” png, jpg/jpeg, webp, bmp, gif, tif/tiff

OCR (RapidOCR + pre-process)

๐Ÿ“„ PDF

teks asli diekstrak; halaman scan otomatis di-OCR per halaman (max 25 hal)

๐Ÿ“ Office โ€” docx, xlsx/xlsm, pptx, rtf

ekstrak paragraf, tabel, slide

๐Ÿ“ƒ Teks โ€” txt, md, csv, json, xml, log, yaml, toml, html

baca langsung

Tidak didukung: .doc / .xls versi lama โ†’ simpan ulang sebagai .docx / .xlsx.

Tool yang tersedia (2 nama, fungsi sama):

  • read_document(file_path, mode, enhance) โ€” nama penuh

  • ocr_image(image_path, mode, enhance) โ€” alias kompatibel


Related MCP server: docling-mcp

๐ŸŽฏ Kenapa ini penting?

Banyak LLM yang murah/cepat hanya teks-only โ€” mereka menolak gambar (Cannot read image / model does not support image input). Padahal pengguna sering paste screenshot error, stack trace, scan dokumen, proposal PDF.

Skill ini menjembatani: file โ†’ OCR โ†’ teks โ†’ LLM, tanpa perlu model vision yang mahal.


๐Ÿš€ Cara Setup

1. Install dependensi

cd mcp-ocr
# pakai uv (disarankan)
uv sync

# atau pakai pip langsung
pip install -r pyproject.toml

Butuh Python 3.10 โ€“ 3.13. Dependensi utama: mcp, rapidocr-onnxruntime, Pillow, numpy, pypdfium2, python-docx, openpyxl, python-pptx, striprtf.

Model OCR RapidOCR (ONNX) di-download otomatis saat pertama kali dipakai.

2. Daftarkan sebagai MCP server

Tambahkan ke config MCP klien kamu (opencode, Claude Code, dst):

{
  "mcpServers": {
    "ocr": {
      "command": "python",
      "args": ["/path/ke/server.py"],
      "env": { "PYTHONIOENCODING": "utf-8" }
    }
  }
}

3. Selftest (tanpa MCP)

python server.py --selftest                    # buat sample gambar lalu OCR
python server.py --selftest "folder/file"      # test file atau folder

๐Ÿ“– Cara Pakai

Panggil tool dari LLM:

read_document(file_path="C:/Users/.../test-failed-1.png")
read_document(file_path="proposal.pdf")
read_document(file_path="laporan-bug.docx", mode="text", enhance=true)

Param

Nilai

Fungsi

file_path

path lokal / URL http(s) / file://

wajib

mode

auto | text | code

urutan baris OCR (code terbaik utk stack trace)

enhance

true (default)

autocontrast + upscale teks kecil

Hasilnya teks murni + metadata singkat, contoh:

[OCR] pasted-XXXX.png โ€” 1658x605px โ€” 21 baris โ€” avg confidence 0.98 โ€” 18.5s
----------------------------------------------------
Models
# Model Provider Source Input Output ...
1 cx/gpt-5.5 9router Codex 16.5M 685K ...
...

๐Ÿ”— Bonus: Baca gambar yang DI-PASTE langsung di chat

Ada satu masalah unik di opencode: gambar yang di-paste di kolom chat tidak disimpan sebagai file โ€” opencode menyimpannya di database SQLite (opencode.db, tabel part) sebagai base64 data-URL. Model teks-only tidak bisa melihat bytes-nya.

Helper extract-pasted-image.py menjembatani ini:

User paste gambar di chat
        โ”‚
        โ–ผ
[extract-pasted-image.py]  โ”€โ”€โ–บ  ambil gambar terbaru dari opencode.db
        โ”‚                          (base64 โ†’ file temp)
        โ–ผ
[read_document]  โ”€โ”€โ–บ  OCR  โ”€โ”€โ–บ  teks  โ”€โ”€โ–บ  LLM jawab

Pakai

python extract-pasted-image.py
# โ†’ {"paths": ["C:/.../pasted-XXXX.png"], "count": 1}

Lalu OCR hasilnya:

read_document(file_path="C:/.../pasted-XXXX.png")

Opsi:

Flag

Fungsi

--n <N>

ekstrak N gambar terakhir (default 1)

--session <id>

filter session tertentu

--outdir <dir>

folder output (default temp)

--db <path>

lokasi opencode.db (auto-detect)

Butuh Python + stdlib saja (sqlite3, base64, json). Lokasi DB auto-detect dari ~/.local/share/opencode/ lalu ~/.config/opencode/.

Alur kerja agent (otomatis)

  1. User paste gambar โ†’ model dapat error Cannot read image.

  2. Agent jalankan extract-pasted-image.py โ†’ ambil file temp.

  3. Agent panggil read_document(file_path=<hasil>) โ†’ teks.

  4. Agent analisa & jawab. Tanpa minta user simpan manual.


๐Ÿงฉ Struktur Project

Super-MCP-OCR-Deepseek/
โ”œโ”€โ”€ README.md                      โ† dokumentasi ini
โ”œโ”€โ”€ SKILL.md                       โ† skill instruction (untuk agent)
โ”œโ”€โ”€ server.py                      โ† MCP OCR server (inti)
โ”œโ”€โ”€ extract-pasted-image.py        โ† helper gambar tempelan opencode
โ”œโ”€โ”€ pyproject.toml                 โ† dependensi
โ””โ”€โ”€ .python-version                โ† versi Python

๐Ÿง  Alur Kerja Teknis (server.py)

  1. _resolve_path โ€” terima path lokal / URL http(s) / file:// โ†’ file lokal.

  2. Routing per ekstensi โ€” gambar โ†’ OCR; pdf โ†’ ekstrak+OCR; office โ†’ ekstrak; teks โ†’ baca.

  3. _ocr_pil (gambar) โ€” pre-process (grayscale + autocontrast + upscale teks kecil) โ†’ RapidOCR ONNX โ†’ susun hasil jadi baris visual (urut y lalu x).

  4. Confidence filter โ€” buang hasil OCR dengan skor < 0.35.

  5. Output โ€” header metadata + teks murni, siap dianalisa LLM.

Kenapa preprocessing?

  • Teks kecil (< 900px) di-upscale 2โ€“3ร— agar OCR akurat.

  • Gambar raksasa (> 3200px) di-cap agar tidak boros memory.

  • Autocontrast meningkatkan kontras teks di screenshot gelap/terang.


๐Ÿ”ง Troubleshooting

Masalah

Solusi

API Error 500 max instances / 401 Insufficient balance

Masalah kuota gateway model, bukan MCP OCR. Top up saldo, lalu ulangi.

Tool tidak muncul di klien

Restart sesi / mcp reconnect. Cek claude mcp get ocr โ†’ harus Connected.

OCR hasil jelek

Pakai mode="code" untuk stack trace; cek file dinaikkan resolusi.

.doc/.xls tidak terbaca

Simpan ulang sebagai .docx/.xlsx.


๐Ÿ“„ Lisensi

MIT โ€” bebas dipakai, diubah, disebarluaskan.

Dibuat untuk mengaktifkan DeepSeek & LLM teks-only lainnya di ekosistem MCP (opencode, Claude Code, dll).

A
license - permissive license
-
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, transcription, file extraction, and image generation for AI agents via MCP.

  • Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.

  • Augments MCP Server - A comprehensive framework documentation provider for Claude Code

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/slamsmart/Super-MCP-OCR-Deepseek'

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