Skip to main content
Glama
README.md
<h1 align="center">OCR Lab</h1>

<!-- mcp-name: io.github.hpdkhoa/ocrlab-mcp -->

<p align="center"><strong>Scanned documents, read: a PDF page's own text when it has some, Tesseract OCR when it has not, every word with its box and its confidence.</strong></p>

Old manuals, patents and data sheets are often scans: pictures of pages with no text in them. OCR Lab reads them.
A page with a text layer is read from it. A page without one is rendered and read by
[Tesseract](https://github.com/tesseract-ocr/tesseract). Every line and word comes back with its box on the page, in
PDF points from the top left, and with Tesseract's confidence from 0 to 100. A number can then be found next to its
label and checked on the page picture.

OCR misreads. It read "lb" as "1b" and "folded" as "felded" on a 1970s army scan. Check every number you keep on the
page itself.

## Install

1. Install Tesseract 5: on Windows the UB Mannheim build, on macOS `brew install tesseract`, on Linux
   `apt install tesseract-ocr`. OCR Lab finds it on the PATH, in the usual install folders, or at `OCRLAB_TESSERACT`.
2. `pip install ocrlab-mcp`
3. Add it to your MCP client: `claude mcp add ocrlab -- ocrlab-mcp`

OCR Lab writes only to `OCRLAB_OUT` (default `~/.ocrlab`): its cache of read pages.

## Tools

| Tool | What it does |
|---|---|
| `pdf_info` | The page count, which pages have a text layer and which need OCR, and where Tesseract is. |
| `read_page` | One page's text and lines, with boxes and confidence; `words` adds every word. |
| `read_pages` | Several pages read and cached, with each page's source and mean confidence. |
| `find` | Every line matching a regular expression, with its page, box and the lines round it. |
| `words_in` | The words inside a box on a page: one column of a table read on its own. |
| `read_image` | An image file read by Tesseract. |

## Command line

```
ocrlab info manual.pdf
ocrlab page manual.pdf 5
ocrlab find manual.pdf "overall length|weight" 1-12
```

## Licence

MIT. Tesseract is Apache 2.0 and installed on its own.

TDQS

B3/5.0

Scored across 6 tools

Disambiguation4/5

Each tool has a fairly distinct role: pdf_info for metadata, read_page/read_pages for extraction, find for pattern search, words_in for box-scoped word retrieval, read_image for images. The only real overlap is read_page vs read_pages, but the descriptions explicitly clarify that read_pages returns metadata while read_page gives the actual text.

Naming Consistency3/5

There is a partial read_* convention (read_page, read_pages, read_image) but the remaining tools (pdf_info, find, words_in) break it, mixing noun-phrases and bare verbs. Names are readable and descriptive, but no single predictable pattern holds across the set.

Tool Count5/5

Six tools is a well-scoped set for a PDF/image OCR library, with no redundant or filler entries. Each tool maps to a clear capability without bloat.

Completeness4/5

Coverage spans metadata, single/multi-page reading, image OCR, pattern search, and box-level word extraction, which handles most OCR workflows. Minor gaps exist, such as no explicit export/save output or a tool to force/refresh OCR on a text-less page.

Maintenance

ActivityMaintained
ResponsivenessNo issues