ScholarOCR
Supports Google account sign-in for the Antigravity plugin and an optional Google Gemini API key for server-side OCR of visual pages.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ScholarOCR
A reusable academic-document OCR and intelligence engine for AI agents. You extract a document once into a structured, source-traceable representation, then retrieve, verify and export it in any format without running OCR again. The main agent integration is an Antigravity CLI plugin: install it, sign in with your own Google account, and Antigravity's model reads the pages. Other agents connect through the same MCP server or the CLI, and a Claude Code skill teaches Claude how to use it.
No API key is needed. By default the model doing the reading is the one in your own chat client (Antigravity, Claude Code, Claude Desktop, and ChatGPT through the hosted app): the server does every deterministic step and hands that model one page image at a time (host mode). A Gemini or OpenRouter key is optional and switches to ScholarOCR's dedicated server-side OCR pipeline.
Antigravity CLI (plugin) · Claude Code · ChatGPT (hosted) · other MCP clients · scripts
│ MCP (stdio/HTTP) │ CLI │ Python
└────────────► ScholarOCR service ◄────────┘
ingestion → routing → text layer (no model)
→ visual pages: render, crop, deskew → host mode: your client's model
(get_page_image → submit_page_content)
key mode: Gemini / OpenRouter
→ validation → IR checkpoints → verification → exports (JSON, Markdown, searchable PDF, DOCX, LaTeX, CSV/XLSX)What it does
Per-page hybrid extraction. Reliable PDF text layers are extracted deterministically with no model call. Scans, photos, math-font pages and image-heavy pages need vision. Screenshots and photos are cropped to the document region (app/screen chrome removed), skew and rotation are corrected and dark-mode notes are handled before any model sees the page. Blank pages are skipped. Duplicate pages are flagged, never dropped.
Two ways to read the visual pages.
Host mode (default): the MCP client's model gets one page image with the rules and the exact JSON shape, transcribes it, and submits it. The server validates the submission strictly (every problem reported with its path and a fix) and stores it like any other extraction.
Key mode: Gemini or OpenRouter with a profile per page type (general, math, handwriting), structured output, and a targeted review of flagged elements by a second model.
Academic structure.
LaTeX for equations and mhchem for chemistry.
Tables with spans; figures and diagrams with crops, labels and descriptions.
Questions, sub-questions and marks.
Headings, captions, footnotes and bibliography entries.
Traceability. Every element has page, source file, bounding box and a source crop.
get_source_regionreturns the original pixels.Honest uncertainty. Labels are ordinal (low/medium/high/unresolved). Unreadable regions are marked, never guessed. LaTeX, tables and legibility are checked deterministically.
Operations.
Page-level checkpoints and a content-hash cache.
Background jobs with cancel, resume and crash recovery.
Retries, rate limiting and usage tracking (key mode).
Path allow-listing and retention.
Quality trade-off. Host mode is a single pass by a general chat model, at whatever resolution the client passes to it, and its optional review pass is the same model looking at a crop again. Key mode uses a dedicated OCR prompt, the PDF text layer as a hint and an independent review model. Validation, uncertainty rules, traceability and verification are the same in both. Accuracy on real scans has not been measured for either mode yet.
Related MCP server: DocImprint Document Intelligence
Status
Area | State |
Core engine, IR, storage, ingestion, preprocessing, routing, jobs, verification | implemented, tested |
Host mode (client model transcribes, no key) | implemented; tested in-process and over a real stdio subprocess with the MCP SDK client. Run live once in Antigravity CLI (one scanned page, no key, 2026-11-03); not yet run live in Claude or ChatGPT |
Antigravity plugin |
|
Gemini and OpenRouter providers (key mode) | implemented; tested with mocked responses; exercised live in benchmark runs ( |
MCP sampling | not used: no target client supports it (see docs/ARCHITECTURE.md); a hook is kept |
Exports: JSON, Markdown, searchable PDF, DOCX, LaTeX, CSV, XLSX | implemented, tested (LaTeX compiled with XeLaTeX; DOCX native equations via pandoc; both skipped when not installed) |
Local MCP server (14 tools) | implemented; tested in-process and over a real stdio subprocess |
Hosted ChatGPT app server ( | implemented; tested in-process and over ASGI HTTP. No live ChatGPT test yet; the page-image widget path for host mode is unverified (docs/CHATGPT_APP.md) |
CLI | implemented; tested via subprocess |
Claude Code skill | written; tested with headless Claude Code 2.1.316 (Linux) in key mode |
Windows | developed and tested on Windows 11; one known test failure ( |
Accuracy on real scans | not measured yet; evaluation framework ready |
Tests: pytest --ignore=tests/live, see docs/QUALITY_ASSURANCE.md for the current count.
Quick start: Antigravity CLI (no key)
uv tool install "git+https://github.com/adiroy911/scholarocr" # the server: scholarocr-mcp on PATH
agy plugin install https://github.com/adiroy911/scholarocr # the pluginAntigravity starts the server in the plugin folder, so list the folders it may read in
%LOCALAPPDATA%\ScholarOCR\scholarocr.env (~/.local/share/scholarocr/scholarocr.env on macOS/Linux):
SCHOLAROCR_ALLOWED_DIRS=C:\Users\you\Documents;D:\StudyStart agy and ask it to read a document ("extract the scanned exam in D:\Study\chem and list anything
unreadable"). Keys are optional. Details, headless runs and the verified result:
docs/ANTIGRAVITY_PLUGIN.md.
Quick start: CLI and Python
git clone https://github.com/adiroy911/scholarocr && cd scholarocr
python -m venv .venv && . .venv/bin/activate # Windows: .\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"
scholarocr process path/to/paper.pdf --type exam-paper # text-layer PDFs work without any key
scholarocr content <document_id>
scholarocr export <document_id> --format searchable-pdfThe CLI has no model of its own: for scans it needs a key (cp .env.example .env, set GEMINI_API_KEY
or OPENROUTER_API_KEY), otherwise it stops with exit code 6 and lists the pages awaiting
transcription. Through MCP, your client's model transcribes them instead.
Connect Claude Code (no key needed):
python scripts/install_skill.py # copies claude-skill/scholarocr to ~/.claude/skills
claude mcp add --scope user scholarocr -e SCHOLAROCR_ALLOWED_DIRS="<folders>" -- "<venv>/bin/scholarocr-mcp"
# optional key mode: add -e GEMINI_API_KEY="<key>"Examples: examples/01_python_api.py, examples/02_cli_workflow.sh, examples/03_mcp_client.py,
and the config snippet examples/claude_code.mcp.json.
Documentation
Doc | Contents |
layers, data flow, threading, decisions | |
Windows / Linux / macOS setup | |
every environment variable | |
key mode: SDK usage, routing, prompts, retries, usage, verification status | |
the Antigravity CLI plugin: install, config, headless runs, layout, Marketplace | |
tools, host mode loop, client support, Antigravity, Claude Code, shared HTTP server | |
hosted server for ChatGPT: OAuth, optional key, host mode in ChatGPT, deployment | |
skill content, install, test | |
commands and exit codes | |
the universal IR and storage layout | |
formats, options, verification, limitations | |
uncertainty rules, quality metrics, verification, evaluation, tests | |
file access, secrets, deletion, network | |
common problems | |
open items, starting with live Gemini and Windows validation |
Repository layout
The repository root is also the Antigravity plugin root: .antigravity-plugin/plugin.json,
mcp_config.json, rules/, skills/ and assets/ are the plugin. src/scholarocr/ is the Python
package and claude-skill/scholarocr/ is the Claude Code skill. Changes are listed in
CHANGELOG.md.
Licence
MIT, see LICENSE. The DejaVu test fonts in tests/fixtures/fonts/ keep their own licence
(LICENSE_DEJAVU).
This server cannot be deployed
Maintenance
Related MCP Connectors
Convert PDF, Word, Excel and scanned documents to Markdown, tables and RAG chunks. OCR.
High-fidelity PDF to structured Markdown conversion and document field extraction.
Extract, ask, compare and parse PDFs/images with source evidence. OAuth sign-in or API keys.
Convert PDFs, Office docs, websites and audio into AI-ready Markdown, then search and ask your docs.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI-driven PDF document processing including PDF to Markdown conversion, intelligent text and table extraction, image extraction, format conversion between PDF/Word/Markdown, batch processing, and fuzzy search - optimized for LLM context and RAG workflows.2MIT
- AlicenseAqualityDmaintenanceVerifiable document intelligence for AI agents. Extract text, tables, and structured data from PDFs and URLs. Summarize, answer questions, check claims, and translate — all with cited evidence. Store tamper-evident evidence bundles with cryptographic signatures and on-chain attestation via Base L2. Cross-document semantic search and Q&A across named collections. Pay per call with USDC224 npm1MIT
- AlicenseAqualityAmaintenanceConverts documents to clean Markdown for AI agents from a URL or base64 — no API key, built for remote hosting. Supports PDF (tables preserved as Markdown/CSV/JSON), DOCX, PPTX, XLSX, EPUB, HTML and CSV; scanned PDFs and images go through offline OCR. Includes full-text search, page-range reading, metadata inspection, PDF split/merge and image export, with SSRF-protected fetching, 30 MB limits and10AGPL 3.0
- AlicenseAqualityCmaintenanceConverts documents among PDF, DOCX, Markdown, plain text, and images while returning fidelity reports that clearly distinguish PASS, FAIL, NOT_CHECKED, and UNSUPPORTED outcomes. Also enables lossless reading, exact search, and structured extraction from long documents without treating unchecked content as passed.16AGPL 3.0