scanner-mcp
Enables scanning documents via network (eSCL) or USB (WIA/SANE) scanners, returning inline images, OCR text, or saved PDFs for Claude to read.
README
scanner-mcp
Let Claude scan and read paper documents from any USB or network scanner.
<p align="center"> <img src="https://raw.githubusercontent.com/AminHA1248/scanner-mcp/main/docs/demo.gif" alt="Ask Claude to scan a document; it calls the scan_document tool and reads the page back" width="760"> </p>
A generic MCP server that exposes a scanning tool to Claude (and any other MCP client). It works with network scanners through the standard eSCL / AirScan / Mopria protocol and with USB scanners through the platform driver stack — WIA on Windows and SANE on Linux/macOS. No vendor-specific driver code.
When Claude needs to read a paper document, it can call scan_document, and the page
image is returned inline so Claude can read it directly (optionally OCR'd to text, or
saved as PDF).
What it exposes
| Tool | Purpose |
|---|---|
list_scanners |
Discover every scanner reachable from this machine (network + USB). |
scan_document |
Scan a page/stack and return it as inline images, a saved file, and/or OCR text. |
Backends are auto-detected and degrade gracefully — the same server runs on any OS and lights up whatever scanners it can reach:
- eSCL (
_uscan._tcpmDNS) — driverless network MFPs/scanners. Cross-platform. - WIA — USB (and some network) scanners on Windows, driven via PowerShell COM.
- TWAIN — Windows scanners that expose only a TWAIN data source (older/pro units
with no usable WIA driver). Optional; needs
pytwain+ a TWAIN DSM (see below). - SANE (
scanimage) — USB/network scanners on Linux and macOS.
Install
cd scanner-mcp
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
pip install -e .
# optional OCR support:
pip install -e ".[ocr]" # also needs the Tesseract binary installed
# optional TWAIN backend (Windows only):
pip install -e ".[twain]" # also needs a TWAIN DSM (see below)
Platform prerequisites:
- Windows: nothing extra for WIA — it and PowerShell ship with Windows. Install the
scanner's normal Windows driver so it appears in Devices.
- TWAIN (optional): install
pytwain(pip install -e ".[twain]") and make sure a TWAIN DSM is present. 64-bit Python needsTWAINDSM.dll(shipped by most TWAIN 2.x drivers or the TWAIN DSM redistributable); 32-bit Python can use the classictwain_32.dll. If neither is installed, the TWAIN backend just stays disabled.
- TWAIN (optional): install
- Linux:
sudo apt install sane-utils(providesscanimage). - macOS:
brew install sane-backendsfor USB; network scanners work via eSCL with no extras. - Network scanners: just be on the same LAN/subnet; mDNS handles discovery.
Connect it to Claude
Claude Desktop
Edit claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"scanner": {
"command": "C:\\Users\\aminh\\scanner-mcp\\.venv\\Scripts\\scanner-mcp.exe"
}
}
}
On macOS/Linux use the venv path /path/to/scanner-mcp/.venv/bin/scanner-mcp.
Claude Code (CLI)
claude mcp add scanner -- /path/to/scanner-mcp/.venv/bin/scanner-mcp
Restart the client, then ask Claude: "List my scanners" or "Scan the document on the glass and read it."
How you actually run it
You normally don't launch anything yourself — Claude Desktop/Code starts the
scanner-mcp server in the background (per the config above) and calls its tools when
you ask. Running scanner-mcp by hand just starts the MCP server, which waits silently
for JSON-RPC on stdin; it is not an interactive shell.
To test the hardware without Claude, use the bundled CLI, test_scan.py:
# from the project folder, using the venv's Python
python test_scan.py --list # discover scanners
python test_scan.py --dpi 300 # scan (auto-selects if only one)
python test_scan.py --scanner "<id>" --source adf --format pdf
Configuration (env vars)
| Variable | Default | Meaning |
|---|---|---|
SCANNER_MCP_SAVE_DIR |
~/Scans |
Where scans are written. |
SCANNER_MCP_LOG |
INFO |
Log level. |
scan_document options
scanner_id (from list_scanners; auto if only one), source
(auto/platen/adf/adf-duplex), resolution (DPI), color_mode
(color/gray/lineart), output_format (png/jpeg/pdf), save_dir,
return_image (inline images for Claude to read), ocr (extract text).
Notes & limitations
- eSCL covers most scanners sold in the last ~decade (anything "AirPrint/AirScan" or "Mopria" capable). Older USB-only units go through WIA/SANE instead.
- PDF output for multi-page WIA scans is assembled with Pillow.
- HTTPS eSCL devices use self-signed certs, so TLS verification is disabled for them (typical for LAN scanners); prefer a trusted network.
- This server performs local hardware I/O only — it does not send anything to the cloud.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。