Document Scanner

io.github.GuardBee由 GitHub 账号 GuardBee 发布v0.4.1更新于 Nov 3, 2026

Finds PII and credentials in PDFs, screenshots and scanned documents

已验证STDIO仅桌面文件与存储安全与监控

概览

AI 生成的概览

本地 MCP 服务器,在文档交给大模型之前扫描 PDF、图片和文本文件中的个人数据与凭据。

可以做什么
  • 扫描单个文件或整个文件夹中的 PDF 与图片,查找个人数据与凭据,先读 PDF 文本层,图片和无文本页面用 OCR
  • 扫描以 base64 提供的文档字节,文件类型由字节内容判断
  • 列出扫描器运行的个人数据与凭据检测器
  • 以脱敏值、严重级别和页码形式报告发现项
适用场景
当文档、截图或附件可能包含身份证号、IBAN、卡号、邮箱、电话或凭据,并希望在内容进入模型或离开本机之前先做检查时使用。
运行要求
以 npm 包形式通过 stdio 在本机运行,通常用 npx 启动。OCR 为可选项,需要安装 tesseract.js 和 @napi-rs/canvas;Tesseract 首次使用时会下载土耳其语和英语语言数据,离线时可指定本地语言目录。未声明需要账号、API 密钥或环境变量。
安装前请注意
结果虽已脱敏,但扫描器会读取所指定文件的完整内容,请谨慎选择路径。遥测默认关闭;设置 GUARDBEE_TELEMETRY=1 会把工具名、成功与否、耗时以及文件路径等短参数值发送给第三方。OCR 在模糊扫描件上可能漏掉数字,姓名、签名和手写内容不会被检测,因此无发现并不等于文档安全。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Document Scanner,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@guardbee/mcp-document-scanner

🇬🇧 English | 🇹🇷 Türkçe

[npm version] [npm downloads] [License: MIT]

An MCP server and CLI that finds personal data and credentials inside documents — PDFs, screenshots, scanned pages — before they are handed to an LLM. Text checks in a proxy or a DLP see a PDF attachment or an image as an opaque blob; this package reads it: the PDF text layer first, and OCR (Turkish and English) for images and for PDF pages that have no text.

Telemetry is off by default. With GUARDBEE_TELEMETRY=1 it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields like content, token or password are replaced with a placeholder. See @guardbee/mcp-telemetry.

document ──► type from the bytes (PDF, PNG, JPEG, GIF, WebP, BMP, TIFF, text)              │              ├─ PDF page with a text layer ──► text              ├─ PDF page without one ─────► render (@napi-rs/canvas) ──► OCR (tesseract.js)              └─ image ─────────────────────► OCR (tesseract.js)                                                 │                     guard-core detectors ◄──────┘  TC Kimlik No, VKN, IBAN, card (checksums),                                                    passport, SGK, MERSİS, birth date, address,                                                    e-mail, KEP, phone, 22+ credential formats

Install

bash
npx -y @guardbee/mcp-document-scanner scan ./contracts      # text layers onlynpm i -g @guardbee/mcp-document-scanner tesseract.js @napi-rs/canvas   # with OCR

OCR is optional: tesseract.js reads images, and @napi-rs/canvas (prebuilt, no compiler needed) renders scanned PDF pages for it. Without them the scanner still reads every PDF text layer and says which pages or images it could not read. Tesseract downloads the tur and eng language data (~10 MB) on first use into ~/.cache/guardbee/tessdata (or $XDG_CACHE_HOME/guardbee/tessdata) — never into your working directory. Offline: put <lang>.traineddata in a folder and pass --lang-path.

MCP tools

ToolWhat it does
scan_documentScan a file, or every PDF and image in a folder
scan_base64Scan bytes given as base64 (an attachment, an image a tool returned); the type comes from the bytes
list_detectorsThe personal-data and credential detectors that run
json
{ "mcpServers": { "documents": { "command": "npx", "args": ["-y", "@guardbee/mcp-document-scanner"] } } }

CLI

bash
guardbee-document-scanner scan <file|folder> [--format=text|json|sarif] [--fail-on=any|critical|high|medium|low|none]                               [--no-ocr] [--lang=tur,eng] [--lang-path=<dir>] [--cache-path=<dir>] [--include=ip_address,plate_tr]                               [--max-pages=50] [--max-files=500] [--text]
⚠️  Found 3 item(s) in 1 document(s) (812ms)   Critical: 0  High: 2  Medium: 1  Low: 0
contracts/acme.pdf (pdf, 2 page(s) read)  [HIGH] tc_kimlik (personal) — page 1, pdf-text: 10*******46  [HIGH] iban (personal) — page 2, pdf-ocr: TR************26  [MEDIUM] email (personal) — page 2, pdf-ocr: al***********om

Findings show only the first and last characters. --format=sarif gives SARIF 2.1.0 with the page as the line, for GitHub Code Scanning. Exit code 1 when something at or above --fail-on was found.

In the security proxy

@guardbee/mcp-security-proxy uses this package for interceptors.documents: images and embedded PDFs in tool results and resource blobs are scanned before the model sees them, and a document holding personal data or a credential is withheld (block) or logged (warn).

yaml
interceptors:  documents: { enabled: true, action: block, ocr: true, maxBytes: 26214400 }

Limits

  • The type is taken from the bytes, never from a file name or a MIME type.
  • 25 MB and 50 pages per document by default (maxBytes, --max-pages).
  • OCR quality depends on the scan; a blurry photo can miss a digit and so fail a checksum — such a value is not reported, which errs towards silence rather than false alarms.
  • Names, signatures and handwriting are not detected.

License

MIT

Feedback

Questions, ideas, or a false positive? Start a thread in GitHub Discussions or open an issue. If GuardBee is useful to you, a ⭐ on the repository helps others find it.

来源:packages/document-scanner/README.md,提交 bc5997d

工具

3

scan_document

Find PII (TC Kimlik No, IBAN, card, passport, e-mail, phone, address…) and credentials inside a PDF, an image (screenshot, scanned page) or a text file on disk, before it is given to an LLM. PDFs are read from their text layer; images and scanned pages with OCR (Turkish and English).

输入参数ocrpath必填includelanguages

scan_base64

Scan a document given as base64 (an attachment, an image a tool returned) for PII and credentials. The type is detected from the bytes.

输入参数ocrdata必填labelincludelanguages

list_detectors

List the PII and credential detectors this scanner runs

无需输入参数。

版本历史

8
  1. v0.4.1最新Oct 30, 2026
  2. v0.3.0Oct 22, 2026
  3. v0.1.10Oct 21, 2026
  4. v0.1.9Oct 20, 2026
  5. v0.1.7Oct 19, 2026
  6. v0.1.5Oct 16, 2026
  7. v0.1.4Oct 15, 2026
  8. v0.1.2Oct 14, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分