Skip to main content
Glama
root-ext-docs

root-ext-docs

by graphgrow

root-ext-docs

Document-engineering MCP tool server for ROOT Workspace (and any MCP host). Twelve tools across four surfaces:

  • PDF — pdf_info (which pages are text, which are scans), pdf_extract_text (page-ranged), pdf_pages_to_images (render to derived/ — where the workspace viewer and the model's image-read path pick them up), ocr_pdf (local tesseract).

  • Office — docx_extract, pptx_extract: structure-keeping markdown (headings, tables, slide notes).

  • Images — ocr_image, image_convert, image_crop, image_annotate (labelled rectangles for pointing at drawings).

  • Archives — archive_list, archive_extract (zip-slip refused by name, size/entry caps).

Charter, binding and tested: extract and derive, never mutate sources. No tool overwrites, deletes, or edits a user's file in place; write tools refuse output paths that collide with inputs and default to derived/ beside the source.

OCR needs the system tesseract binary (brew install tesseract) and refuses by name without it. Nothing in this pack reaches the network.

Develop

uv venv && uv pip install -e ".[dev]"
.venv/bin/pytest

Related MCP server: pdf-reader-mcp

Package (signed .rootx, ADR-0018)

uv build
.venv/bin/python tools/build_pack.py   # --unsigned for a test build

Available Tools

12 tools
archive_extractA
Idempotent

Extract an archive (or just members) into out_dir — default derived/<name>/ beside it, and NEVER anywhere else: absolute paths, .. members, and links are refused by name (zip-slip), entry count and total size are capped so a zip bomb is an error, not an outage.

Inputs: path (required), members, out_dir.

archive_listA
Read-only

List a zip/tar archive's entries (name, size, kind) plus the total uncompressed size — look before extracting. Bounded at 1000 entries; truncation is marked.

Inputs: path (required).

docx_extractA
Read-only

Extract a DOCX in document order with structure kept: headings as markdown levels, paragraphs, and tables as markdown tables — so you can cite the table under a section instead of fishing in text soup. Bounded; truncation is marked.

Inputs: path (required).

image_annotateA
Idempotent

Draw labelled rectangles on a copy of an image (up to 50 marks, each {x, y, w, h, label?}) — point at regions of a drawing or screenshot when words alone are ambiguous. Writes a NEW file; refuses an out_path that collides with the input (charter).

Inputs: path (required), marks (required), out_path (required).

image_convertA
Idempotent

Convert/resize/rotate an image into a NEW file — format by out_path suffix (png/jpg/webp/gif/bmp/tiff), optional max_dim bound on the long edge, rotation in 90° steps. Refuses an out_path that collides with the input (charter).

Inputs: path (required), out_path (required), max_dim, quality, +1 more.

image_cropA
Idempotent

Crop a pixel box (x, y, width, height from the top-left) into a NEW file — e.g. isolate one view of a drawing before OCR or a close look. Refuses a box that leaves the image and an out_path that collides with the input (charter).

Inputs: x (required), y (required), path (required), width (required), +2 more.

ocr_imageA
Read-only

OCR one image (png/jpg/gif/webp/bmp/tiff) with the LOCAL tesseract binary — needs tesseract installed and refuses by name without it; nothing reaches the network. OCR misreads numbers — verify critical values by looking at the image itself.

Inputs: path (required), lang.

ocr_pdfA
Read-only

OCR scanned PDF pages (up to 10 per call): renders each page and runs the LOCAL tesseract binary — needs tesseract installed (brew install tesseract) and refuses by name without it; nothing reaches the network. Use pdf_info first to find which pages need OCR. OCR misreads numbers — verify critical values against the rendered page.

Inputs: path (required), dpi, lang, pages.

pdf_extract_textA
Read-only

Extract the text layer of a page range (1-based: "3", "1-5", "2,4,9-11"; up to 50 pages per call). Page-ranged so a 400-page standard is read in slices instead of one blind gulp. Returns nothing useful for scanned pages — pdf_info names those, ocr_pdf reads them. Bounded; truncation is marked.

Inputs: path (required), pages.

pdf_infoA
Read-only

Inventory a PDF before reading it: page count, per-page size (mm), and — the part that matters — which pages carry a text layer and which are scans/drawings. Use it to decide between pdf_extract_text (text layer), ocr_pdf (scans), and pdf_pages_to_images (look at drawings). Reads the file on this machine; nothing leaves it.

Inputs: path (required).

pdf_pages_to_imagesA
Idempotent

Render PDF pages to PNG/JPEG files (up to 20 pages per call, dpi 30–400) in out_dir — default derived/ beside the source, never on top of it (charter). The rendered pages are ordinary images: open them in the workspace, or read them with fs.read to LOOK at a drawing-heavy page the text extractor can't serve.

Inputs: path (required), dpi, pages, out_dir, +1 more.

pptx_extractA
Read-only

Extract a PPTX slide by slide: title, body text, tables, and speaker notes (quoted, marked as notes). Bounded; truncation is marked.

Inputs: path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool targets a distinct resource or operation: archives, PDF (with clear separation between info, text extraction, rendering, and OCR), DOCX, PPTX, and images. The descriptions explain precisely when to use each, minimizing overlap.

    Naming Consistency4/5

    Most tools follow a resource_action pattern (e.g., pdf_extract_text, image_crop), but ocr_pdf and ocr_image invert this to action_resource. pdf_info uses a noun as a verb. The pattern is largely consistent with minor deviations.

    Tool Count5/5

    At 12 tools, the set is well-scoped for a document extraction server. Each tool has a clear role, covering archives, multiple document formats, and image processing without unnecessary duplication.

    Completeness4/5

    The surface covers core extraction workflows: listing/extracting archives, reading PDFs (text, renders, OCR), extracting DOCX/PPTX, and image processing. Minor gaps exist (no archive creation, no PDF metadata extraction) but do not hinder primary use.

    Related MCP Connectors

    Related MCP Servers