About Scribe.js
Scribe.js is an MCP server published by scribeocr in the Content category: javaScript OCR and text extraction for images and PDFs. Conduid read 15 tools from its source: batch_extract_text, convert_docx_to_json, create_highlighted_pdf, define_tables, extract_document_text, extract_tables and 9 more. It is published to npm as scribe.js-ocr and starts with npx.
The repository has 328 stars and 22 forks, is licensed AGPL-3.0, and its last commit was on 2 Dec 2026. The latest release is v0.12.0 (27 May 2026): This release makes it possible to open and work with multiple documents at the same time. It follows v0.11.3 (6 May 2026), and the 5 most recent releases go back to v0.10.0 (8 Feb 2026). It passes all 4 static checks Conduid ran on the repository. Its topics include ocr, tesseract and webassembly.
Install
claude mcp add scribe-js -- npx -y scribe.js-ocrnpx -y scribe.js-ocrgit clone https://github.com/scribeocr/scribe.jsTools (15)
batch_extract_textExtract text from multiple documents in a directory, writing each to a .mtxt file. Returns metadata (paths, page counts, character counts) for all documents. Automatically discovers companion data files. Read the output .mtxt files directly for content.| Parameter | Type | Description |
|---|---|---|
| dataDir | string | Optional subdirectory name to search for companion data files (e.g., "_data"). |
| directory * | string | Directory containing the documents to process. |
| files | array | Optional list of specific filenames to process. If omitted, processes all supported documents in the directory. |
| footnoteAnnots | boolean | Include footnote cross-reference annotations. Default: false. |
| outputDir * | string | Directory to write extracted .mtxt text files into. Created if it does not exist. |
| parAnnots | boolean | Annotate paragraph boundaries and types. Default: false. |
| preserveSpacing | boolean | Preserve horizontal spacing from document layout. Default: false. |
convert_docx_to_jsonConvert a .docx file to .scribe.json format. Parses the docx document structure and exports it as a scribe.json file containing page/line/word data with styling and font information.| Parameter | Type | Description |
|---|---|---|
| file * | string | Path to the .docx file to convert. |
| lineSplitMode | string | How to split text into lines. "width" wraps at page width (default). "sentence" splits at sentence boundaries. |
| outputPath | string | Path for the output .scribe.json file. Default: same directory and basename as input with .scribe.json extension. |
create_highlighted_pdfCreate a PDF with specified passages highlighted, underlined, or struck through. Line mode: provide startLine/endLine, optionally with text to narrow to specific words. Quote mode: provide just page and text to search and highlight matching words.| Parameter | Type | Description |
|---|---|---|
| dataFile | string | Path to a companion data file (.scribe.json, Textract JSON, .hocr, .stext, etc.) with OCR/text data. |
| file * | string | Path to the source document. |
| highlights * | array | Array of highlight specifications. |
| outputPath * | string | Path for the output highlighted PDF. |
| pages | array | Optional array of page indices to include in the output PDF (0-indexed). Can be non-continuous and in any order. If omitted, all pages are included. |
define_tablesDefine tables on a page with pre-structured cell content. Provide cell content as rows of strings. Overwrites any existing tables for the page.| Parameter | Type | Description |
|---|---|---|
| dataFile | string | Path to a companion data file (.scribe.json, Textract JSON, .hocr, .stext, etc.) with OCR/text data. |
| file | string | Path to the document file. Optional if already loaded. |
| page * | integer | Page number (0-indexed). |
| tables * | array | Array of table definitions. |
extract_document_textExtract text from a PDF or image document. Returns text with page:line number prefixes (e.g. "0:5 some text") so lines can be referenced for highlighting. Handles text-native and image-based PDFs (via OCR). For large documents, provide "outputPath" to write ALL text to a file and get metadata back — then read the file directly. Without outputPath, returns text in optimally-sized chunks — leave startPage and maxChars at defaults unless you need a specific page range. Check "hasMore" in the response; if true, set startPage to endPage + 1 to continue. A companion data file can be provided to use existing OCR data instead of re-running recognition. Use parAnnots and/or footnoteAnnots to add document structure annotations to the output.| Parameter | Type | Description |
|---|---|---|
| dataFile | string | Path to a companion data file (.scribe.json, Textract JSON, .hocr, .stext, etc.) with OCR/text data to use instead of extracting from the PDF. |
| file | string | Path to the document file. Optional if a document is already loaded via load_document. |
| footnoteAnnots | boolean | Include footnote cross-reference annotations. Words that reference a footnote are annotated with [footnote "word" → par:ID], and footnote paragraphs show which line/word they are linked from. Best used together with parAnnots. Default: false. |
| maxChars | integer | The default (20000) is optimized for typical use — do NOT override unless you have a specific reason. Maximum characters to return per chunk. The server includes as many complete pages as fit within this limit. |
| outputPath | string | Path to write the full extracted text to a file. When provided, ALL pages are extracted (startPage/maxChars are ignored) and the result contains only metadata (path, page count, character count). Read the output file directly for content. |
| parAnnots | boolean | Annotate each group of lines with its paragraph ID and type (body, title, or footnote), e.g. "--- par:abc123 [body] ---". Use this to identify which lines belong to the same paragraph. Default: false. |
| preserveSpacing | boolean | Preserve horizontal spacing from the document layout by padding words with spaces based on their position. Makes table columns visually aligned in the output. Default: false. |
| startPage | integer | 0-indexed page to start from. Use to jump to a specific page or to continue paginating (set to endPage + 1 from the previous response). Default: 0. Ignored when outputPath is provided. |
extract_tablesGet structured table data for a page (or all pages). Returns tables previously defined via define_tables or imported from Textract/Abbyy. Optionally exports to xlsx.| Parameter | Type | Description |
|---|---|---|
| dataFile | string | Path to a companion data file (.scribe.json, Textract JSON, .hocr, .stext, etc.) with OCR/text data. |
| file | string | Path to the document file. Optional if already loaded. |
| outputPath | string | Optional path for xlsx export. If provided, also saves tables as an xlsx file. |
| page | integer | Page number (0-indexed). If omitted, returns tables from all pages. |
get_detailsRead the details recorded for one document: title, authors, date, type, publication, tags, and any field its document library added. The document library root is found by walking up from the file; a file in no such root reads as an empty record.| Parameter | Type | Description |
|---|---|---|
| file * | string | Path to the document file. |
| root | string | The document library root. Optional; found by walking up from the file when omitted. |
list_detail_fieldsList the fields a document library records for its documents, each with its key, label, kind (text, number, date, choice, choices, names, link or bool) and choices.| Parameter | Type | Description |
|---|---|---|
| directory * | string | The document library root, or any folder or file inside it. |
list_documentsList PDF and image documents in a directory. Discovers companion data files (OCR exports, .scribe.json) that can be loaded alongside documents. Where the document library keeps details (title, authors, date, type, publication, tags), each document carries its "details" and the result names the "detailsRoot".| Parameter | Type | Description |
|---|---|---|
| dataDir | string | Optional subdirectory name to also search for companion data files (e.g., "_data"). By default, only the same directory as the documents is searched. |
| directory * | string | Directory path to search for documents. |
| recursive | boolean | Also list the documents of every subfolder, skipping hidden folders. Default: false. |
| where | array | Conditions on the details, every one of which a listed document must meet: "type=Working paper", "date>=2015", "authors~=marolf", "tags!=draft", or "title=" for an unset field. Operators: = != >= <= > < and ~= (contains). A date compares at the precision given, so "date>=2015" holds for "2015-03". |
load_documentLoad a document into memory for subsequent operations. Returns page count, file info, and whether OCR data is available. Optionally provide a companion data file to use existing OCR data instead of re-running recognition.| Parameter | Type | Description |
|---|---|---|
| dataFile | string | Path to a companion data file (.scribe.json, Textract JSON, .hocr, .stext, etc.) with OCR/text data to use instead of extracting from the PDF. |
| file * | string | Path to the document file. |
merge_pdfsMerge multiple PDF files into a single PDF. Optionally select specific pages from each input file.| Parameter | Type | Description |
|---|---|---|
| files * | array | Array of PDF files to merge, in order. |
| outputPath * | string | Path for the output merged PDF. |
recognizeRun OCR on a loaded document to recognize text from images. Required for image-based PDFs and scanned documents before extracting text. Not needed for text-native PDFs or when a companion data file was loaded.| Parameter | Type | Description |
|---|---|---|
| dataFile | string | Path to a companion data file (.scribe.json, Textract JSON, .hocr, .stext, etc.) with OCR/text data to use instead of running recognition. |
| file | string | Path to the document file. Optional if a document is already loaded via load_document. |
| langs | array | Language codes to recognize. Default: ["eng"]. |
render_pageRender a page of a PDF document as a PNG image. Returns the image as base64-encoded data. Useful for visually reviewing a document page.| Parameter | Type | Description |
|---|---|---|
| dataFile | string | Path to a companion data file (.scribe.json, Textract JSON, .hocr, .stext, etc.) with OCR/text data. |
| dpi | integer | Resolution in DPI. Higher values produce larger, sharper images. Default: 150. |
| file * | string | Path to the document file. |
| page | integer | Page number to render (0-indexed). Default: 0. |
set_detailsRecord details for one document in its document library's details file, never in the PDF. "values" maps field keys to values: text for title and publication; a date as YYYY, YYYY-MM or YYYY-MM-DD; a type from the field's choices or a new one; a list of strings for tags; for authors a list of {family, given} or {literal} objects, or one string with "; " between names, where "Family, Given" is a person and "org:Name" an organization. null clears a field. Without "root" the document library root is found by walking up from the file, and a file in no such root is refused; pass "root" to create the details there.| Parameter | Type | Description |
|---|---|---|
| file * | string | Path to the document file. |
| root | string | The document library root. A folder that keeps no details yet starts keeping them where the desktop app would. |
| values * | object | Field keys to values. list_detail_fields gives the keys. |
subset_pdfCreate a new PDF containing only the specified pages from the input PDF. Pages are 0-indexed and can be non-continuous or reordered.| Parameter | Type | Description |
|---|---|---|
| file * | string | Path to the source PDF file. |
| outputPath * | string | Path for the output PDF file. |
| pages * | array | Array of page indices to include (0-indexed). Can be non-continuous and in any order. Example: [0, 2, 5] extracts pages 1, 3, and 6. |
Security checks
- ✓README presentThe repository's README runs to about 603 words.
- ✓License declaredThe repository declares the AGPL-3.0 license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedA lockfile pins dependency versions.
2 checks have not been run yet.
Releases
README
The repository's README runs to about 603 words, fetched 13 days ago. The original in the repository is authoritative.
Read full README