Skip to content
Back to search

ronzz-pdf-figures-mcp

MCP server: inventory and extract figures, tables and captions from research-paper PDFs

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/ron-ronzz-org--ronzz-pdf-figures-mcp/badge.svg)](/listings/ron-ronzz-org--ronzz-pdf-figures-mcp)

HTML

<a href="/listings/ron-ronzz-org--ronzz-pdf-figures-mcp"><img src="/api/listings/ron-ronzz-org--ronzz-pdf-figures-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 69 lines
  1. # pdf-figures-mcp
  2. An MCP tool server that inventories and extracts **figures, tables and captions**
  3. from research-paper PDFs for the **Veramiko Bibliographer** on
  4. `llm.ronzz.org`.
  5. Pipeline:
  6. ```
  7. OWUI upload store (ro) -> pdf-figures (MCP) -> /figures -> mediawiki-mcp-writer -> wiki File:
  8. ```
  9. The wiki writer mounts `/figures` read-only and lists it in `uploadDirs`, so the
  10. `local_path` returned by `extract_pdf_figure` is uploadable verbatim.
  11. ## Tools
  12. | Tool | Returns |
  13. |---|---|
  14. | `list_pdf_figures(filepath, pages?, ocr="auto", ocr_langs="eng")` | JSON inventory: `index, kind, page, caption, bbox, caption_bbox, embedded_raster, panels, area_pct, scanned` plus `scanned_pages` / `notes`. No images. |
  15. | `extract_pdf_figure(filepath, index, pages?, dpi=600, include_caption=false, ocr="auto", ocr_langs="eng")` | Text summary (`local_path`, bytes, dimensions, dpi, caption) + a 1024-px PNG preview. The full-resolution PNG is written under `/figures`. |
  16. | `render_pdf_region(filepath, page, bbox, dpi=600)` | Same summary for an arbitrary page region (uncaptioned or scanned content). |
  17. ## Detection
  18. - Captions are the anchors: `Figure|Fig.|Table|Scheme|Chart|Diagram|Plate <N>[:.]`
  19. (the punctuation requirement rejects sentences such as "Table 2 summarizes…").
  20. - Vector paths (`Page.get_drawings()`) and raster images (`Page.get_image_rects()`)
  21. are clustered; the nearest cluster above or below the caption wins; side-by-side
  22. panels with one caption are merged.
  23. - Tables are bounded from the caption to the next vertical gap (> 20 pt) or heading.
  24. - Large uncaptioned clusters (≥ 8 % of the page) are listed with `caption: null`.
  25. - **Scanned pages** (no text layer, one image covering ≥ 80 % of the page) are
  26. detected, reported in `scanned_pages`, and OCR'd **on request** only:
  27. PyMuPDF `get_textpage_ocr` → Tesseract (`eng`, `fra`, `epo`). The figure band is
  28. the ink-bounded area on the caption's side of the page.
  29. ## Rendering
  30. - Default **600 DPI**, maximum 600.
  31. - Caps: 48 MP, 8000 px on the long edge, one render at a time (`mem_limit 1g`).
  32. - The model preview is downscaled to 1024 px; only the file on `/figures` is full resolution.
  33. - OCR always runs at 300 DPI (Tesseract's accuracy plateau).
  34. ## Configuration
  35. | Env | Default |
  36. |---|---|
  37. | `PDF_FIGURES_ALLOWED_ROOTS` | `/app/backend/data/uploads:/figures` (colon-separated) |
  38. | `PDF_FIGURES_OUTPUT_DIR` | `/figures` |
  39. | `PORT` | `8000` |
  40. | `TESSDATA_PREFIX` | `/usr/share/tesseract-ocr/5/tessdata` (Dockerfile) |
  41. Paths are absolute, `realpath`-resolved and checked against the allowlist;
  42. symlinks that escape a root are rejected. Only `.pdf` files are accepted.
  43. ## Run
  44. ```bash
  45. uv sync --extra dev
  46. uv run pytest
  47. uv run python -m pdf_figures.server # streamable HTTP on :8000/mcp
  48. ```
  49. Docker: `docker build -t pdf-figures .` (arm64 image via CI).
  50. ## Licence
  51. AGPL-3.0-or-later (PyMuPDF is AGPL-3.0).

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.